73 lines
1.7 KiB
YAML
73 lines
1.7 KiB
YAML
# --------------------------------------
|
|
# Exascaler CSI Driver - Storage Class
|
|
# --------------------------------------
|
|
|
|
apiVersion: storage.k8s.io/v1
|
|
kind: StorageClass
|
|
metadata:
|
|
name: nginx-sc
|
|
provisioner: exa.csi.ddn.com
|
|
allowedTopologies:
|
|
- matchLabelExpressions:
|
|
- key: topology.exa.csi.ddn.com/zone
|
|
values:
|
|
- zone-1
|
|
parameters:
|
|
exaMountUid: "1001" # Uid which will be used to access the volume in pod. Should be synced between EXA server and clients.
|
|
# projectId: "100001" # Points to a project id to be used to set volume quota.
|
|
# bindMount: "false"
|
|
---
|
|
|
|
# ------------------------------------------------
|
|
# Exaxscaler CSI Driver - Persistent Volume Claim
|
|
# ------------------------------------------------
|
|
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: nginx-pvc
|
|
spec:
|
|
storageClassName: nginx-sc
|
|
accessModes:
|
|
- ReadWriteMany
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
---
|
|
|
|
# ---------
|
|
# Nginx pod
|
|
# ---------
|
|
|
|
apiVersion: v1
|
|
kind: Pod
|
|
metadata:
|
|
name: nginx-volume
|
|
spec:
|
|
topologySpreadConstraints:
|
|
- maxSkew: 1
|
|
topologyKey: topology.exa.csi.ddn.com/zone
|
|
whenUnsatisfiable: DoNotSchedule
|
|
labelSelector:
|
|
matchLabels:
|
|
topology.exa.csi.ddn.com/zone: zone-1
|
|
securityContext:
|
|
runAsUser: 1001
|
|
# runAsUser: 1002
|
|
# fsGroup: 1001
|
|
containers:
|
|
- image: nginxinc/nginx-unprivileged
|
|
imagePullPolicy: IfNotPresent
|
|
name: nginx
|
|
ports:
|
|
- containerPort: 80
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: nginx-data
|
|
volumes:
|
|
- name: nginx-data
|
|
persistentVolumeClaim:
|
|
claimName: nginx-pvc
|
|
readOnly: false
|