support@example.com full access to the staging cluster but limited access to the production cluster.
The default without RBAC is to grant Kubernetes admin-level access for users with write permissions on the Omni side.
Create an AccessPolicy resource
Create a local fileacl.yaml:
Only the users who have the Omni role
Admin can manage ACLs. Users who have the Omni role Operator or above are assigned to the Kubernetes role system:masters by default, in addition to the ACLs. Create Kubernetes RBAC resources
Locally, createrbac.yaml with a Namespace called my-app, and a Role & RoleBinding to give access to the my-app-read-only group:
production:
Test the access
Try to access the cluster with akubeconfig generated by the user support@example.com:
my-app namespace because of the Role and RoleBinding created above.
Try to list pods in another namespace:
default.
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.