How to Configure EKS Cluster Role
To set up an eks cluster role, you define a Kubernetes permission object and bind it to an identity. Your eks cluster role holds additive rules that grant access across namespaces or cluster nodes. Teams often map cloud identities to these roles so engineers can inspect pods and fix issues. Still, broad role assignments let users run risky commands across every namespace in the cluster. How an eks cluster role works in Kubernetes RBAC Kubernetes role-based access control uses four main object
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
To set up an eks cluster role, you define a Kubernetes permission object and bind it to an identity. Your eks cluster role holds additive rules that grant access across namespaces or cluster nodes. Teams often map cloud identities to these roles so engineers can inspect pods and fix issues. Still, broad role assignments let users run risky commands across every namespace in the cluster.
How an eks cluster role works in Kubernetes RBAC
Kubernetes role-based access control uses four main objects to manage permissions. A standard role sets permissions inside one single namespace. An eks cluster role is not limited to a single namespace. It covers cluster-wide resources like nodes and non-resource endpoints. It can also grant permissions to namespaced resources like pods across every namespace at once.
Every rule in Kubernetes role-based access control is purely additive. There are no deny rules in this system. You list the target resources and the actions a user can take. Kubernetes refers to resources by the exact name found in the API URL. Some APIs include subresources, such as pod logs or pod command execution. In your permission rules, you write a subresource with a slash between the resource and the action.
Creating the role itself does not give anyone access right away. You must attach the role to a user or group with a binding object. A cluster-wide binding grants permissions across the entire cluster. You can also reference a cluster role inside a single-namespace binding. That pattern lets teams reuse one common definition while keeping access inside one namespace.
Why native roles leave a runtime gap
Native roles and bindings solve the initial login and API check problem well. They let the API server check if a user can read pods or view logs. They also help teams reuse permission templates across different projects and namespaces. When an engineer only needs to view cluster status, read-only rules work well.
The operational gap appears when engineers need interactive access to fix live apps. To run commands inside a container, a user needs permission on the pod execution subresource. Once the API server allows that request, the native role checks stop. The role decides who can start the session, not what individual commands run inside the container.
K8s RBAC Role vs ClusterRole + EKS Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Also, Kubernetes does not let you restrict creation requests on subresources by specific resource names. An engineer with execution rights in a namespace can often open a shell in any pod there. From inside that pod, they might read local secrets or query internal databases. Standard role bindings also stay active until an admin removes them. This leaves standing privileges open long after a repair task ends.
Scoping permissions and checking subresources
To reduce risk, teams split broad roles into smaller, task-specific definitions. Keep cluster-wide bindings for platform admins and cluster operators only. For app teams, reference your common role inside a single namespace binding instead. This stops a developer in one namespace from viewing or changing pods in another namespace.
You should also separate routine log reading from container command execution. Grant permission on the pod log subresource for daily debugging work. Hold back permission on the pod execution subresource until an incident requires live shell access. Even then, remember that native roles cannot inspect shell commands or mask sensitive data like emails or card numbers in flight.
Govern kubectl and API calls in flight
Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev sits inline as an open-source proxy, a sidecar for your Kubernetes API, without replacing RBAC. On every production call from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run or hold risky deletes for review. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.
Frequently asked questions
What is the difference between a Role and a ClusterRole in EKS?
A Role applies only to one specific namespace. A ClusterRole applies across the whole cluster, covering nodes, non-resource endpoints, or resources across all namespaces.
Can I add a deny rule to an eks cluster role?
No, Kubernetes role-based access control permissions are purely additive. You start with zero access and add rules for each allowed resource and action.
How do I limit a ClusterRole to a single namespace?
You can reference a ClusterRole inside a standard namespaced RoleBinding. This grants the defined permissions only within the namespace where the RoleBinding lives.
Related guides
In this post