How to Configure JetBrains AI Kubernetes Connect

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up jetbrains ai kubernetes connect, link your local cluster credentials to the editor. Then bind a scoped Kubernetes role to your user account so the assistant can inspect workloads. Most engineering teams start by pointing their editor at an existing local config file. That file often holds broad admin rights across the whole cluster. When an AI assistant shares those broad rights, a bad prompt can alter live workloads. How jetbrains ai kubernetes connect works with native roles The e

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 jetbrains ai kubernetes connect, link your local cluster credentials to the editor. Then bind a scoped Kubernetes role to your user account so the assistant can inspect workloads. Most engineering teams start by pointing their editor at an existing local config file. That file often holds broad admin rights across the whole cluster. When an AI assistant shares those broad rights, a bad prompt can alter live workloads.

How jetbrains ai kubernetes connect works with native roles

The editor reads your local cluster credentials to talk to the Kubernetes API server. Every request from your workspace uses the permissions tied to your user identity. Kubernetes controls these actions through its native role-based access control system. In this system, a Role sets permissions inside one specific namespace. A ClusterRole sets permissions across the whole cluster, including nodes and all namespaces.

You grant these rules to a user with a RoleBinding or a ClusterRoleBinding. A RoleBinding applies rules inside one namespace, even when it points to a ClusterRole. A ClusterRoleBinding gives the user access across the entire cluster at once. Keep in mind that Kubernetes rules are purely additive. There are no deny rules in native Kubernetes access control. You must start with zero rights and add only the actions the developer needs.

To let the editor inspect workloads, grant read rights on pods and deployments. Kubernetes also uses subresources for specific actions like reading logs or running commands. The API writes these subresources with a slash, such as pods and log or pods and exec. You should grant access to the log subresource so the assistant can read container output. Avoid granting the exec subresource unless the user must run commands inside containers.

Why native roles leave a runtime gap

Native roles and bindings solve the initial login problem well. They decide which user can reach the API server and which resource types they can touch. For example, a RoleBinding can keep a developer inside a single staging namespace. This stops the editor from reading secrets in other namespaces.

Still, static roles do not inspect what happens inside an allowed request. Once a user has permission to run pod exec or update a manifest, the API allows all commands. Native RBAC cannot tell a safe diagnostic command from a destructive shell command. It also cannot check if a pod log contains private customer data before returning text.

Kubernetes RBAC + AI Agent Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

When developers use AI tools to debug live clusters, pod logs often flow into model prompts. Those logs may contain sensitive strings like emails, phone numbers, card numbers, or national IDs. Static cluster roles cannot rewrite those fields in the output stream. Also, local credential files sit on developer laptops and often stay valid for too long. Teams need a way to inspect commands in flight and mask sensitive fields in results.

Scoping subresources and namespace bindings

Before you connect your editor to a live cluster, separate your read and write roles. Create a dedicated Role in each namespace for daily debugging and code assistance. Include only view verbs on standard workload resources and the pod log subresource. Bind this role to your developers with a namespace-scoped RoleBinding.

Keep cluster-wide bindings and pod exec permissions out of standard developer profiles. When a developer needs to run a command inside a pod, handle that access separately. This keeps daily editor sessions safe from accidental state changes while still giving the AI context.

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

How does JetBrains AI talk to my Kubernetes cluster?

The editor uses your local cluster credentials to send requests to the Kubernetes API server. All actions run under the Kubernetes role bindings assigned to your user account.

Can I block specific commands inside a pod with Kubernetes RBAC?

No, native Kubernetes rules are purely additive and only check the resource and verb. Once you grant the pod exec subresource, RBAC does not filter the shell commands run inside.

Should I use a RoleBinding or a ClusterRoleBinding for editor access?

Use a RoleBinding whenever possible so permissions stay inside a single namespace. A ClusterRoleBinding grants access across every namespace and node in the cluster.

The query runs. The emails stay hidden.