Kubernetes Object Sync

The below controllers are part of the StorageOS API manager, and handle a variety of cases where information about Kubernetes objects from your cluster needs to be synced to your StorageOS cluster.

The CSI Driver annotation mentioned below is added to your PVC or Node automatically by StorageOS and is not removed. It is set by default in the case of a PVC StorageClass or PVC’s StorageClassName parameter, or in the case of a node, by the node driver registrar.

PVC Label Sync

The PVC Label Sync Controller applies labels that have been added to your PVCs to your StorageOS Volume objects. The PVC must have the StorageOS CSI Driver annotation. If there is a label with the same key on the PVC and on the StorageClass the PVC label will take precedence.

StorageOS dynamically provisions StorageOS Volumes when you create a PVC object. Labels are initially applied to your StorageOS Volume object when it is created. These come from the labels specified in the PVC manifest as well as any default labels specified in the StorageClass.

This controller is triggered on any subsequent PVC label update event, so long as the CSI Driver annotation is present.

If a label sync fails the change will be requeued and retried. A periodic resync runs every hour (this is configurable via -pvc-label-resync-interval flag for the API Manager).

Node Label Sync

The Node Label Sync controller ensures that labels applied to your Kubernetes nodes are synced through to StorageOS. It is necessary for your Node to have the StorageOS CSI Driver annotation.

When labels are applied to your Kubernetes nodes, they do not automatically sync to StorageOS, hence this controller is required to automatically apply the expected behaviour to your StorageOS cluster.

It is triggered on any Kubernetes label update event, so long as the CSI Drive annotation is present.

If a label sync fails the change will be requeued and retried. A periodic resync runs every hour (this is configurable via -node-label-resync-interval flag for the API Manager).

Node Delete

The Node Delete Controller syncs deletions from your Kubernetes cluster to StorageOS.

This controller dynamically removes nodes from your StorageOS cluster, being triggered when the Kubernetes node is removed.

Whenever a node delete event occurs the Node Delete Controller will trigger if the node has the StorageOS CSI driver annotation.

If the node holds a StorageOS Volume without a replica then it cannot be deleted by this controller. The Volume must be deleted first and then the node. This is to prevent data loss by accidental deletion of a master volume.

A periodic garbage collection runs every hour (this is configurable via -node-delete-gc-interval flag for the API Manager.

Namespace Delete

The Namespace Delete Controller is responsible for removing StorageOS namespaces from the StorageOS cluster when the corresponding Kubernetes namespace has been removed from Kubernetes.

The StorageOS controlplane automatically creates a new StorageOS namespace when a PVC is created in a Kubernetes namespace. StorageOS does not automatically remove namespaces when there are no volumes in them. Instead this controller triggers on any Kubernetes namespace deletion event, syncing Kubernetes namespace deletion to StorageOS namespace deletion.

A periodic garbage collection runs every hour (this is configurable via -namespace-delete-gc-interval flag for the API Manager.