Backstage Kubernetes Deployment
A backstage kubernetes deployment runs your developer portal as pods inside a cluster. You set up a service account, a database, and role rules so the portal reads cluster state. Platform teams often start by giving this portal broad cluster read rights across every namespace. That shortcut works on day one, but it exposes sensitive workloads and secrets to every portal user. Scoping the portal role and its cluster rules keeps your workloads safe from broad access. How a backstage kubernetes d
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.
A backstage kubernetes deployment runs your developer portal as pods inside a cluster. You set up a service account, a database, and role rules so the portal reads cluster state. Platform teams often start by giving this portal broad cluster read rights across every namespace. That shortcut works on day one, but it exposes sensitive workloads and secrets to every portal user. Scoping the portal role and its cluster rules keeps your workloads safe from broad access.
How a backstage kubernetes deployment works with native RBAC
The developer portal runs as a deployment workload inside its own namespace. To show pod status in the catalog, the portal queries the Kubernetes API server. Kubernetes RBAC controls these queries using roles and bindings. In Kubernetes RBAC, a Role sets permissions inside one single namespace. A ClusterRole is not namespaced and can cover resources across all namespaces or cluster nodes. Permissions in Kubernetes RBAC are purely additive, which means there are no deny rules.
You link the portal service account to these rules with a binding. A RoleBinding grants permissions inside one specific namespace. It can point to a Role in that namespace or to a shared ClusterRole. A ClusterRoleBinding grants access across the entire cluster at once. If the portal needs to read pod logs, you must grant access to the log subresource. Kubernetes RBAC names subresources with a slash, matching the API URL path.
What native cluster roles solve and what they leave open
Native roles and bindings decide which service account or user can reach the API server. By using a RoleBinding per team namespace, you stop the portal from reading every namespace. You can also leave secret resources out of the role rules. That prevents the portal from listing secret values in the catalog view.
Still, static roles only check who logs in and which API resource they call. They do not inspect what happens inside an active session or command stream. When engineers need to fix a broken pod seen in the portal, they still need cluster access. If you grant them exec subresource rights, they can run any shell command inside that pod. Native RBAC cannot approve one command at a time or mask phone numbers and emails in output. Teams also struggle to manage long-lived kubeconfig files on engineer laptops across many clusters.
Kubernetes RBAC + Deployment Approval Gates: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Scoping portal and engineer permissions across namespaces
A safer setup separates what the portal reads from how engineers run commands. Give the portal a read-only role that only lists pods, deployments, and services. Bind that role only to the namespaces that hold registered catalog apps. Do not bind the portal service account to system namespaces or secret objects.
Next, remove direct cluster admin bindings from day-to-day user accounts. Engineers should use the portal to view pod health and deployment state. When an engineer must run a command or query a database, route that task through an approval step. This keeps static cluster keys off developer machines and records every action taken during a fix.
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
Should the portal use a RoleBinding or a ClusterRoleBinding?
Use a ClusterRole with a RoleBinding in each target namespace when you want strict boundaries. A ClusterRoleBinding gives access to all namespaces at once, including system namespaces.
Can Kubernetes RBAC block a single namespace from a ClusterRoleBinding?
No, Kubernetes RBAC rules are purely additive and do not support deny rules. To skip a namespace, grant access per namespace with separate RoleBindings instead.
How does the portal read pod logs without full pod edit rights?
Grant read permissions on the pod log subresource inside your role rules. This lets the portal fetch log output without allowing pod changes or shell exec access.
Related guides
In this post