k8s使用时,经常遇到要挂载NFS盘,可以参考k8s挂载NFS盘yaml编排文件
查pv,pvc状态命令 kubectl get pv,pvc
k8s挂载NFS盘yaml编排文件
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: filedata-rw namespace: default spec: accessModes: - ReadWriteMany resources: requests: storage: 1024Gi --- apiVersion: v1 kind: PersistentVolume metadata: name: filedata-rw namespace: default spec: capacity: storage: 1024Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain mountOptions: - hard - nfsvers=4.0 - noresvport nfs: path: /filedata server: xxx.xxx.xxx.xxx