---
kind: Pod
apiVersion: v1
metadata:
  name: nginx-pod-inline-volume
spec:
  nodeSelector:
    "kubernetes.io/os": linux
  containers:
    - image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
      name: nginx-nfs
      command:
        - "/bin/bash"
        - "-c"
        - set -euo pipefail; while true; do echo $(date) >> /mnt/nfs/outfile; sleep 1; done
      volumeMounts:
        - name: persistent-storage
          mountPath: "/mnt/nfs"
  volumes:
    - name: persistent-storage
      csi:
        driver: nfs.csi.k8s.io
        volumeAttributes:
          server: nfs-server.default.svc.cluster.local  # required
          share: /  # required
          mountOptions: "nfsvers=4.1,sec=sys"  # optional
