快速批量创建nfs pv
for i in {3..6}; do
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv00${i}
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
nfs:
path: /volume1/harbor/nfs${i}
server: 192.168.2.4
EOF
done
快速批量创建nfs pvc
for i in {3..6}; do
cat <<EOF | kubectl delete -f -
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc00${i}-claim
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
EOF
done
原文地址:http://blog.51cto.com/m51cto/2342787
时间: 2024-10-08 21:16:58