backup-restore init

Initialize the cpd-cli backup-restore command for backup and restore.

Syntax

cpd-cli backup-restore init \
[--aux-pod-cpu-limit=<auxiliary-pod-cpu-limit-value>] \
[--aux-pod-cpu-request=<auxiliary-pod-cpu-request-value>] \
[--aux-pod-mem-limit=<auxiliary-pod-memory-limit-value>] \
[--aux-pod-mem-request=<auxiliary-pod-memory-request-value>] \
[--image-prefix=<image-registry-prefix>] \
[--log-level=info|debug|warn|error|panic] \
[--namespace=<namespace-name>] \
[--provider=<storage-provider-type>] \
[--pvc-name=<persistence-volume-claim-name>] \
[--s3-bucket=<S3-bucket-name>] \
[--s3-endpoint=<S3-endpoint-URL>] \
[--s3-prefix=<S3-bucket-directory-path>] \
[--s3-region=<AWS-region-value>] \
[--service-account=<openshift-container-platform-service-account>] \
[--verbose]

Arguments

The init command has no arguments.

Options

Option Description
--aux-pod-cpu-limit The CPU limit for the IBM® Cloud Pak for Data auxiliary pod.
Status
Optional.
Syntax
--aux-pod-cpu-limit=<auxiliary-pod-cpu-limit-value>
Default value
0 (unbounded)
Valid values
CPU limits are measured in CPU units. One CPU is equivalent to one CPU/core for cloud providers and one hyper-thread on bare-metal Intel processors. An m suffix in a CPU attribute indicates ‘milli-CPU’ (250m is equivalent to 25% of a CPU/core).
--aux-pod-cpu-request The CPU request for the IBM Cloud Pak for Data auxiliary pod.
Status
Optional.
Syntax
--aux-pod-cpu-request=<auxiliary-pod-cpu-request-value>
Default value
0
Valid values
CPU requests are measured in CPU units. One CPU is equivalent to one CPU/core for cloud providers and one hyper-thread on bare-metal Intel processors. An m suffix in a CPU attribute indicates ‘milli-CPU’ (250m is equivalent to 25% of a CPU/core).
--aux-pod-mem-limit The memory limit for the IBM Cloud Pak for Data auxiliary pod.
Status
Optional.
Syntax
--aux-pod-mem-limit=<auxiliary-pod-memory-limit-value>
Default value
0
Valid values
Memory can be expressed in various units, where one Mi is one IEC unit megabyte (1024^2), and one Gi is one IEC unit gigabyte (1024^3).
--aux-pod-mem-request The memory request for the IBM Cloud Pak for Data auxiliary pod.
Status
Optional.
Syntax
--aux-pod-mem-request=<auxiliary-pod-memory-request-value>
Default value
0
Valid values
Memory can be expressed in various units, where one Mi is one IEC unit megabyte (1024^2), and one Gi is one IEC unit gigabyte (1024^3).

--help

-h

Display command help.
Status
Optional.
Syntax
--help
Default value
No default.
Valid values
Not applicable.
--image-prefix Specify the image registry prefix.
Status
Optional.
Syntax
--image-prefix=icr.io/cpopen/cpd
Default value
icr.io/cpopen/cpd
Valid values
  • icr.io/cpopen/cpd
  • ${PRIVATE_REGISTRY_LOCATION}
--log-level The command log level.
Status
Optional.
Syntax
--log-level=info|debug|warn|error|panic
Default value
info
Valid values
debug
Debug messages are written to the log.
error
Error messages are written to the log.
info
Informative messages are written to the log.
panic
Panic messages are written to the log.
warn
Warning messages are written to the log.

--namespace

-n

