In order for a container to be able to read/write to a volume backed by shared network storage, a lot of things need to happen:
Pending
state.The Cinder CSI plugin has two components:
The Node plugin runs as a DaemonSet on all nodes in the cluster and performs volume operations on the machine itself,
like mounts.
The Controller Plugin is managed by SysEleven and does not run in the cluster. It performs volume operations that are independent of a machine,
like creating/deleting, attaching/detaching and resizing volumes.
kubectl -n <namespace> describe pod <pod name>
This will show if the steps that Kubelet takes to make the volume available succeed or not.
kubectl -n <namespace> describe pvc <pvc name>
This will show if any resizing operations are failing (e.g. because of lacking quota)
To get the PV:
PV=$(kubectl -n <namespace> get pvc <pvc name> -o jsonpath='{.spec.volumeName}')
To get the Openstack volume ID:
VOLUME_ID=$(kubectl get pv "$PV" -o jsonpath='{.spec.csi.volumeHandle}')
To check the Openstack volume (requires Openstack CLI)
openstack volume show "$VOLUME_ID"
Step 6 of the above described steps can only succeed, if the volume is not currently attached to a different Node.
Check, if there's another Pod using the same PVC.
You may only use a Deployment with a PVC, if:
spec.strategy.type: Recreate
A RollingUpdate
won't work, because Kubernetes will not delete the active Pod before the new one is Ready.
MetaKube currently does not support RWX volumes!.
This means, There is currently no supported way to operate a Deployment using a PVC with high availability.
Using the strategy Recreate
will lead to downtime until the new Pod is created.
Your application will also not tolerate any disruption, e.g. a failing Node.
To account for high availability, we recommend separating the storage layer from your application and scaling both horizontally.
This can usually be achieved with a distributed database or by using object storage.
Like providing a volume to a Pod after creation, resizing the PVC also undergoes a few steps before the Pod sees the desired change.
Step 3 will only succeed if the volume is currently not attached to a Node.
Kubernetes doesn't wait for the volume expansion to finish before creating a Pod that uses the volume.
Nor does it delete the Pod proactively if the requested resources of the PVC changed.
Sometimes a rollover of the StatefulSet gives the CSI-Controller enough time to resize the volume:
kubectl -n <namespace> rollout restart statefulset <statefulset name>
Kubernetes will back off with an exponential retry interval if the expansion failed.
This means, Kubernetes will often recreate the Pod, schedule it and attach the volume before the CSI-Controller even gets a chance to resize the volume.
The best way to ensure a volume gets resized is to constantly delete the Pod e.g. with a busy bash loop:
while true; do kubectl -n <namespace> delete po <pod name>; done
Since Pods owned by a StatefulSet keep their names, there's no need to use a selector.
Meanwhile, check if the capacity of the PV has changed and if so interrupt the loop.
You might have exhausted your quota for storage in your SysEleven Stack project.
In this case, or if the issue persists, please contact the SysEleven product support.