Home > Storage > PowerFlex > White Papers > Amazon Elastic Kubernetes Service Anywhere on Dell PowerFlex > Use case 3: Snapshot with PowerFlex CSI
This use case describes how to take a screenshot with PowerFlex CSI:
apiVersion: v1 kind: Service metadata: name: mysql spec: ports: - port: 3306 selector: app: mysql clusterIP: None --- apiVersion: apps/v1 kind: Deployment metadata: name: mysql spec: selector: matchLabels: app: mysql strategy: type: Recreate template: metadata: labels: app: mysql spec: containers: - image: mysql:5.6 name: mysql env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD value: password ports: - containerPort: 3306 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-pv-claim |
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mysql-pv-claim spec: storageClassName: vxflexos accessModes: - ReadWriteOnce resources: requests: storage: 8Gi |
Figure 26. Pod 1 MySQL Deployment with PVC volume
Figure 27. Create Sales database
apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshot metadata: name: mysql-pv-claim-snap1 namespace: default spec: volumeSnapshotClassName: vxflexos-snapclass source: persistentVolumeClaimName: mysql-pv-claim |
apiVersion: v1 kind: Service metadata: name: mysql-2 spec: ports: - port: 3307 selector: app: mysql clusterIP: None --- apiVersion: apps/v1 kind: Deployment metadata: name: mysql-2 spec: selector: matchLabels: app: mysql strategy: type: Recreate template: metadata: labels: app: mysql spec: containers: - image: mysql:5.6 name: mysql env: # Use secret in real usage - name: MYSQL_ROOT_PASSWORD value: password ports: - containerPort: 3307 name: mysql volumeMounts: - name: mysql-persistent-storage mountPath: /var/lib/mysql volumes: - name: mysql-persistent-storage persistentVolumeClaim: claimName: mysql-pv-claim-snap1 |
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: mysql-pv-claim-snap1 spec: storageClassName: vxflexos accessModes: - ReadWriteOnce resources: requests: storage: 8Gi |
Figure 28. Pod 2 Deployment
Figure 29. Attached Pod 1 PVC to Pod 2