Feature requestIn progress

More Kubernetes tools in the MCP server: node maintenance, delete any resource, events and describe

thanhlinh9191Posted

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

  1. k8s_cordon_node / k8s_uncordon_node.
  1. k8s_drain_node with ignore-daemonsets, delete-emptydir-data and a timeout, plus a dry run that lists the pods that would be evicted.
  1. 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.
  1. 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

  1. 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

  1. k8s_events(namespace?, involvedObject?): the usual first look for a Pending pod, an image pull error or an OOM kill.
  1. k8s_describe(kind, namespace, name), or a k8s_get that returns the YAML of one object, with Secret values masked.
  1. 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

  1. k8s_exec(namespace, pod, container?, command) for one-shot commands, with the same permission tier as run_command.
  1. Helm: list releases, uninstall a release.
  1. 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

  1. PENDING

  2. REVIEWING

    —

  3. PLANNED

    —

  4. IN PROGRESS

  5. 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