The namespace name in which the utility should operate.
Status
Optional.
Syntax
--namespace=<namespace-name>
Default value
${PROJECT_CPD_INSTANCE}
Valid values
A valid project (namespace) name.
--provider The storage provider type.
Status
Optional.
Syntax
--provider=<storage-provider-type>
Default value
local
Valid values
local
Use a local repository.
s3
Use an S3 repository.
--pvc-name Specify which persistence volume claim name to use for the command.
Status
Optional.
Syntax
--pvc-name=<persistence-volume-claim-name>
Default value
No default..
Valid values
Any valid persistence volume claim name.
--s3-bucket The storage bucket name where backups are stored.
Status
Applicable only for S3 repositories.
Syntax
--s3-bucket=<S3-bucket-name>
Default value
720h0m0s
Valid values
Any valid storage bucket name.
--s3-endpoint The endpoint URL to access the Amazon S3 API.
Status
Applicable only for S3 repositories.
Syntax
--s3-endpoint=<S3-endpoint-URL>
Default value
No default.
Valid values
Any valid S3 endpoint URL.
--s3-prefix The prefix that denotes the bucket directory path.
Status
Applicable only for S3 repositories.
Syntax
--s3-prefix=<S3-bucket-directory-path>
Default value
No default.
Valid values
Any valid bucket directory path.
--s3-region The Amazon Web Services (AWS) region.
Status
Optional.
Syntax
--s3-region=<AWS-region-value>
Default value
us-west-1
Valid values
For a full list of region codes, see https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints.
--service-account Specify the Openshift Container Platform service account.
Status
Optional.
Syntax
--service-account=<openshift-container-platform-service-account>
Default value
cpd-admin-sa
Valid values
Any valid OpenShift® Container Platform service account name.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.

Examples

Note: The following examples use the recommended installation environment variables.

Use a script to create environment variables with the correct values for your environment. For more information, see Best practice: Setting up install variables.

Your docker image registry might be different than the provided examples.

Local repository
cpd-cli backup-restore init \
--namespace=${PROJECT_CPD_INSTANCE} \
--log-level=debug \
--verbose \
--pvc-name=cpdbr-pvc \ 
--image-prefix=icr.io/cpopen/cpd \
--provider=local
S3 repository: Red Hat® OpenShift 4.x
Initialize the cpdbr first with PVC name and S3 storage. The bucket must exist.
cpd-cli backup-restore init \
--namespace=${PROJECT_CPD_INSTANCE} \
--pvc-name=cpdbr-pvc \
--image-prefix=icr.io/cpopen/cpd \
--provider=s3 \
--s3-endpoint="s3 endpoint" \
--s3-bucket=cpdbr \
--s3-prefix=${PROJECT_CPD_INSTANCE}

Shared volume PVC

backup-restore requires that a shared volume PVC is created and bounded for use with the init command. If your PV is Portworx, ensure that it is shared enabled.
oc apply -f cpdbr-pvc.yaml

cpdbr-pvc.yaml content:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: cpdbr-pvc
spec:
  storageClassName: nfs-client
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 200Gi

Repository secret

For volume backup-restore, a repository secret named cpdbr-repo-secret must be created before you issue the backup-restore init command.

For the local provider, the repository secret requires the following credential information.

RESTIC_PASSWORD
The restic password that is used to create the repository.
# setup the repository secret for local
echo -n 'restic' > RESTIC_PASSWORD
oc create secret generic -n ${PROJECT_CPD_INSTANCE} cpdbr-repo-secret \
    --from-file=./RESTIC_PASSWORD

For the S3 provider, the repository secret requires the following credential information.

RESTIC_PASSWORD
The restic password that is used to create the repository.
AWS_ACCESS_KEY_ID
The AWS access key ID
AWS_SECRET_ACCESS_KEY
The AWS secret access key.
# setup the repository secret for S3
echo -n 'restic' > RESTIC_PASSWORD
echo -n 'minio' > AWS_ACCESS_KEY_ID
echo -n 'minio123' > AWS_SECRET_ACCESS_KEY

oc create secret generic -n ${PROJECT_CPD_INSTANCE} cpdbr-repo-secret \
    --from-file=./RESTIC_PASSWORD \
    --from-file=./AWS_ACCESS_KEY_ID \
    --from-file=./AWS_SECRET_ACCESS_KEY