doc: add daemonset-nfs-ephemeral.yaml example
This commit is contained in:
parent
2eb84d501e
commit
262d335441
38
deploy/example/daemonset-nfs-ephemeral.yaml
Normal file
38
deploy/example/daemonset-nfs-ephemeral.yaml
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
kind: DaemonSet
|
||||
apiVersion: apps/v1
|
||||
metadata:
|
||||
name: daemonset-nfs-ephemeral
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: daemonset-nfs-ephemeral
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: daemonset-nfs-ephemeral
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
containers:
|
||||
- name: nginx
|
||||
image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
|
||||
command:
|
||||
- "/bin/bash"
|
||||
- "-c"
|
||||
- set -euo pipefail; while true; do echo $(date) >> /mnt/nfs/outfile; sleep 1; done
|
||||
volumeMounts:
|
||||
- name: nfs
|
||||
mountPath: "/mnt/nfs"
|
||||
readOnly: false
|
||||
volumes:
|
||||
- name: nfs
|
||||
ephemeral:
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
storageClassName: nfs-csi
|
||||
@ -20,6 +20,7 @@ echo "begin to create deployment examples ..."
|
||||
kubectl apply -f ./deploy/example/storageclass-nfs.yaml
|
||||
kubectl apply -f ./deploy/example/deployment.yaml
|
||||
kubectl apply -f ./deploy/example/statefulset.yaml
|
||||
kubectl apply -f ./deploy/example/daemonset-nfs-ephemeral.yaml
|
||||
|
||||
echo "sleep 60s ..."
|
||||
sleep 60
|
||||
@ -29,5 +30,6 @@ kubectl get pods -o wide
|
||||
|
||||
kubectl get pods --field-selector status.phase=Running | grep deployment-nfs
|
||||
kubectl get pods --field-selector status.phase=Running | grep statefulset-nfs-0
|
||||
kubectl get pods --field-selector status.phase=Running | grep daemonset-nfs-ephemeral
|
||||
|
||||
echo "deployment examples running completed."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user