数据持久化 - 二
准备 PV 与 PVC
准备创建 PV 所需的 yaml 文件
cat > pv1.yaml << EOF
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv1
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
nfs:
server: 10.0.0.31
path: "/data/pv1"
readOnly: false
EOF
准备创建 PVC 所需的 yaml 文件
创建 PV PVC
查看 PV 与 PVC
使用 PVC
准备 Deployment 资源的 yaml 文件
检验数据持久化结果
方式一:
方式二:
Last updated