Tag: 持久性卷

挂载path中的单个节点本地kubernetes持续卷文件正从容器中删除

我正尝试在主机重新启动时保留一个容器/容器的状态。 我尝试了以下步骤: PV-Link 我在主机上创build了这个目录: mkdir -p /root/sample-data 在这个目录下创build一个文件: echo 'Hello from Kubernetes storage' > /root/sample-data/a.txt 我从这个文件创build了卷,索赔和pod: kubectl create -f ./sample-pod.yml persistentvolume "task-pv-volume" created persistentvolumeclaim "task-pv-claim" created pod "sample-pod" created sample-pod.yaml文件的内容: — kind: PersistentVolume apiVersion: v1 metadata: name: task-pv-volume labels: type: local spec: storageClassName: manual capacity: storage: 10Gi accessModes: – ReadWriteOnce hostPath: path: "/root/sample-data" — kind: […]