apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-zrs
spec:
  selector:
    matchLabels:
      app: nginx-zrs
  template:
    metadata:
      labels:
        app: nginx-zrs
    spec:
      containers:
      - name: nginx
        image: nginx
        command:
        - "/bin/sh"
        - "-c"
        - while true; do echo $(date) >> /mnt/azuredisk/outfile; sleep 60; done
        volumeMounts:
          - name: azuredisk-zrs
            mountPath: "/mnt/azuredisk"
      volumes:
        - name: azuredisk-zrs
          persistentVolumeClaim:
            claimName: azure-managed-disk-zrs
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: managed-csi-zrs
parameters:
  skuname: StandardSSD_ZRS
provisioner: disk.csi.azure.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: azure-managed-disk-zrs
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: managed-csi-zrs
  resources:
    requests:
      storage: 5Gi