Kubernetes Persistent Volume Claim Manifest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Kubernetes Storage Concepts")
 
 
(24 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
* https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/
=Internal=
=Internal=
* [[Kubernetes_Storage_Concepts#PersistentVolumeClaim_.28PVC.29|Kubernetes Storage Concepts]]
* [[Kubernetes_Storage_Concepts#Persistent_Volume_Claim_.28PVC.29|Kubernetes Storage Concepts]]
 
=Example=
 
[[Kubernetes_Manifests#apiVersion|apiVersion]]: v1
[[Kubernetes_Manifests#kind|kind]]: PersistentVolumeClaim
[[Kubernetes_Manifest_Metadata#Overview|metadata]]:
  [[Kubernetes_Manifest_Metadata#name|name]]: pvc1
<span id='manifest_spec'></span>[[Kubernetes_Manifests#spec|spec]]:
  [[#accessModes|accessModes]]:
  - ReadWriteOnce
  [[#storageClassName|storageClassName]]: test
  # [[#volumeName|volumeName]]: testVolume
  [[#resources|resources]]:
    [[#requests|requests]]:
      [[#storage|storage]]: 10Gi
  ...
 
=.spec Elements=
The values in the [[#manifest_spec|.spec]] section must match with the persistent volume it intends to bind with. Persistent volume's [[Kubernetes_Storage_Concepts#Access_Mode|access mode]], [[Kubernetes_Storage_Concepts#Storage_Class_Name|storage class name]] and [[Kubernetes_Storage_Concepts#Capacity|capacity]] must match.
==accessModes==
{{Internal|Kubernetes_Storage_Concepts#Access_Mode|Access Mode}}
==storageClassName==
{{External|https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1}}
 
Name of the [[Kubernetes_Storage_Concepts#Storage_Class_.28SC.29|StorageClass]] required by the claim. For a description of the claim behavior when no storage class name is present, see [[Kubernetes_Storage_Concepts#Persistent_Volume_Claims_and_Storage_Class|Persistent Volume Claims and Storage Class]].
 
==volumeName==
 
Optionally, the persistent volume name can be specified. For a description of the claim behavior when both the storage class and the persistent volume name are specified, see [[Kubernetes_Storage_Concepts#Persistent_Volume_Claims_and_Storage_Class|Persistent Volume Claims and Storage Class]].
 
==volumeMode==
 
'volumeMode' defines what type of volume is required by the claim. Value of "Filesystem" is implied when not included in claim spec
 
==resources==
===requests===
====storage====
 
A [[Kubernetes_Resource_Management_Concepts#Quantities|quantity]] specifying the minimum amount of storage required.

Latest revision as of 01:05, 27 May 2021

External

Internal

Example

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc1
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: test
  # volumeName: testVolume
  resources:
    requests:
      storage: 10Gi
  ...

.spec Elements

The values in the .spec section must match with the persistent volume it intends to bind with. Persistent volume's access mode, storage class name and capacity must match.

accessModes

Access Mode

storageClassName

https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1

Name of the StorageClass required by the claim. For a description of the claim behavior when no storage class name is present, see Persistent Volume Claims and Storage Class.

volumeName

Optionally, the persistent volume name can be specified. For a description of the claim behavior when both the storage class and the persistent volume name are specified, see Persistent Volume Claims and Storage Class.

volumeMode

'volumeMode' defines what type of volume is required by the claim. Value of "Filesystem" is implied when not included in claim spec

resources

requests

storage

A quantity specifying the minimum amount of storage required.