Kubernetes version: v1.16.2
Host OS: Mac 10.14
apiVersion: v1 kind: PersistentVolume metadata: name: local-storage spec: storageClassName: ssd capacity: storage: 20Gi accessModes: - ReadWriteOnce hostPath: path: /data/mongo type: DirectoryOrCreate
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: myclaim spec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi storageClassName: ssd
I create a PV with 20G and a PVC claiming 10G. The PVC bound to PV successfully. When I check the PVC using
kubectl get pvc or
kubectl describe pvc ..., the capacity is 20G not 10G. In fact, I cannot find anything reflecting that I only request 10G. When I attach the pvc to a pod, does the container in the pod have access to a 10G space or 20G space?