When you use the vSphere Client to remove the storage policy from vCenter Server or a namespace in the Supervisor, its matching storage class remains in the Kubernetes environment, but cannot be used.
Problem
If you run the kubectl get sc command, the output continues to list the storage class as available in the namespace. However, the storage class cannot be used. For example, your attempts to use the storage class for a new persistent volume claim fail.
If the storage class is already used by a Kubernetes deployment, the deployment might behave unpredictably.
Solution
- To verify which storage classes exist in the namespace, run the kubectl describe namespace namespace_name command.
The output for this command does not list the storage class if its matching storage policy is removed.
- If the storage class is already used by a deployment, restore the storage class.
- Use the vSphere Client to create a new storage policy with the same name as the policy you removed.
- Assign the policy to the namespace.
After you assign the policy to the namespace,
vSphere with Tanzu deletes the old storage class and creates a matching storage class with the same name.