k8s. Configure storageclass per namespace

1/16/2019

Is it possible to configure which storageclasses can be used by namespace?

So for example I have a single cluster for production and development.

I want to configure a set of storageclasses for development and a different set of storageclasses for production.

I want to strictly configure that in development no one could use the storageclasses of production.

Is this possible?

I have only seen the option to use the resource quotas at namespace level, but it is not the same, with quotas I can configure the amount of disk that can be used in each storageclass, so if I create a new storageclass I will have to modify all the quotas in all the namespaces to add the constraints about the new storageclass.

-- Jxadro
kubernetes

1 Answer

1/16/2019

A storage class in Kubernetes is a cluster-wide resource, so you can't restrict the usage regarding a namespace out-of-the-box. What you can do, however, is to write a customer controller akin to what Banzai did with their PVC Operator or Raffaele Spazzoli's Namespace Configuration Controller.

-- Michael Hausenblas
Source: StackOverflow