GPU-Live/template/gyeonggi/ddn/exa-csi-driver/examples/nginx-combined-volumes.yaml

126 lines
3.6 KiB
YAML

# --------------------------------------
# Exascaler CSI Driver - Storage Class
# --------------------------------------
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: exascaler-csi-file-driver-sc
provisioner: exa.csi.ddn.com
allowVolumeExpansion: true
parameters:
projectId: "100001" # Points to a project id to be used to set volume quota.
exaMountUid: "1001" # Uid which will be used to access the volume in pod.
bindMount: "false" # Determines, whether volume will bind mounted or as a separate lustre mount.
mountOptions: ro,noflock
---
# ------------------------------------------------
# Exaxscaler CSI Driver - Persistent Volume Claim
# ------------------------------------------------
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: exascaler-csi-file-driver-pvc
spec:
storageClassName: exascaler-csi-file-driver-sc
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
---
# --------------------------------------
# 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
allowVolumeExpansion: true
# mountOptions: noatime # list of options for `mount -o ...` command
---
# ------------------------------------------
# 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:/exaFS/nginx-persistent
volumeAttributes: # volumeAttributes are the alternative of storageClass params for static (precreated) volumes.
exaMountUid: "1001" # Uid which will be used to access the volume from the pod.
bindMount: "false" # Determines, whether volume will bind mounted or as a separate lustre mount.
#mountOptions: ro,flock # list of options for `mount` command
---
# ------------------------------------------------
# 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-dynamic-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-persistent-volume
- mountPath: /data
name: exascaler-dynamic-volume
volumes:
- name: exascaler-persistent-volume
persistentVolumeClaim:
claimName: exascaler-csi-file-driver-pvc-nginx-persistent
readOnly: false
- name: exascaler-dynamic-volume
persistentVolumeClaim:
claimName: exascaler-csi-file-driver-pvc
readOnly: false