Connect Kubernetes to Toolspoke

Inspect pods, deployments, nodes and events on a cluster, and read pod logs. Toolspoke gives your agents 12 of its actions, and you decide which ones each project allows.

Connection
Provider REST API
Authentication
Service account token
Actions exposed
12
What a call bills
Nothing
Adapter
Maintained by Toolspoke

Connected in three steps

  1. Install Kubernetes

    Open the marketplace in your workspace, add Kubernetes to the project your agents work in, and it appears on the gateway immediately.

  2. Connect the credential

    Provide the credential Kubernetes asks for. Where to get it, and what it has to be able to reach, is the next section.

  3. Give it to an agent

    Describe the job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. It can use every Kubernetes action the project leaves on.

Where the agent answers

  • Slack

    Ask it in a channel or a thread, and it replies in the thread it was asked in.

  • Email

    Email it. Each write waits for a person's go-ahead unless that action is allowed in advance.

  • GitHub

    Mention it on a pull request, and it answers there.

  • Schedule

    A routine wakes it on a schedule, or when a new item matches.

Any agent in the project can use Kubernetes, and only the actions the project leaves on.

What Kubernetes asks for

Service account token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.

Service account tokenRequired
A ServiceAccount bearer token: create the account, bind it to a role, then mint a token with `kubectl create token <name> --duration=…`. Bind it to view for read-only, and grant delete on pods and update on deployments/scale only if you want the write actions to work.
eyJhbGciOi…
API server URLRequired
The cluster's publicly reachable API server endpoint, e.g. the control plane URL from your kubeconfig. Private-network and cluster-internal addresses are refused, this never reaches a socket or a local kubectl proxy.
https://k8s.example.com
Default namespaceOptional
Used whenever an action is called without an explicit namespace.
default

What an agent can do in Kubernetes

12 actions, each one declared by name in the connector. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.

10 read, 1 write, 1 destructive

Reads

10

Fetches data and changes nothing.

  • list_namespaces

    List the namespaces on the cluster with their phase. Call this first when you do not know which namespace an application runs in, every other action here except list_nodes is namespace-scoped.

  • list_pods

    List the pods in a namespace with their phase, restart counts and node. Start here when something is unhealthy: the restart count and the container statuses usually say which pod to look at, and the pod name is what get_pod, get_pod_logs and delete_pod need. Narrow with label_selector (e.g. app=checkout) or field_selector (e.g. status.phase=Running).

  • get_pod

    Fetch one pod's full object: containers and images, resource requests and limits, volumes, conditions, and per-container state including the reason a container last terminated. This is where CrashLoopBackOff, OOMKilled and ImagePullBackOff are actually explained. Read the logs with get_pod_logs afterwards.

  • get_pod_logs

    Read the tail of one container's log. Pass container when the pod runs more than one, or the API server refuses the request and names the choices. Set previous to true to read the log of the container that crashed rather than the one that replaced it, that is usually the log you actually want. Output is capped at roughly 20000 characters, keeping the most recent lines.

  • list_deployments

    List the deployments in a namespace with their desired, updated, ready and available replica counts. A deployment whose ready count is below its desired count is the usual first sign of a rollout that stalled. The deployment name is what get_deployment and scale_deployment need.

  • get_deployment

    Fetch one deployment in full: its pod template, images, replica strategy, and the conditions explaining a rollout that is not progressing. Call this before scale_deployment so you know the current replica count you are changing.

  • list_services

    List the services in a namespace with their type, cluster IP, ports and selector. Use it to check that a service's selector actually matches the labels on the pods list_pods returned, a service selecting nothing is a common cause of "the app is up but nothing reaches it".

  • list_nodes

    List the cluster's nodes with their conditions, capacity and allocatable resources. Use it when pods are stuck Pending, a node under MemoryPressure or DiskPressure, or one that is NotReady, explains that where the pod object does not. This is the one action here that is not namespace-scoped.

  • list_events

    List the recent events in a namespace, scheduling failures, image pull errors, probe failures, evictions and scaling decisions, in the cluster's own words. This is the fastest explanation of why a pod will not start, and it says things no object status does. Narrow to one object with field_selector, e.g. "involvedObject.name=checkout-7c9".

  • describe_resource

    Fetch any core-v1 namespaced object by kind and name, for the things that have no dedicated action here: configmaps, endpoints, persistentvolumeclaims, serviceaccounts, replicationcontrollers. Use it to check what a pod is actually mounting, or whether a service has any endpoints behind it. Only core-v1 kinds are reachable, deployments and pods have their own actions above.

Writes

1

Creates or updates something on the other side.

  • scale_deployment

    Set a deployment's replica count by patching its scale subresource. Scaling to 0 takes the workload down and scaling up costs capacity, so read get_deployment first and put the count back when you are done. A HorizontalPodAutoscaler will overwrite this within its next sync interval.

Destructive

1

Deletes or permanently alters something. Worth granting on purpose.

  • delete_pod

    Delete a pod. In practice this restarts it: anything owned by a Deployment, StatefulSet or DaemonSet is recreated immediately, which is the usual remediation for a wedged or leaking process. A pod with no controller is simply gone, and its logs go with it, read get_pod_logs first. This changes what the on-call rota sees, because the restart shows up as an event and may re-trigger a probe alert.

What it will not do

The gateway enforces each of these, so they can be stated flatly.

It cannot call anything else
The 12 actions above are the whole of it. A call to any other name is refused before it reaches Kubernetes rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
It reaches no further than your credential
Toolspoke holds no access to Kubernetes of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
It never hears from Kubernetes
Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Kubernetes. An agent has to ask.
It does not smooth over provider limits
Toolspoke does not retry, queue or back off around Kubernetes's own rate limits. A call that Kubernetes refuses comes back to the agent as a failed call.

Before you connect it

What can an agent do in Kubernetes?

12 named actions: 10 that only read, 1 that write and 1 that delete or permanently alter something. They include list_namespaces, list_pods and get_pod. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.

What credentials does the Kubernetes connector need?

Service account token. The connector asks for service account token and api server url, and optionally default namespace. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.

How does an agent get to use Kubernetes?

Install Kubernetes in a project and every agent in that project can use the actions the project leaves on. Describe a job in one sentence and the builder proposes the instructions, the toolkits it needs, a schedule and where it should answer, or start from a catalogue agent. The agent answers when someone asks it in Slack, emails it or mentions it on a GitHub pull request, or when its routine wakes it.

What does the Kubernetes connector not do?

The 12 actions above are the whole of it. A call to any other name is refused before it reaches Kubernetes rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Toolspoke holds no access to Kubernetes of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Kubernetes. An agent has to ask. Toolspoke does not retry, queue or back off around Kubernetes's own rate limits. A call that Kubernetes refuses comes back to the agent as a failed call.

Can I limit which actions an agent can call?

Yes, in two places. The project switches Kubernetes's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.

What gets recorded when an agent calls Kubernetes?

Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and what the call cost in sandbox time and model tokens. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.

Connect Kubernetes to Toolspoke

Add Kubernetes to a project and give it to an agent.