Backing up an application

Let's perform the following steps to take a backup of our application:

  1. If you have an application and persistent volumes associated with the backup labeled already, you can skip to Step 5. Otherwise, create a namespace and a PVC using the following example code:
$ cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
name: backup-example
labels:
app: app2backup
EOF
  1. Create a PVC in the backup-example namespace:
$ cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc2backup
namespace: backup-example
labels:
app: app2backup
spec:
accessModes:
- ReadWriteOnce
storageClassName: openebs-cstor-default
resources:
requests:
storage: 4Gi
EOF

  1. Create a pod that will use the PVC and write to the /data/out.txt file inside the pod using the sample myapp.yaml manifest under the src/chapter6/kasten directory:
$ kubectl apply -f - kasten/myapp.yaml
  1. Verify that our myapp pod writes data to the volume:
$ kubectl exec -it myapp cat /data/out.txt -nbackup-example
Thu Sep 12 23:18:08 UTC 2019
  1. On the Kasten Dashboard, click on Unmanaged applications:

  1. In the backup-example namespace, click on Create a policy:

  1. Enter a name and select the Snapshot action:

  1. Select Daily as the Action Frequency:

  1. Click on Create Policy:

By following these steps, you will have created your first backup using the policy, as well as a schedule for the following backup jobs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.27.178