Is storage classes cluster level objects in kubernetes?

4/17/2020

Is storage classes cluster level objects in kubernetes?

Because when I type Kubectl get sc storagclassname It will show storage classes without having to give any specific namespace.

-- kapata rajesh
kubernetes

2 Answers

4/17/2020

Yes. Extra words because stackoverflow doesn’t allow one word answers.

-- coderanger
Source: StackOverflow

4/20/2020

I will try to provide a bit more insides to @coderanger answer.

First what is Storage Class:

StorageClass provides a way for administrators to describe the “classes” of storage they offer. Different classes might map to quality-of-service levels, or to backup policies, or to arbitrary policies determined by the cluster administrators. Kubernetes itself is unopinionated about what classes represent. This concept is sometimes called “profiles” in other storage systems.

Each StorageClass contains the fields provisioner, parameters, and reclaimPolicy, which are used when a PersistentVolume belonging to the class needs to be dynamically provisioned.

The name of a StorageClass object is significant, and is how users can request a particular class. Administrators set the name and other parameters of a class when first creating StorageClass objects, and the objects cannot be updated once they are created.

Now we can try understanding Kubernetes Objects :

Kubernetes objects are persistent entities in the Kubernetes system. Kubernetes uses these entities to represent the state of your cluster. Specifically, they can describe:

  • What containerized applications are running (and on which nodes)
  • The resources available to those applications
  • The policies around how those applications behave, such as restart policies, upgrades, and fault-tolerance

A Kubernetes object is a “record of intent”–once you create the object, the Kubernetes system will constantly work to ensure that object exists. By creating an object, you’re effectively telling the Kubernetes system what you want your cluster’s workload to look like; this is your cluster’s desired state.

To work with Kubernetes objects–whether to create, modify, or delete them–you’ll need to use the Kubernetes API. When you use the kubectl command-line interface, for example, the CLI makes the necessary Kubernetes API calls for you. You can also use the Kubernetes API directly in your own programs using one of the Client Libraries.

If you would like to know more about Kubernetes Object I'd recommend reading Declarative Management of Kubernetes Objects and Kubernetes Objects.

-- Crou
Source: StackOverflow