Let's perform the following steps to deploy the new version of the application as our green deployment. We will switch the service to green, take a snapshot of blue's persistent volume, and deploy the green workload in a new pod:
- Let's create a snapshot of the data from the blue application's PVC and use it to deploy the green application:
$ kubectl create -f snapshot.yaml
volumesnapshot.volumesnapshot.external-storage.k8s.io "snapshot-blue" created
- Review the content of the green-percona.yaml file and use that to create the green version of your application:
$ kubectl create -f green-percona.yaml
pod "green" created
persistentvolumeclaim "demo-snap-vol-claim" created
This pod will use a snapshot of the PVC from the blue application as its original PVC.