1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| apiVersion: v1 kind: PersistentVolume metadata: name: pv1 labels: release: "stable" spec: capacity: storage: 5Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain nfs: path: /soyuan/k8s/data/pv1 server: 172.16.100.224
|
1 2 3 4 5 6 7 8 9 10 11 12 13
| kind: PersistentVolumeClaim apiVersion: v1 metadata: name: myclaim spec: accessModes: - ReadWriteMany resources: requests: storage: 1Gi selector: matchLabels: release: "stable"
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| kind: Pod apiVersion: v1 metadata: name: mypod spec: containers: - name: mynginx image: nginx:latest volumeMounts: - mountPath: "/var/www/html" name: mypd volumes: - name: mypd persistentVolumeClaim: claimName: myclaim
|
https://jimmysong.io/kubernetes-handbook/practice/using-nfs-for-persistent-storage.html