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

  1. 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.
  2. If the storage class is already used by a deployment, restore the storage class.
    1. Use the vSphere Client to create a new storage policy with the same name as the policy you removed.
      For example, if you deleted the Gold policy, name the new policy Gold. See Create Storage Policies for vSphere with Tanzu in Installing and Configuring vSphere with Tanzu.
    2. Assign the policy to the namespace.
      See Change Storage Settings on a Namespace in vSphere with Tanzu Services and Workloads.
      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.