> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kubernetes permissions

> The Kubernetes RBAC the e6data operator and workspaces hold on AKS, who needs which rights, and how to limit the operator to its own namespaces.

ReferenceApplies to: CloudPrem on Azure

The e6data operator is not bound to cluster-admin, but in the default mode its rights are broad: it can create, read and delete workloads and Secrets, and create Roles and RoleBindings, in every namespace, and it can change node classes. Treat it as a highly privileged cluster component. It runs with its own ClusterRole and Roles that name each resource and verb, and it can only read ClusterRoles and ClusterRoleBindings, never create or change them (unless the optional WorkspaceProduct Helm mode is turned on; it is off by default). Nobody at e6data needs access to your cluster.

## Requirements

* A cluster admin on your side applies the cluster-wide objects once: e6data CRDs, the operator's ClusterRole and binding, admission webhook configurations, and node-scaling objects.
* The operator runs with 2 replicas (chart default). Only one holds the leader lease at a time.
* e6data people get no access to your cluster or tenant. The e6data control plane never connects in to your cluster.
* Your engineers install and troubleshoot with your usual access process. No standing kubeconfig is needed.

## Who needs what

| Who | Kubernetes rights | When |
| - | - | - |
| Your cluster admin | Create CRDs, ClusterRoles, ClusterRoleBindings, webhook configurations, node-scaling objects (Karpenter or NAP NodePools and NodeClasses) | Once at install, and when a new workspace is added |
| Your installing team | Install the operator and workspace with Helm and kubectl. On Azure: Azure Kubernetes Service RBAC Cluster Admin, or rights in one namespace only (below) | Install and upgrades |
| e6data operator (in-cluster service account) | Its own ClusterRole and Roles, listed below | Always |
| e6data people | None | Never |

## What the operator can do

In the default mode (`rbac.scope: cluster`), the operator's namespaced permissions (workloads, Services, ConfigMaps, Secrets, Roles and RoleBindings) apply in every namespace. In namespace-only mode, they apply only in the e6data namespaces.

These cluster-scoped permissions can't be granted per namespace in Kubernetes, so they stay cluster-wide in both modes:

| Permission | Why |
| - | - |
| e6data CRDs (`e6data.io`, `platform.e6data.io`): full | The operator's own resources (workspace, clusters, query router) |
| Karpenter `nodeclaims`: get, list, watch | Explain why a node could not be launched (quota, permissions, subnet IPs). Always present; harmless without Karpenter |
| `aksnodeclasses` (`karpenter.azure.com`): get, create, update, delete | Create and remove one AKSNodeClass for each warm pool. Present with Karpenter and with NAP; has no effect where the resource type isn't installed |
| `nodes`: get, list, watch, update, patch | Read node capacity; label and cordon engine nodes |
| `priorityclasses`: manage | Scheduling priority for e6data pods |
| `tokenreviews`: create | Authenticate the operator's own webhook and metrics endpoints |
| `customresourcedefinitions`, webhook configurations: read only | Check what is installed |
| `clusterroles`, `clusterrolebindings`: get, list, watch | Validate RBAC objects. Never create or change them, unless the optional WorkspaceProduct Helm mode is on (off by default) |

Each workspace also adds ClusterRoles bound to its own service accounts:

| ClusterRole | Rights | Why |
| - | - | - |
| `<ws>-monitoring-role` with the standard install; `<ws>-monitoring` with the workspace chart or the namespace-only bundle (which also reads `pods/log`, `nodes/metrics` and e6data resources) | get, list, watch on nodes, nodes/proxy, services, endpoints, pods, events, namespaces, replicasets; get on `/metrics` | The log and metrics collector reads pod logs and node metrics on every node |
| `<ws>-console-warmnodepools-role` | Full verbs on `warmnodepools` and `hibernationpools`; get and list on `namespaceconfigs`; get and list on Karpenter `nodepools` and `nodeclaims`, on `aksnodeclasses`, and on `leases` | The console creates and deletes warm pools, checks whether another workspace uses the same node pool, and runs read-only health checks (node scaler running, node class ready, operator leader active). This applies in any namespace |

