Can I use 2 different StorageClass for the same storage provisioner type?

11/25/2019

We have a Storageclass with an nfs provisioner and a reclaimPolicy: Delete. I created a separated StorageClass with the reclaimPolicy: Retain because Kafka needs to have the data persisted. One coworker told me that if I create a second StorageClass with the same provisioning source kubernetes can confuses the volumes and could overwrite data in the wrong volume. He recommends to declare the "reclaimPolicy: Retain", doing manually the PersistentVolumes. Using the already declared initial StorageClass.

I can not find this supposedly bad effect of using more than one StorageClass for the same provisioner. In fact, after reading the official k8s documentation I have the feeling that recommends the opposite thing:

https://kubernetes.io/docs/concepts/storage/storage-classes/#introduction

A 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

-- jacktrade
kubernetes

1 Answer

11/25/2019

Yes, you can create multiple storage classes for same storage provider.

You can create one for 'reclaimPolicy: Delete' and second one for 'reclaimPolicy: Retain'

-- P Ekambaram
Source: StackOverflow