kubernetes-yaml/description/Storage/PersistentVolumes/example-local.yml

25 lines
573 B
YAML
Raw Normal View History

2023-12-15 16:39:01 +08:00
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-local-example
spec:
capacity:
storage: 5Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: storage-local-example
local:
path: /data/k8s/pv/local/example
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- nodename-example-1
- nodename-example-2
- nodename-example-3