Kubernetes Persistent Volume Manifest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 20: Line 20:
   [[#local|local]]:
   [[#local|local]]:
     path: /mnt/disks/vol1
     path: /mnt/disks/vol1
  [[#volumeMode|volumeMode]]:
  [[#mountOptions|mountOptions]]:
   [[#nodeAffinity|nodeAffinity]]:
   [[#nodeAffinity|nodeAffinity]]:
     required:
     required:

Revision as of 22:46, 30 March 2021

External

Internal

Example

apiVersion: v1
kind: PersistentVolume
metadata:
  name: blue
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 10Gi
  # local volumes only support "Retain"
  persistentVolumeReclaimPolicy: Retain
  storageClassName: local-storage
  local:
    path: /mnt/disks/vol1
  volumeMode:
  mountOptions:
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
           operator: In
           values:
           - my-node

.spec Elements

accessModes

Access Mode

storageClassName

persistentVolumeReclaimPolicy

Reclaim Policy

capacity

Capacity

storageClassName

local

nodeAffinity

Node Affinity