如下代码测试本地的PVC:
apiVersion: v1 kind: PersistentVolume metadata: name: mypv labels: type: local spec: accessModes: - ReadWriteOnce storageClassName: local-path capacity: storage: 10Gi hostPath: path: "/nfs" --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: local-path-pvc spec: volumeName: mypv accessModes: - ReadWriteOnce storageClassName: local-path resources: requests: storage: 1Gi --- apiVersion: v1 kind: Pod metadata: name: test-pd spec: containers: - image: docker.io/library/busybox name: test-container volumeMounts: - mountPath: /cache name: cache-volume volumes: - name: cache-volume persistentVolumeClaim: claimName: local-path-pvc
标签:pv,name,cache,pvc,path,k8s,local,spec From: https://www.cnblogs.com/qgbo/p/17922071.html