Why are the OpenShift Data Foundation pods stuck at Pending?
When you list pods in the openshift-storage namespace, the OpenShift Data Foundation pods are stuck at Pending status.
When you run oc get pods -n openshift-storage, the OpenShift Data Foundation pods show a Pending status.
To determine why your storage cluster pods are stuck at Pending, describe the pods that have the Pending status.
oc describe pod <pod> -n openshift-storage
In the output, check the Events section for the following error:
"Error: 0/3 nodes are available: 1 node(s) didn't match pod affinity/anti-affinity, 2 node(s) had volume node affinity conflict"
This error indicates that the classic or VPC cluster where your OpenShift Data Foundation storage cluster is installed is a multizone cluster, but the storage classes specified in the monStorageClassName or osdStorageClassName fields have a VolumeBindingMode parameter set to Immediate.
The VolumeBindingMode parameter controls when volume binding and dynamic provisioning occur. When set to Immediate, volumes are provisioned as soon as the PVC is created. However, multizone OpenShift Data Foundation deployments
require storage classes with VolumeBindingMode set to WaitForFirstConsumer, which delays volume binding until a pod using the PVC is scheduled. This ensures that volumes are created in the same zone as the pod.
-
Create your own storage class with the
VolumeBindingModeset toWaitForFirstConsumer, or choose a pre-existing storage class with the same parameters. -
List the name of your OpenShift Data Foundation storage cluster.
oc get storagecluster -n openshift-storageExample output:
NAME AGE ocs-storagecluster 71d -
Delete the storage cluster.
oc delete storagecluster <storage_cluster_name> -n openshift-storage -
Verify that your storage cluster is deleted and is not listed.
oc get storagecluster -n openshift-storage -
Re-create the storage cluster with the storage class you chose in step 1. Make sure to specify the correct storage class in the
monStorageClassNameandosdStorageClassNamefields.