How to Configure Continue Kubernetes Credentials
To set up continue kubernetes credentials, point your local coding tool to a scoped kubeconfig file. Then bind that user or service account to a tight role in your cluster. Most teams start by sharing an existing local config file with their AI coding assistant. This quick step lets the assistant read cluster state and help fix broken workloads. Still, local developer profiles often carry wide admin rights across many namespaces. When an assistant uses those broad keys, a single prompt can chang
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 continue kubernetes credentials, point your local coding tool to a scoped kubeconfig file. Then bind that user or service account to a tight role in your cluster. Most teams start by sharing an existing local config file with their AI coding assistant. This quick step lets the assistant read cluster state and help fix broken workloads. Still, local developer profiles often carry wide admin rights across many namespaces. When an assistant uses those broad keys, a single prompt can change live resources by mistake.
How continue kubernetes credentials work with cluster roles
The Continue extension runs on the developer machine and uses local system tools to query clusters. When the assistant runs a command, it relies on the active kubeconfig context on that machine. Kubernetes checks these requests through role-based rules enabled on the API server. A Role sets permissions inside one namespace, while a ClusterRole covers the whole cluster. Rules in this system are additive, which means there are no deny rules at all.
You grant these rules to a user or service account with a RoleBinding or ClusterRoleBinding. A RoleBinding gives rights inside one namespace and can point to a Role or a ClusterRole. A ClusterRoleBinding grants permissions across all namespaces and cluster resources like nodes. For an AI assistant, teams should create a dedicated identity with a narrow RoleBinding. This setup limits the assistant to reading pod status or events in a single test namespace.
Subresources need extra care when you set up continue kubernetes credentials for daily use. The API server treats actions like reading pod logs or running commands in pods as subresources. In role rules, you write these subresources with a slash, such as pods and log. If you grant pod exec rights, the assistant can run shell commands inside running containers. Leave out exec and secret read rules so the assistant only reads safe metadata.
What native roles solve and where gaps remain
Native cluster roles are great at deciding which user can call a specific API endpoint. They stop an assistant from deleting deployments or reading secret objects if you omit those verbs. A scoped RoleBinding keeps a coding tool inside one namespace during a debugging session. This native setup gives you a strong first line of defense against broad cluster changes.
Still, native role checks only happen when the API server receives a request. First, the local kubeconfig file still holds raw tokens or client certificates on disk. Every tool running under that developer account can read and use those local keys. Second, role rules cannot inspect the content of pod logs or command output in flight. Pod logs often print sensitive values like user emails, phone numbers, or card numbers. Once you grant log read rights, all text in that log stream reaches the coding assistant.
Ephemeral Credentials + Kubernetes RBAC: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Third, exec rules are all or nothing at the API level. If a role allows pod exec, Kubernetes does not check which shell commands run inside. It cannot pause a dangerous command or mask national IDs in the terminal output. Native roles control who enters the cluster, not what data flows back to the model.
Steps to scope local cluster access safely
Start by creating a dedicated service account in a single non-production namespace. Build a Role in that namespace that only allows get, list, and watch on basic pods. Bind the Role to the service account with a namespace RoleBinding. Do not use a ClusterRoleBinding for a coding assistant profile. Next, generate a dedicated kubeconfig context that uses this restricted identity. Point your local coding workspace to this context before starting a chat session. Check your role rules often to make sure secret and exec permissions stay off the list.
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 runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. 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
Where does the Continue extension get its cluster keys?
It uses the local kubeconfig file and active context on the host machine. Any shell tool the assistant calls will inherit those local user credentials.
Can Kubernetes RBAC block specific shell commands inside a pod?
No, RBAC only controls who can open an exec session on the pods exec subresource. It cannot read or filter the shell commands that run inside the container.
How do I stop my coding assistant from reading cluster secrets?
Remove the secrets resource from the Role or ClusterRole bound to the assistant identity. Because RBAC rules are additive, leaving secrets out blocks access to them.
Related guides
In this post