How to Configure Continue Kubernetes Read Only Access
You set up continue kubernetes read only access by binding a view role to your editor context. Next, you point the Continue coding assistant to that restricted cluster profile. Many teams give local AI tools the same admin keys that engineers use. That broad scope lets an AI agent change live pods or read cluster secrets by mistake. A strict read role stops the assistant from writing changes to your cluster. How to set up continue kubernetes read only access with RBAC Kubernetes role-based ac
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.
You set up continue kubernetes read only access by binding a view role to your editor context. Next, you point the Continue coding assistant to that restricted cluster profile. Many teams give local AI tools the same admin keys that engineers use. That broad scope lets an AI agent change live pods or read cluster secrets by mistake. A strict read role stops the assistant from writing changes to your cluster.
How to set up continue kubernetes read only access with RBAC
Kubernetes role-based access control uses four core objects to manage cluster rules. A Role sets permissions inside one specific namespace. A ClusterRole sets rules across the whole cluster and covers cluster-scoped items like nodes. Both role types hold rules that are purely additive. Kubernetes does not have deny rules in its role model. You start with zero access and add safe read verbs like get and list.
After you define a role, you link it to a user or service account. A RoleBinding grants those rules inside a single namespace. A RoleBinding can link to a local Role or a wider ClusterRole. A ClusterRoleBinding grants access across every namespace in the cluster at once. For an AI assistant, a single namespace RoleBinding keeps the scope tight and safe.
You must also include subresources when you build a read role for debugging. Kubernetes RBAC names resources the exact way they appear in the API URL. Pod logs are a subresource, so RBAC writes them with a slash between pods and log. If you leave out the pod log subresource, Continue can list pods but cannot read output. At the same time, you should leave out the pod exec subresource. That keeps the assistant from running shell commands inside live containers.
How Continue reads cluster state during coding
Continue runs inside the code editor and uses local context providers to gather facts. When a developer asks a question, the extension runs local read commands or queries. Those queries use the active cluster credential on the workstation to talk to the API server. The API server checks the RoleBinding before it returns pod status, events, or log lines. The assistant then puts that cluster output into the prompt for the language model.
To keep this workflow safe, engineers create a dedicated read context on their machine. They bind that context to the view role rather than their daily admin role. When Continue runs a check, it only has the power to view allowed resources. Any attempt to delete a pod or change a deployment fails at the API server.
Auditor Read-Only Access + Kubernetes API Server Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native RBAC solves and what it misses
Native RBAC is great at deciding which user or tool can call an API verb. It blocks destructive write calls when an AI tool only has a read role. It also keeps an assistant inside one namespace when you use a RoleBinding.
Still, static roles only check who logs in and which API resource they request. They do not inspect what happens inside the data payload during the session. If a pod log prints customer emails, phone numbers, or card numbers, RBAC still sends it. That raw data flows straight into the editor and out to the model provider. Also, managing separate read keys on every developer laptop takes ongoing team effort. Teams need a way to mask sensitive fields like national IDs in results without local key sprawl.
Check Kubernetes API requests and responses on the wire
Kubernetes RBAC decides who may call the API server. RBAC does not check response payloads or split listing Secret names from reading Secret values when a role grants get access. With hoop.dev, you run an open-source HTTP proxy, a sidecar for your Kubernetes API. The kubectl client changes only the server address it talks to while RBAC stays in place.
On each call, hoop.dev guardrails read the method, normalized path, and headers to refuse bad deletes or full Secret reads with a 403 error. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs. Every request and verdict is logged without storing bearer tokens. View the project on GitHub.
Frequently asked questions
Can Kubernetes RBAC block specific words inside pod logs?
No, Kubernetes RBAC only controls access to the pod log subresource itself. It cannot read log lines in flight or rewrite emails and card numbers in results.
Should I use a RoleBinding or ClusterRoleBinding for Continue?
Use a RoleBinding whenever possible so the assistant only reads one namespace. A ClusterRoleBinding exposes logs and events across every namespace in the cluster.
Why can my AI assistant see pods but not read their logs?
In Kubernetes RBAC, pod logs are a separate subresource from the pod object. Your read role must include the pod log subresource alongside the main pod resource.
Related guides
In this post