Rajesh Jain
Rajesh Jain

Reputation: 1279

Reusing StorageClass in Kubernetes

Can I use the same storage class for different services - e.g. I am using persistent volumes for Redis, RabbitMQ , Elastic Search on Kubernetes.

Should I create only only storage class if they all require the same provisioner (GCEPersistentDisk) or what is the best practice for creating and managing storage class.

Can I change the storage class of a claim at a later time ?

Thanks, Rajesh

Upvotes: 1

Views: 192

Answers (1)

Vishal Biyani
Vishal Biyani

Reputation: 4407

Let's look at the definition of StorageClass from the documentation:

kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: standard provisioner: kubernetes.io/aws-ebs parameters: type: gp2 reclaimPolicy: Retain mountOptions: - debug

So at a basic level, it defines - who is responsible for creating storage (provisioner) and what parameters need to pass and things such as reclaim policy and so on.

So the number of storage classes you need is dependent characteristics of the underlying storage. As a hypothetical example let's say you had HD and SSD as two types of storages then you would create corresponding two storage classes.

To answer specific questions:

Can I use the same storage class for different services - e.g. I am using persistent volumes for Redis, RabbitMQ , Elastic Search on Kubernetes.

Yes

Can I change the storage class of a claim at a later time ?

In practice, No

Upvotes: 2

Related Questions