Kubernetes Persistent Volume Manifest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 10: Line 10:
  [[Kubernetes_Manifests#spec|spec]]:
  [[Kubernetes_Manifests#spec|spec]]:
   [[#accessModes|accessModes]]:
   [[#accessModes|accessModes]]:
   - RedWriteOnce
   - ReadWriteOnce
   [[#capacity|capacity]]:
   [[#capacity|capacity]]:
     storage: 10Gi
     storage: 10Gi

Revision as of 01:56, 4 November 2020

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