Chapter 96: Flux GitOps — Sources, Reconciliation and Safe Local Practice
96.12 Multi-tenancy, paths and real authorization
Fictional teaching story. At a fictional Wardha training centre, Anaya and Sam put teams in different folders but then ask who can actually write cluster objects.
Why
A folder convention is organization, not a complete permission boundary.
What
Separate naming scope from the authorization enforced by Kubernetes.
How
Paths and namespaces do not grant isolation by themselves
Multi-tenancy means sharing a platform among different teams or users. A namespace scopes names and policies in Kubernetes. A path selects files. Neither alone proves a tenant cannot affect another tenant.
Immediate practice example
- Read the example from top to bottom. Do not send it to a real cluster.
Team A path: ./teams/a
Team B path: ./teams/b
Question: which actor can apply cluster-scoped objects?
- Read the expected result.
Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.
Separate folders do not answer the permission question.
- Understand each line in plain English.
The first two lines separate source content. The last line asks about effective authorization. A reviewed Git path can still contain objects outside an intended namespace if other controls allow them. Cluster-scoped resources are not made namespaced by putting their YAML into a tenant folder.
Service account impersonation and RBAC are separate controls
A service account is a Kubernetes workload identity. RBAC is role-based access control. Flux Kustomization serviceAccountName can select an account for impersonation, but reviewed roles and platform restrictions must actually limit it.
Immediate practice example
- Read the example from top to bottom. Do not send it to a real cluster.
spec:
serviceAccountName: classroom-reconciler
- Read the expected result.
Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.
This partial field selects an identity; it does not create roles or prove least privilege.
- Understand each line in plain English.
The value names an existing account in the Kustomization’s namespace according to the documented model. The platform must review its permissions and controller impersonation ability. Flux controllers can be privileged by default. Cross-namespace reference and remote-base restrictions are version-sensitive platform settings; no security configuration is changed in this lesson.
Ravindra Bagale's Tip
Different folders are not proof of different permissions.
वेगळे folders म्हणजे वेगळ्या permissions चा पुरावा नाही.
अलग folders अलग permissions का प्रमाण नहीं हैं.
Did you understand? Let us try it once more.