The documented install steps ([Deploy workspace and e6data](https://docs.e6data.com/platform/deploy/azure-cloudprem/deploy-workspace.md)) split the health-check reads into a separate `<ws>-console-diagnostics-clusterrole`; e6data's workspace chart keeps them in the warm-pool role above.

Both are bound only to the workspace's own service accounts (`<ws>-monitoring` for the first, `<ws>-console` for the second). List them with `kubectl get clusterrole,clusterrolebinding | grep <ws>`.

Workspace service accounts can't read Secrets or run workloads in other namespaces, exec into pods, or change cluster roles, webhooks or CRDs.

Cluster monitoring adds one more ClusterRole. The cluster-wide log and metrics collector runs as the operator's service account, so it also holds all of the operator's rights above. The added role covers read on nodes, nodes/proxy, pods, namespaces and events, plus leases. e6data's standard Azure install turns cluster monitoring on. Its name depends on the chart version (`<operator>-otelcol-unified` or `<operator>-cluster-vector`).

The operator's admission webhooks match only e6data resource types, so your own workloads are never sent to them.

To review the exact rules before you install, render the chart:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
helm template e6-operator <chart> -f <your-values.yaml> | yq 'select(.kind == "ClusterRole" or .kind == "Role")'
```

## Namespace-only mode

In namespace-only mode the operator reads Secrets and manages workloads only in its own namespace (`e6operator`) and the workspace namespaces you list. It has no access to Secrets, workloads or RBAC anywhere else. Its ClusterRole has no access to Secrets.

> [!WARNING]
>
> Namespace-only mode is coming later. It needs an operator version that is not yet released; ask your e6data contact for the operator version that supports it. With today's released operator the steps below do not work: the operator never processes cluster resumes in this mode.

| Feature | In namespace-only mode |
| - | - |
| Clusters (create, resume, suspend), queries, Query History | Supported |
| Workspace monitoring (logs and metrics) | Supported |
| Node scaling with AKS NAP | Supported |
| Warm pools | Not supported |
| Cluster-wide monitoring (`clusterMonitoring.enabled: true`) | Not supported. The chart refuses to render it |
| More workspaces later | Supported, with an operator upgrade |

### Steps

1. Create the namespaces before installing the operator:

   ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
   kubectl create namespace e6operator
   kubectl create namespace <WORKSPACE_NAME>
   ```
2. Your cluster admin applies the cluster-wide objects e6data provides: CRDs, cert-manager (skip if you already run it), the operator ClusterRole and binding, the webhook configurations, the workspace monitoring role, and node-scaling objects.
3. Add to the operator values:

   ```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
   rbac:
     scope: namespaced
     watchNamespaces:
       - <WORKSPACE_NAME>      # the operator's own namespace is added automatically
   clusterMonitoring:
     enabled: false
   ```
4. Install the operator into `e6operator`, then the workspace into `<WORKSPACE_NAME>`.
5. To add a workspace later: create its namespace, have your cluster admin apply its monitoring role, add the namespace to `rbac.watchNamespaces`, and run `helm upgrade` on the operator.

### Install with rights in one namespace only

If your installing team may not create ServiceAccounts, Roles or RoleBindings:

* Your platform team applies, once: the e6data CRDs and cert-manager, the operator ClusterRole and binding and webhook configurations, the workspace ClusterRoles for monitoring, warm pools and health checks and their bindings, node-scaling objects, the e6data namespaces, and the ServiceAccounts, Roles and RoleBindings for the operator and the workspace (console, engine, query router, monitoring, and `<ws>-laminar`, `<ws>-copilot` and `<ws>-metriq`, which carry federated credentials). e6data gives you these as rendered manifests.
* Your installing team installs the operator in namespace-only mode and the workspace into that namespace.
* The operator creates Roles and RoleBindings inside the e6data namespace while it runs, with the rights your platform team gives it. If an admission policy blocks every RBAC object in that namespace, allow it for the operator.
* Each new workspace needs the platform team again for its RBAC objects.

## Human access without a standing kubeconfig

| | Azure |
| - | - |
| Static admin credentials | Turn off AKS local accounts: `az aks update -g <RG> -n <CLUSTER> --disable-local-accounts` |
| Time-boxed access | Make engineers eligible in Entra PIM for Azure Kubernetes Service RBAC Cluster Admin (install) or a role limited to the e6data namespace (troubleshooting). Documented by Microsoft |
| Sign in | `az aks get-credentials -g <RG> -n <CLUSTER>` then `kubelogin convert-kubeconfig -l azurecli` |
| e6data support | Screen share inside your recorded session |

## Preflight check

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
SA=system:serviceaccount:e6operator:e6operator
kubectl auth can-i list secrets -A --as $SA                    # namespace-only mode: no
kubectl auth can-i list secrets -n kube-system --as $SA        # namespace-only mode: no
kubectl auth can-i list secrets -n <WORKSPACE_NAME> --as $SA   # yes
kubectl get clusterrolebindings -o wide | grep -i cluster-admin   # no e6data service account listed
```

## Verify

1. The operator log shows no `forbidden` lines.
2. All workspace pods are `Running`: `kubectl get pods -n <WORKSPACE_NAME>`.
3. Resume a cluster from the e6data console, run a query, and check it appears in **Query History**.

## Troubleshooting

| Symptom | Cause | Fix |
| - | - | - |
| `helm install` fails: "rbac.scope=namespaced needs rbac.watchNamespaces" | No workspace namespace listed | Add it to `rbac.watchNamespaces` |
| `helm install` fails: "clusterMonitoring … can't be combined with rbac.scope=namespaced" | Cluster monitoring on | Set `clusterMonitoring.enabled: false` |
| Operator logs `forbidden` for a namespace | Namespace not in `watchNamespaces`, or operator version without namespace-only support | Add the namespace and upgrade; use the operator version from e6data |
| A new workspace never gets ready | Namespace added without an operator upgrade | Run `helm upgrade` on the operator |
| Monitoring pods can't list pods | Workspace monitoring role missing | Ask your cluster admin to apply it |
| Node drains wait on the operator pod | Operator at 1 replica, its PodDisruptionBudget allows 0 disruptions | Keep 2 replicas, or set `webhookAvailability.enabled: false` |

## Limitations

* Namespace-only mode: coming later. It needs an operator version that is not yet released.
* Warm pools in namespace-only mode: not supported.
* The documented install steps have no namespace-only option today.

## See also

* [Permissions reference](https://docs.e6data.com/platform/deploy/azure-cloudprem/permissions-reference.md)
* [Architecture](https://docs.e6data.com/platform/deploy/azure-cloudprem/architecture.md)
* [Use an existing cluster](https://docs.e6data.com/platform/deploy/azure-cloudprem/use-existing-cluster.md)
* [What e6data can access](https://docs.e6data.com/platform/trust/what-e6data-can-access.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.