Generating a manual backup of the management subsystem
You can generate a manual (non-scheduled) backup of the management subsystem
Procedure
- Make sure that the management cluster status is Running and the READY condition displays the same value before and after the "/".
For example:
kubectl get mgmt NAME READY STATUS VERSION RECONCILED VERSION AGE mgmt 16/16 Running 10.0.2.0 10.0.2.0-xxxx 19h
Note: Be sureREADY
status is16/16
. If you have just configured or reconfigured the backup settings, there is a period of time when the postgres pods are taken offline and brought back up with the new configuration. During this time, thekubectl get mgmt
command will show11/11
instead of16/16
. If you start a backup before the Management cluster is on16/16
, the backup attempt might stall indefinitely. - Decide which of the two types of manual backups you want to do:
full
: backs up the entire Management Subsystem database.incr
: backs up any data that has not been backed up since the lastfull
orincr
backup.
- You generate a backup manually by creating a managementBackup custom resource which is
detected by the ibm-apiconnect operator that then triggers the backup process.
You can use
mgmtbackup_cr.yaml
in thehelper_files
directory as an example:apiVersion: management.apiconnect.ibm.com/v1beta1 kind: ManagementBackup metadata: generateName: management- spec: type: full crType: create clusterName: management
Table 1 lists the CR settings for a manual backup.
Table 1. CR settings for manual backup Setting Description type
The type of backup to be done. Valid arguments are: full
Backs up the entire Management subsystem database
incr
Backs up any data that has not been backed up since the last
full
orincr
backup.
crType
Use create
to trigger a backup process.clusterName
The name of the target ManagementCluster you want to backup. - Create the ManagementBackup custom resource in the namespace of your Management Subsystem
to trigger the backup process:
$ kubectl create -f mgmtbackup_cr.yaml -n <namespace-of-mgmt-subsystem>
- (Optional): You can list current backups by using the command:
$ kubectl get managementbackup -n <namespace-of-mgmt-subsystem> --sort-by=.metadata.creationTimestamp
Here is an example of some possible output:
NAME STATUS ID CLUSTER TYPE CR TYPE AGE m1-e46bbac4 Ready 20201023-183005F m1 full record 66m mgmt-backup-dnvxw Ready 20201023-193137F m1 full create 9m37s
- (Optional): You can get a detailed view of a specific backup by using the command:
$ kubectl get managementbackup <bup-name> -n <namespace-of-mgmt-subsystem> -o yaml
Here is an example of some possible output:
apiVersion: management.apiconnect.ibm.com/v1beta1 kind: ManagementBackup metadata: creationTimestamp: "2020-10-23T18:34:11Z" generation: 1 labels: app.kubernetes.io/instance: m1 app.kubernetes.io/managed-by: ibm-apiconnect app.kubernetes.io/name: m1-e46bbac4 name: m1-e46bbac4 namespace: default resourceVersion: "6869" selfLink: /apis/management.apiconnect.ibm.com/v1beta1/namespaces/default/managementbackups/m1-e46bbac4 uid: b7b6be9c-82d4-4737-984f-58584a3fe582 spec: clusterName: m1 crType: create type: full status: clusterName: m1-fbaa5be2-postgres conditions: - lastTransitionTime: "2020-10-23T18:34:11Z" reason: BackupFailed status: "False" type: Error - lastTransitionTime: "2020-10-23T18:34:11Z" reason: BackupPending status: "False" type: Pending - lastTransitionTime: "2020-10-23T18:34:11Z" message: Record of management backup complete reason: BackupComplete status: "True" type: Ready - lastTransitionTime: "2020-10-23T18:34:11Z" reason: BackupInProgress status: "False" type: Running - lastTransitionTime: "2020-10-23T18:34:11Z" reason: BackupStatusUnknown status: "False" type: Warning crType: "" id: 20201023-183005F info: id: 20201023-183005F range: 2020-10-23 18:30:05 +0000 UTC - 2020-10-23 18:31:22 +0000 UTC rangeEnd: 1603477882 rangeStart: 1603477805 size: 32.6 MB totalsize: 32.6 MB type: full phase: Ready state: "" subsysName: m1