After a vSphere administrator creates a storage policy and assigns it to the vSphere Namespace, the storage policy appears as a matching Kubernetes storage class in the namespace and any available Tanzu Kubernetes clusters. As a DevOps engineer, you can verify that the storage class is available.

Your ability to run the commands depends on your permissions.

Prerequisites

Make sure that your vSphere administrator has created an appropriate storage policy and assigned the policy to the vSphere Namespace.

Procedure

  1. Use one of the following commands to verify that the storage classes are available.
    • kubectl get storageclass
      Note: This command is available only to a user with administrator privileges.
      You get the output similar to the following. The name of the storage class matches the name of the storage policy on the vSphere side.
      NAME     PROVISIONER               AGE
      silver   csi.vsphere.vmware.com    2d 
      gold     csi.vsphere.vmware.com    1d
    • kubectl describe namespace namespace_name

      In the output, the name of the storage class appears as a part of the storageclass_name.storageclass.storage.k8s.io/requests.storage parameter. For example:

      –––––––––––––––––
      Name:                                                            namespace_name
       Resource                                                         Used  Hard
       --------                                                         ---   ---
       silver.storageclass.storage.k8s.io/requests.storage              1Gi   9223372036854775807
       gold.storageclass.storage.k8s.io/requests.storage                0     9223372036854775807
      
  2. To check the amount of storage space available on the namespace, run the following command.
    kubectl describe resourcequotas -namespace namespace

    You get the output similar to the following.

    Name:             ns-my-namespace
    Namespace:        ns-my-namespace
    Resource          Used  Hard
    --------          ----  ----
    requests.storage  0     200Gi