Skip to main content
By default, any user with write permissions in Omni gets admin-level access to Kubernetes across all clusters. Access Policies (ACLs) let you override this behavior by defining rules that control what specific users can do on specific clusters. For example, you can give a user full access to a staging cluster while limiting them to read-only access in production. Only users with the Omni role Admin can create or modify ACLs.
Users with the Omni role Operator or above are automatically assigned the Kubernetes group system:masters, which grants cluster-admin access, in addition to any groups specified in an ACL. If you need strict least-privilege access inside the cluster, keep the user’s Omni role at Reader or None and use ACL rules with Kubernetes group impersonation to grant specific permissions.
For the full AccessPolicy schema, including all user matching options, cluster matching options, available roles, and test structure, see the Access Policies reference.

Create an access policy

The example below gives support@example.com full access to the staging cluster and read-only access to the production cluster.
Apply the policy as an Omni admin:
If any test assertion fails, omnictl rejects the apply and reports which test case did not match. Fix the rule and re-apply.

Configure Kubernetes RBAC

Assigning an Omni role through an ACL rule controls what a user can do in Omni. To control what they can do inside the Kubernetes cluster, use the kubernetes.impersonate.groups field to assign the user to one or more Kubernetes groups, then bind those groups to a Role or ClusterRole using Kubernetes RBAC. The example below creates a read-only role in the my-app namespace and binds it to the my-app-read-only group assigned in the ACL rule above.
Apply these manifests to the relevant cluster as a Kubernetes cluster admin:

Verify access

Try to access the cluster with a kubeconfig generated by the user support@example.com:
The user should be able to list pods in the my-app namespace because of the Role and RoleBinding created above. Try to list pods in another namespace:
The action should be denied.
If the user support@example.com has the Omni role Operator or above assigned, they will have system:masters role in Kubernetes as well as the my-app-read-only role. Therefore, they will still be able to list pods in all namespaces.