Skip to main content

Kubernetes

Manages Kubernetes clusters via the kubectl CLI. An agent can list, describe, scale, and delete resources, apply manifests, tail pod logs, exec into containers, and manage deployment rollouts — all scoped to a single namespace and (optionally) a specific kubeconfig context.

Add to an agent node's tools array with _node_type: "tool-kubernetes". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
kubeconfigNoFull kubeconfig YAML content. Written to a temporary file and passed via kubectl --kubeconfig; if omitted, kubectl uses its default configuration on the worker host.
namespaceNoKubernetes namespace to scope all commands to (kubectl -n <namespace>). Defaults to default.
contextNokubeconfig context name to use (kubectl --context).
{
"name": "kubernetes",
"_node_type": "tool-kubernetes",
"kubeconfig": "{{ secret.K8S_KUBECONFIG }}",
"namespace": "production",
"context": "prod-cluster"
}

Tools

k8s_get

List Kubernetes resources. Returns names, status, restarts and age.

Parameters

ParameterTypeRequiredDescription
kindstringYesResource type: pods deployments services nodes configmaps secrets
labelstringNoLabel selector e.g. app=nginx

Returns: The output of kubectl get <kind> -o wide (optionally with -l <label>).

k8s_apply

Apply a Kubernetes manifest YAML. Creates or updates any resource.

Parameters

ParameterTypeRequiredDescription
manifeststringYesKubernetes YAML manifest to apply

Returns: The output of kubectl apply -f <manifest-file>.

k8s_scale

Scale a Kubernetes deployment to a specific number of replicas.

Parameters

ParameterTypeRequiredDescription
deploymentstringYesDeployment name
replicasnumberYesDesired replica count

Returns: The output of kubectl scale deployment <deployment> --replicas=<replicas>.

k8s_logs

Get recent logs from a Kubernetes pod.

Parameters

ParameterTypeRequiredDescription
podstringYesPod name or -l label=value
linesnumberNoLast N lines (default 100)

Returns: The output of kubectl logs --tail=<lines> <pod>. If pod starts with -l or contains =, it is treated as a label selector and passed via kubectl logs -l <selector> instead of a pod name.

k8s_delete

Delete a Kubernetes resource by kind and name.

Parameters

ParameterTypeRequiredDescription
kindstringYesResource type
namestringYesResource name

Returns: The output of kubectl delete <kind> <name>.

k8s_exec

Execute a command inside a running Kubernetes pod container.

Parameters

ParameterTypeRequiredDescription
podstringYesPod name
commandstringYesCommand to run inside the pod

Returns: The output of kubectl exec <pod> -- sh -c "<command>".

k8s_describe

Describe a Kubernetes resource — shows spec, status and recent events.

Parameters

ParameterTypeRequiredDescription
kindstringYesResource type
namestringYesResource name

Returns: The output of kubectl describe <kind> <name>.

k8s_rollout

Manage deployment rollouts: status, restart, history, undo.

Parameters

ParameterTypeRequiredDescription
actionstringYesstatus restart history undo
deploymentstringYesDeployment name

Returns: The output of kubectl rollout <action> deployment/<deployment>.

Next