The missing middle in Kubernetes RBAC
Kubernetes Role-Based Access Control can grant permissions in one namespace or in all of them. It has no way to say "these namespaces".
A Role, or a ClusterRole bound by a RoleBinding, reaches one namespace. A ClusterRoleBinding reaches all of them, `kube-system` included. It's possible, though, to contain permissions to a limited set of namespaces, but only as a list you maintain: a ClusterRole bound by a separate RoleBinding in each namespace, with no selector to match namespaces by label and nothing that picks up a new namespace on its own. And there's no deny rule to carve out the ones you don't want: permissions are purely additive.
This gap is as old as Kubernetes authorization. An early proposal, written before RBAC landed, hit the same dilemma for something as simple as showing a user their namespaces: without better tooling, you had to "choose between listing them all or listing none."
So most operators make a binary choice. Either they confine themselves to one namespace and give up features that need more, or they take ClusterRoles and ask you to trust them with the whole cluster.
Union's data plane chart made the same choice. You ran it in a single namespace, or you gave it cluster-wide roles. In the cluster-wide mode, the components that launch your tasks held a wildcard on every resource in every namespace, `kube-system` included, through a ClusterRoleBinding.
That dilemma doesn't fit sovereign AI. The point of running Union.ai's data plane in your own cluster is that your models, data, and workloads stay under your control. Union runs in some of the most restrictive environments, whose security teams review every ClusterRole before anything is installed. For them, both options failed:
- One namespace puts every team, project, and domain in the same blast radius, with no per-project cloud identity.
- The whole cluster hands an AI platform write access to namespaces it never uses.
What they asked for was scope that matches the work: write access in exactly the namespaces where work runs, and a short, explained list of cluster-wide reads where absolutely necessary.
In `dataplane` chart 2026.11.4, we rebuilt the chart's RBAC to give them that. Every grant is declared by where it applies, so you choose the scope, and you can read off each role what it reaches.
The core idea: every rule carries an address
To see what had to change, look at how a component got its permissions before 2026.11.4. Here is the leaseworker, the component that launches your tasks, trimmed to the parts that matter:
The rules aren't the problem. The problem is that one `if` picks the reach for all rules at once. Each rule has a natural reach of its own: the wildcard is needed wherever tasks run, and the CRD rule only means something at cluster scope. But the template had nowhere to write that down, so the flag could only move all rules together. It's the same one-or-all choice, one level down, inside each component's role:
- In the ClusterRole branch, the wildcard meant for task namespaces also reached `kube-system`.
- In the Role branch, the CRD rule granted nothing, because a Role can't cover cluster-scoped objects. A feature that depends on a cluster-scoped grant like this one can't work under a Role, so single-namespace mode had to turn those features off instead of granting them.
No cleverer flag fixes that, because the information it needs isn't in the template. So the redesign writes it down. Every rule now carries an address: the place where the API call it allows will land. The chart calls these addresses slots. The component author picks the address, and the chart picks the Kubernetes objects that deliver to it, based on the scope you chose. Here's the `leaseworker` today, trimmed the same way:
There's no `kind:` and no binding in it. That's the chart's job now. An API call can land in only three places, so there are only a few addresses:
- Union.ai's own namespace, the release namespace, which holds its Deployments, Secrets, and ConfigMaps. The operator reading its own ConfigMap lands here: `comp-ns-read` or `comp-ns-write`.
- The work namespaces, where your tasks, apps, and image builds run. The leaseworker creating a task pod lands here: `work-ns`.
- The cluster itself, for objects with no namespace. The operator listing nodes lands here: `cluster-read` or `cluster-write`.
Here's what the chart makes of the leaseworker's declaration in each mode:

