Kubernetes Persistent Volume Manifest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=External=
* https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#persistentvolume-v1-core
=Internal=
=Internal=
* [[Kubernetes_Storage_Concepts#Persistent_Volume_.28PV.29|Kubernetes Storage Concepts]]
* [[Kubernetes_Storage_Concepts#Persistent_Volume_.28PV.29|Kubernetes Storage Concepts]]
=Example=
=Example=



Revision as of 22:43, 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
  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