给我写一个pv关联pvc的yaml文件
时间: 2023-03-08 18:55:51 浏览: 151
Kubernetes的PV&PVC的使用
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-volume
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: manual
# 指定pvc的名称
claimRef:
name: pvc-claim
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
# 指定pv的名称
volumeName: pv-volume
阅读全文