# Nginx pod with pre provisioned storage using Exascaler CSI driver # # $ kubectl apply -f examples/kubernetes/nginx-persistent-volume.yaml # # -------------------------------------- # Exascaler CSI Driver - Storage Class # -------------------------------------- apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: exascaler-csi-file-driver-sc-nginx-persistent provisioner: exa.csi.ddn.com --- # ------------------------------------------ # Exascaler CSI Driver - Persistent Volume # ------------------------------------------ apiVersion: v1 kind: PersistentVolume metadata: name: exascaler-csi-file-driver-pv-nginx-persistent labels: name: exascaler-csi-file-driver-pv-nginx-persistent spec: storageClassName: exascaler-csi-file-driver-sc-nginx-persistent accessModes: - ReadWriteMany capacity: storage: 1Gi csi: driver: exa.csi.ddn.com volumeHandle: exa1:/nginx-persistent volumeAttributes: # volumeAttributes are the alternative of storageClass params for static (precreated) volumes. # mountOptions: ro, noflock # list of options for `mount` command bindMount: "false" # Determines, whether volume will bind mounted or as a separate lustre mount. exaMountUid: "1001" # Uid which will be used to access the volume in pod. Should be synced between EXA server and clients. --- # ------------------------------------------------ # Exascaler CSI Driver - Persistent Volume Claim # ------------------------------------------------ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: exascaler-csi-file-driver-pvc-nginx-persistent spec: storageClassName: exascaler-csi-file-driver-sc-nginx-persistent accessModes: - ReadWriteMany resources: requests: storage: 1Gi selector: matchLabels: # to create 1-1 relationship for pod - persistent volume use unique labels name: exascaler-csi-file-driver-pv-nginx-persistent --- # --------- # Nginx pod # --------- apiVersion: v1 kind: Pod metadata: name: nginx-persistent-volume spec: securityContext: runAsUser: 1001 containers: - image: nginxinc/nginx-unprivileged imagePullPolicy: IfNotPresent name: nginx ports: - containerPort: 80 protocol: TCP volumeMounts: - mountPath: /usr/share/nginx/html name: exascaler-csi-file-driver-data volumes: - name: exascaler-csi-file-driver-data persistentVolumeClaim: claimName: exascaler-csi-file-driver-pvc-nginx-persistent readOnly: false