> ## 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

> What the e6data operator and workspaces can do in your EKS cluster, who needs which Kubernetes rights, and namespace-only mode.

ReferenceApplies to: CloudPrem on AWS

The e6data operator is never bound to cluster-admin. 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. It is still highly privileged: in the default mode it can create workloads and read and write Secrets in every namespace, and the cluster log and metrics collector runs on every node with the operator's service account. Treat the operator like any cluster-wide controller. 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 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, or with 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 `nodepools`, `ec2nodeclasses`: manage; `nodeclaims`: read and delete | Scale engine nodes up and down (only with Karpenter on AWS) |
| Karpenter `nodeclaims`: get, list, watch | Explain why a node could not be launched (quota, permissions, subnet IPs). Always present; harmless without Karpenter |
| `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 |

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

| ClusterRole | Rights | Why |
| - | - | - |
| `<ws>-monitoring-role` | 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 on Karpenter `hibernationpools`; get on nodes; get and list on `namespaceconfigs`; read on `releasemanagers`, Karpenter `nodepools`, `nodeclaims`, `ec2nodeclasses` and `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 |

Both are bound only to the workspace's own service accounts (`<ws>-monitoring` for the first, `<ws>-console` for the second). The documented install steps ([Deploy workspace and e6data](https://docs.e6data.com/platform/deploy/aws-cloudprem/deploy-workspace.md)) apply the health-check reads as a separate read-only ClusterRole, `<ws>-console-diagnostics-clusterrole`, instead.

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 not available in today's released operator chart; it is coming later. Ask your e6data contact before you use it. With today's released chart, the steps below alone are not enough: the operator still watches every namespace and clusters never resume.

| Feature | In namespace-only mode |
| - | - |
| Clusters (create, resume, suspend), queries, Query History | Supported |
| Workspace monitoring (logs and metrics) | 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 and for 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). 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

| | AWS |
| - | - |
| Static admin credentials | Use EKS access entries; the `aws-auth` ConfigMap is not needed. Nothing in e6data reads it |
| Time-boxed access | Your usual AWS access process |
| Sign in | `aws eks update-kubeconfig` |
| e6data support | Screen share inside your recorded session |

With EKS access entries only, give each node role an `EC2_LINUX` access entry. Switching the cluster authentication mode to `API` only is one-way.

Installs have been verified with `AmazonEKSClusterAdminPolicy` on the installer's access entry.

## 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" (operator version with namespace-only mode) | 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 is not in a released operator yet; it is coming later.
* 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/aws-cloudprem/permissions-reference.md)
* [Architecture](https://docs.e6data.com/platform/deploy/aws-cloudprem/architecture.md)
* [Use an existing cluster](https://docs.e6data.com/platform/deploy/aws-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.