Kubernetes Storage Class Manifest: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 9: Line 9:
   annotations:
   annotations:
     <span id=default_storageclass_manifest'></span>storageclass.kubernetes.io/[[Kubernetes_Storage_Concepts#Default_Storage_Class|is-default-class]]: "true"
     <span id=default_storageclass_manifest'></span>storageclass.kubernetes.io/[[Kubernetes_Storage_Concepts#Default_Storage_Class|is-default-class]]: "true"
reclaimPolicy: Delete
<span id='volumeBindingMode_metadata'></span>[[#volumeBindingMode|volumeBindingMode]]: Immediate
  <span id='provisioner_metadata'></span>[[#provisioner|provisioner]]: kubernetes.io/aws-ebs
  <span id='provisioner_metadata'></span>[[#provisioner|provisioner]]: kubernetes.io/aws-ebs
  <span id='parameters_metadata'></span>[[#parameters|parameters]]:
  <span id='parameters_metadata'></span>[[#parameters|parameters]]:
Line 17: Line 19:


=Elements=
=Elements=
==volumeBindingMode==
Valid values:
* <span id=''Immediate></span>'''Immediate'''
* <span id=''WaitForFirstConsumer></span>'''WaitForFirstConsumer''' - this setting instructs the [[Kubernetes_Storage_Concepts#Persistent_Volume_Controller|persistent volume controller]] to not bind immediately a persistent volume claim. Instead, the system waits until a pod that needs to use a volume is scheduled. The scheduler then chooses an appropriate local persistent volume to bind to, taking into account the pod’s other scheduling constraints and policies. This ensures that the initial volume binding is compatible with any pod resource requirements, selectors, affinity and anti-affinity policies. This is a recommended setting for storage classes that offer [[Kubernetes_Storage_Concepts#local|local volumes]].


==provisioner==
==provisioner==

Latest revision as of 17:58, 12 December 2019

Internal

Example

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
reclaimPolicy: Delete
volumeBindingMode: Immediate
provisioner: kubernetes.io/aws-ebs
parameters:
  type: io1
  zone: us-west-2
  ipsPerGb: "10"
  ...

Elements

volumeBindingMode

Valid values:

  • Immediate
  • WaitForFirstConsumer - this setting instructs the persistent volume controller to not bind immediately a persistent volume claim. Instead, the system waits until a pod that needs to use a volume is scheduled. The scheduler then chooses an appropriate local persistent volume to bind to, taking into account the pod’s other scheduling constraints and policies. This ensures that the initial volume binding is compatible with any pod resource requirements, selectors, affinity and anti-affinity policies. This is a recommended setting for storage classes that offer local volumes.

provisioner

provisioner tells Kubernetes which storage plugin to use.

parameters

The parameters section is for plugin-specific values, and each plugin supports its own set of values.