Docs Give your agent tools

Kubernetes clusters

Give a Kubernetes agent read access to your clusters, with changes only through approved tools.

A Kubernetes agent reads your clusters to answer questions such as "why does this pod keep restarting?" or "what changed in this namespace today?". Each cluster is reached through a Kubernetes MCP server you run, with an identity that can read but not change anything, and never read Secrets. The agent never applies a change itself. When it wants one, it either asks a person to approve the exact call or hands you a change to run.

In the portal Agents › your agent › Connections › Add a cluster Admin adds clusters and edits their facts. Everyone else sees them on the agent's page.

Before you start

  • Create the agent with the Kubernetes type (see Create an agent). It lands on Add a cluster right away, then carries on to its first goal.
  • Run a Kubernetes MCP server for each cluster, reachable from the portal over HTTP. The page's Recommended setup uses kubernetes-mcp-server.
  • Give the server's service account a read-only role with no access to Secrets (below).

Prepare the cluster

  1. Run the server read-only, with only its core tools:
    kubernetes-mcp-server --read-only --toolsets core --port 8080
    Its optional toolsets (helm, tekton, kiali, kubevirt, netobserv) are not needed, and its config tools must stay off.
  2. Bind the server's service account to the built-in view role and to a read role for cluster-wide objects. The page shows the entropix-read ClusterRole under Recommended read-only identity: get, list and watch on nodes, namespaces, persistent volumes, events and the common API groups.
    kubectl create clusterrolebinding entropix-view --clusterrole=view --serviceaccount=<namespace>:<name>
    kubectl create clusterrolebinding entropix-read --clusterrole=entropix-read --serviceaccount=<namespace>:<name>
  3. Check that the identity cannot read Secrets. It must answer no:
    kubectl auth can-i list secrets --all-namespaces --as=system:serviceaccount:<namespace>:<name>
Careful

Never grant Secrets or nodes/proxy. The portal refuses a cluster whose identity can read Secrets.

Add a cluster

  1. On the agent's Connections tab, choose Add a cluster.
  2. Fill in Cluster name: lowercase letters and digits joined by single hyphens, at most 40 characters, for example prod-singapore. Its tools are named after it, such as prod-singapore__pods_list.
  3. Pick an Environment: Production, Staging, Development or Other. It is required, so the agent always knows which cluster is production.
  4. Optionally fill in Region (at most 40 characters) and More details: one key = value per line, such as team = payments, at most 10 lines, each value at most 100 characters.
  5. Fill in MCP URL. If a proxy in front of the server asks for a secret, add it under Authentication as Header name and Header value. The value is stored encrypted and never shown again.
  6. Choose Test.
  7. Read the result, then choose Add cluster.

A test shows:

  • Reached · N tools, or Not reached with the details.
  • Namespaces: readable or not readable.
  • The Secrets check: Secrets: cannot be listed cluster-wide (good), a refusal if they can be read, or Secrets were not checked — run the command above when the server has no tool the portal can check with.
  • Tools it will offer and Tools it will not offer, each with its reason.

Add cluster runs the Secrets check again and refuses the cluster if Secrets are readable. It then saves the cluster, gives it to this agent with its read-only tools ticked, and starts the tool scan. Approve the scan's reference as for any tool server (see Connect tool servers (MCP)). If Secrets were not checked, the agent's row keeps a Secrets were not checked reminder.

Many clusters on one agent

An agent can hold several clusters: add each one with Add a cluster. Every cluster is a connection, and an agent holds at most 8 connections in all, clusters and tool servers together. Each cluster's tools carry its name, so the agent always says which cluster it read.

To change a cluster's environment, region or details later, open the cluster from the agent's row (or from Settings › Tools), edit Facts and save. Its page shows a badge such as Kubernetes · Production.

What the agent can and cannot reach

Kind of toolWhat happens
Tools the server marks read-only, such as listing pods, namespaces and resourcesTicked by default. They run freely in chats, goals and reviews.
Any other toolNot ticked by default. If you tick it, it always asks first: in a goal or a chat it runs only after a person approves the exact call (see Approve actions). You cannot set it to run freely.
Tools whose names mention config, secrets, tokens, credentials or passwords, or whose description mentions a kubeconfigNever offered, whatever you tick.

Before results reach the agent, the portal hides the values of fields named like passwords, tokens, keys or secrets. The agent sees [masked] and is told never to guess or ask for the value. Text from the cluster, such as logs, events and annotations, is treated as data, never as instructions.

How the agent proposes a change

The agent does not change your cluster. When it suggests a change, it writes a change card for a person to run:

  • Change: the target (cluster, namespace, kind and name) and each field, as its value now and its new value;
  • a kubectl --context <cluster> command that scales, patches or sets, never apply -f;
  • the same change as a YAML patch;
  • Risks: what could undo it or bite, such as an autoscaler, a quota, a disruption budget or production.

If you ticked a tool that makes changes, the agent can call it instead, and the call waits for a person. In a goal, a member approves it on the portal's card. In a chat, the agent asks there: reply yes to run it or no to skip. See Runs freely or Asks first and Approve actions.

What you can and can't do

You can
  • Give one agent several clusters, each with its own environment.
  • Tick a change tool, which then always asks first.
  • Edit a cluster's environment, region and details after adding it.
  • Run the change card's command yourself.
You can't
  • Add a cluster whose identity can read Secrets.
  • Add a cluster without an environment.
  • Let a change tool run freely, or offer a tool that can expose credentials.
  • Have the agent apply a change on its own.

Troubleshooting

"this cluster identity can read Secrets — give it a role without them (the built-in view role has none), then test again"
Remove the Secrets access from the service account's roles, run the kubectl auth can-i check, then test again.
"choose the cluster's environment: Production, Staging, Development or Other"
Pick an environment.
"a cluster's name is lowercase letters and digits joined by single hyphens, up to 40 characters — its tools are named after it"
Rename it, for example prod-eu-1.
"More details, line N: use "key = value""
Write each detail as a key, an equals sign and a value.
"the server could not be listed: …"
The portal could not reach the MCP server. Check the URL, the proxy and that the server runs in HTTP mode.