Read it row by row. The `comp-ns-read` rule renders the same way in both modes, because Union.ai's own namespace doesn't depend on where your work runs. Only the rows whose reach really does depend on scope move when you flip the switch.
The highlighted box is the trick that makes multi-namespace mode possible. The `work-ns` rules are written once, in a ClusterRole, but every binding to it is a RoleBinding in one work namespace. A ClusterRole bound by a RoleBinding takes effect only in that namespace. That's the closest thing Kubernetes RBAC has to "these namespaces": the rules are shared, but their reach is a list you can see with `kubectl get rolebindings -A`. Add a project and you add a binding. Nothing is bound cluster-wide.
Addresses also make rules checkable. Each slot has a verb ceiling, so a read slot can't pick up a write verb, and the chart knows which slots may reach the cluster. That's what lets it refuse a bad rule at render time, as the next section shows. Every component declares against the same six slots:
Slot names read as where it lands, then what it can do:
- Where: `comp-ns` is the components' namespace, the release namespace where Union.ai's own components run. `work-ns` is the work namespaces. `cluster` is cluster-scoped objects.
- What: `-read` caps the verbs at `get`, `list`, and `watch`. `-write` also allows `create`, `update`, `patch`, `delete`, and `deletecollection`.
So `comp-ns-read` is read-only access to Union.ai's own namespace, and `work-ns-cluster-read` is a read-only grant at cluster scope, which exists only to serve the work namespaces. `work-ns` has no suffix because there's only one work-namespace slot, and it's allowed to write.
Role names follow the pattern `--`, so `kubectl get roles,clusterroles` tells you what each role reaches before you open it. Inside each role, every rule names only the verbs its binary calls: the proxy only reads in work namespaces, so it gets `get`, `list`, and `watch` there and nothing more.
Why `work-ns-cluster-read` exists: informers. Most controllers watch resources through an informer. An informer that isn't scoped to a namespace sends its `list` and `watch` with an empty namespace, and Kubernetes authorizes that as a cluster-wide request that no number of RoleBindings satisfies. So a component that watches every work namespace needs a cluster-wide read, even though each object it touches is namespaced. That read gets its own read-only slot, and it's rendered only when work runs in more than one namespace.
One switch, two promises
Once every rule has an address, choosing a scope comes down to one question about your cluster: does work run in Union.ai's own namespace, or in a namespace per project and domain? The chart has one switch for it, and each answer comes with a promise you can check against the rendered roles.
`singleNamespace: true`: everything that can be namespaced is. Union.ai's components, tasks, and apps all run in the release namespace. Cluster-wide reads come only from a short, fixed allowlist: nodes, node and API server metrics, namespaces for kube-state-metrics, IngressClass when ingress-nginx is on, and Knative's informers when app serving is on. Cluster-wide writes are pinned to named objects.
Note what that doesn't promise: zero cluster-scoped permissions. Some features need reads that only exist at cluster scope. The old mode switched those features off. The new one grants only those reads. Each allowlist entry is tied to the code that needs it, and a guard suite fails the build if a render strays from the list. Monitoring, usage collection, and app serving all work in this mode now.
Multi-namespace: no Union.ai role is bound cluster-wide. Each project and domain gets its own namespace, with its own quota and cloud identity. Union.ai's components reach a work namespace only through a RoleBinding placed in it. Union.ai can create those bindings as projects are registered, or your own tooling can, if your platform team already owns namespace provisioning.
That binding is the grant, so it's also what to check. A namespace without one fails tasks with `Forbidden`. Nothing quietly falls back to a cluster-wide grant.
Guardrails that run at `helm template`
A design like this decays the first time someone adds `verbs: ['*']` to make a feature work. To prevent drift, the chart enforces it at render time, where a mistake costs a failed CI job instead of a security review.
The slot emitter refuses a rule that:
- Has no `verbs`, or names a verb its slot doesn't allow.
- Names `*`, `escalate`, `impersonate`, or `bind` as a verb.
- Uses `apiGroups: ['*']` anywhere except the work-namespace role.
The chart also refuses values that would quietly break an install: a quoted `"false"` for the scope key, `singleNamespace` and `low_privilege` set to different values, a `namespaces.static` list that includes the release namespace, and the Prometheus subchart options it can't grant for. On top of that, a guard suite of 672 checks audits the rendered roles in both modes: the scope allowlist, the pinned writes, and the refusals.
Here's what the redesign means in terms of RBAC resources, before and after the `2026.11.4` release:
Cluster-wide `pods: create` is gone from app serving, and so are cluster-wide writes on ServiceAccounts, Namespaces, and CRDs.
The narrowing also fixed things. cAdvisor scraping and `kube_*` series now work in single-namespace mode, because the grants finally point at the right scope.
What we didn't pretend away
A least-privilege story that skips its trade-offs isn't one you can trust. Here are ours.
The work-namespace role is pooled, and it holds a wildcard. Every other slot emits one role per component. `work-ns` emits a single role holding every declarer's rules, bound to every declarer's ServiceAccount. The leaseworker and propeller declare `apiGroups: ['*'], resources: ['*']`, so every component in that role holds the wildcard there, the read-only proxy included.
We did that on purpose. A component that can create pods in a namespace already controls it: the pod can run as any ServiceAccount there and mount any Secret. Union.ai creates task pods in every work namespace, so trimming the role would make it harder to read and no safer. The boundary is where the role is bound, not what it holds. Pooling also means one RoleBinding per namespace, so a namespace created at runtime can't end up reachable by some components and not others.
The consequence to know: in single-namespace mode, the release namespace is the work namespace, so that wildcard covers Union.ai's own Secrets and Deployments. If the components that launch tasks must not reach those, use multi-namespace mode, where the role is never bound in the release namespace.
`clusterresourcesync` can write RoleBindings anywhere. RBAC can't limit a write to a set of namespaces. The chart pins which role it can bind with `bind` on `-work-ns` only, but not where. A compromised `clusterresourcesync` could bind that role in `kube-system`. To mitigate the risk:
- Set `commonServiceAccount.enabled: false`, so it runs as its own `union-clustersync-system` account instead of the shared one.
- Add a Kyverno or Gatekeeper policy that limits that account's Namespace and RoleBinding writes to your naming convention.
- Or turn it off and provision namespaces with tooling you trust.
Knative reads cluster-wide. App serving is on by default, and Knative's binaries use shared, unfiltered informers. Their reads go out with an empty namespace however the RBAC is written. They're the one documented exception to the single-namespace allowlist. Each of the six Knative and Kourier binaries now has its own ServiceAccount and narrowed RBAC, but if your policy is "allowlist or nothing", set `apps.enabled: false`.
The install identity still needs cluster permissions. Single-namespace mode limits what Union.ai's components can do at runtime. It doesn't make the chart installable by an identity confined to one namespace: the chart still creates ClusterRoles, a PriorityClass, and a CSIDriver.
How this fits a sovereign AI factory
Security and usability have pulled against each other for as long as there have been systems to secure. Kubernetes RBAC makes a binary the easy path: one namespace, or all of them. An AI platform built on it inherits the choice, so the teams with the strictest security requirements usually end up with the least capable version.
A sovereign AI factory needs the opposite. The platform runs in your cluster so that you, not the vendor, decide what it can touch. That promise only holds if the decision is yours at every layer: where your models and data live, which identities can reach them, and now, where each of the platform's permissions applies. You choose the scope and the Union tooling applies only the minimum required permissions. Flexibility that doesn't compromise security governance.
Go deeper
- Kubernetes access controls in the Union.ai docs: choosing a mode and the roles each creates.
- The chart's RBAC reference: the slot system, choosing a slot, and work-namespace bindings.
- The migration guide: a values snippet for each upgrade path.
- unionai/helm-charts#661: the full change, with its verification notes.








