Kubernetes Storage Class Manifest

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

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.