My team is currently trying to enable Stateful Apps for our internal customers. One requirement that keeps coming up is how to isolate PV's of one internal customer from PV's of another internal customer.
I see the following isolation mechanisms:-
- A PV when bound to a PVC(inside namespace A) cannot be bound to another PVC(inside namespace B) unless the unbind happens and hence are exclusive.
- When using StorageClass, A PV of certain class can only be bound to PVC of the same class. So that means PVC(of class A) can only be bound to PV(of class A). This allows a PV allocated to one customer to not accidently get allocated to another customer)
While the above isolation is good, its not enough(as i understand it). In a multi -tenant environment we want mechanisms which can guarantee that a volume allocated to one customer can never be accidentally allocated/mounted/accessed by another customer.
What is Kubernetes recommendation , on how to achieve this isolation ?
Few more questions:-
- Why are Persistent Volumes not namespaced ?
- Is one or more StorageClass'es per Customer a good multi tenancy model ? What other recommendations we have ?
Would love to hear the general thinking and around this from both developers and community
-Mayank