How to get the storage class name

Written by teamember02
Updated 9 months ago

To get the names of the StorageClasses available in your Kubernetes cluster, you can use the kubectl get storageclass command. Here's how:

  1. Open a terminal or command prompt.

  2. Use the following command:

    kubectl get storageclass
    
  3. This command will list all the StorageClasses available in your Kubernetes cluster along with their names, provisioner information, and other details.

  4. If you have multiple namespaces and want to list StorageClasses across all namespaces, you can add the --all-namespaces flag:

    kubectl get storageclass --all-namespaces
    

This command will display all StorageClasses in the cluster regardless of the namespace they belong to.

The output will include information such as the StorageClass name, provisioner, parameters, and status. You can use this information to identify the appropriate StorageClass for your applications or PersistentVolumeClaims (PVCs).

Did this answer your question?