Create a Lazy Bound Storage Class
The Operator requires a lazily bound storage class to function correctly. This guide describes how to configure one.
The first step we need to take is to list any preexisting storage classes available on the platform:
$ kubectl get sc
NAME PROVISIONER AGE
standard (default) kubernetes.io/gce-pd 47d
In the above example the platform is Google GKE, it already has a storage provider configured. If no storage providers are configured on your system then please consult the vendor for instructions related to creating one.
Next examine the storage class to determine whether it already makes use of lazy binding:
$ kubectl get sc standard -o yaml
The important field is
If set to
Immediate a persistent volume is created for a persistent volume claim immediately upon creation.
The Operator will have no control over where it is scheduled.
If, however, it is set to
WaitForFirstConsumer then the a persistent volume isn’t created when a persistent volume claim is created.
It waits until the persistent volume claim is attached to a pod and inherits its scheduling information.
This storage class can be used directly by the Operator.
The exact configuration varies between Kubernetes vendors, however the process is the same. Using the standard storage class as a template we can create our own:
Save to a file then submit to Kubernetes:
$ kubectl apply -f my-storage-class.yaml