在Minikube中,创建了许多Persistent Volumes并将其声明为一种实践?他们是否在本地机器上保留磁盘空间?
检查磁盘使用情况
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
storageClassName: shared
hostPath:
path: /data/config
---
$ kubectl create -f 7e1_pv.yaml
$ kubectl get pv
现在为持久卷声明创建 YAML
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc
spec:
storageClassName: shared
accessModes:
- ReadWriteMany
resources:
requests:
storage:90Gi
$ kubectl create -f 7e2_pvc.yaml