Kubernetes Persistent Volume Manifest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 14: Line 14:
   [[#capacity|capacity]]:
   [[#capacity|capacity]]:
     storage: 10Gi
     storage: 10Gi
   # local volumes only support "Retain"
   <font color=teal># local volumes only support "Retain"</font>
   [[#persistentVolumeReclaimPolicy|persistentVolumeReclaimPolicy]]: Retain
   [[#persistentVolumeReclaimPolicy|persistentVolumeReclaimPolicy]]: Retain
   [[#storageClassName|storageClassName]]: local-storage
   [[#storageClassName|storageClassName]]: local-storage

Revision as of 18:10, 12 December 2019

Internal

Example

apiVersion: v1
kind: PersistentVolume
metadata:
  name: blue
spec:
  accessModes:
  - RedWriteOnce
  storageClassName: test
  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