More Kubernetes tools in the MCP server: node maintenance, delete any resource, events and describe
The problem
Follow-up to FEAT-93. The 10 k8s_* MCP tools work well for watching a cluster and for day-to-day app work (overview, list, logs, apply with server dry-run, restart, scale, rollback, delete pod). On a small k3s cluster (1 server + 3 agents joined over Tailscale) we still had to drop to run_command + sudo kubectl for the jobs below. Each one is something we actually did on the cluster in the last month.
NODE MAINTENANCE
- k8s_cordon_node / k8s_uncordon_node.
- k8s_drain_node with ignore-daemonsets, delete-emptydir-data and a timeout, plus a dry run that lists the pods that would be evicted.
- k8s_delete_node (danger tier). Needed when a rented VPS expires, and when moving the etcd server: the old node has to be deleted before it is stopped, or quorum is lost.
- k8s_label_node and k8s_taint_node (set and remove). We use labels such as node-role.kubernetes.io/worker=true and a custom node-lifetime=expiring to steer scheduling.
DELETE ANY RESOURCE
- k8s_delete_resource(kind, namespace, name), or k8s_delete_manifest with the same server dry run as k8s_apply_manifest. Today only pods can be deleted, but cleanups also remove Ingresses, Services, Secrets and whole namespaces. Namespace delete should be danger tier.
DEBUGGING
- k8s_events(namespace?, involvedObject?): the usual first look for a Pending pod, an image pull error or an OOM kill.
- k8s_describe(kind, namespace, name), or a k8s_get that returns the YAML of one object, with Secret values masked.
- More kinds in k8s_list: configmaps, secrets (names and keys only, never values), persistentvolumeclaims, persistentvolumes, jobs, cronjobs, statefulsets/daemonsets selectors, and node labels and taints in the node rows.
NICE TO HAVE
- k8s_exec(namespace, pod, container?, command) for one-shot commands, with the same permission tier as run_command.
- Helm: list releases, uninstall a release.
- k3s host tasks: list etcd snapshots and take one on demand (k3s etcd-snapshot ls / save). Restore can stay a manual step.
WHY
An agent driving Server Compass through MCP should be able to finish a whole maintenance task, for example "retire this worker", inside the tool's permission tiers and dry-run checks, instead of falling back to raw shell commands that skip all of those checks.
Roadmap progress
PENDING
REVIEWING
—
PLANNED
—
IN PROGRESS
COMPLETED
—
- — thanhlinh9191 submitted this request
- — Khoa - StoicSoft Team moved it to In progress
Discussion0
Newest first- No comments yet. Add context or ask a question below.
Sign in to comment, vote and follow this request.
Sign in to reply