Backing Up and Restoring Cisco Container Platform

This chapter contains the following topics:

Backing Up Cisco Container Platform

You can back up the Cisco Container Platform application data that pertains to the following components:

  • Application users

  • Virtualization providers

  • Tenant clusters


Note

The logging or monitoring data from Prometheus, Grafana, and the EFK stack is not included in the backup archive.

Backing Up Cisco Container Platform v1.5.0+

Procedure


Step 1

Log in to the console of the master node of Cisco Container Platform Control Plane.

Step 2

Run the following command.

/ccp_related_files/percona_backup.sh ./backup.tar
Step 3

Copy the backup.tar backup archive to a secure location.

Note 
You must ensure that the backup archive is maintained securely as anyone with access to it has administrative capabilities on all tenant clusters.

Backing Up Cisco Container Platform v1.1.0-1.4.x

Procedure


Step 1

Log in to the console of the master node of Cisco Container Platform Control Plane.

Step 2

Run the following commands.

    kubectl exec mysql-0 -- mkdir -p /tmp/backup
    kubectl exec -t mysql-0 -- bash -c "rm -Rf /tmp/backup/* && xtrabackup --backup --target-dir=/tmp/backup  -p$(kubectl get secret mysql -o jsonpath='{.data.mysql-root-password}'|base64 -d)    --alsologtostderr=true" 
    kubectl exec mysql-0 -- tar -cvf /tmp/backup.tar /tmp/backup
    kubectl cp mysql-0:/tmp/backup.tar ./backup.tar
Note 
Depending on the memory usage of the database, any of the preceding commands may fail with an ExitCode:137 error code. It is safe to run these commands multiple times until they succeed.
Step 3

Copy the backup.tar backup archive to a secure location.

Note 
You must ensure that the backup archive is maintained securely as anyone with access to it has administrative capabilities on all tenant clusters.

Restoring Cisco Container Platform

You can restore a valid backup to a new Cisco Container Platform Control Plane that has control over all existing Cisco Container Platform settings and tenant clusters.

Restoring Cisco Container Platform Control Plane data is slightly different from traditional restore methods. The data can be restored into a version of Cisco Container Platform newer than the version from which the backup was made.

For example, you may back up the data from a Cisco Container Platform Control Plane v1.4 installation, and then, as part of a restore or recovery process, restore that data into a new Cisco Container Platform Control Plane v1.5 installation.

You can restore data into any version of Cisco Container Platform v1.5 or later. For example, because upgrades are supported from v1.4 to v1.5, it is possible to restore a v1.4 backup into a new Cisco Container Platform v1.5 install.

Procedure


Step 1

Power off the VMs that belong to the previous Control Plane instance.

Step 2

Install a new Cisco Container Platform Control Plane v1.5.0+.

Step 3

Copy the backup from the secure location to Control Plane master.

scp ./backup.tar <control_plane_master>:/tmp/backup.tar
Step 4

Log in to the console of the master node of Cisco Container Platform Control Plane.

Step 5

Run the following command.

/ccp_related_files/percona_restore.sh /tmp/backup.tar