k8s_delete_pod
Delete a specific Kubernetes pod for troubleshooting or cleanup. The pod will be recreated if managed by a controller.
Instructions
Delete a specific pod (it will be recreated if managed by a controller)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Pod name | |
| namespace | No | Kubernetes namespace (default: 'default') |
Implementation Reference
- src/tools/kubernetes/pods.ts:114-123 (handler)The handler function `deletePod` performs the actual deletion of the Kubernetes pod using the API client.
export async function deletePod(args: Record<string, unknown>): Promise<string> { const api = getCoreV1Api(); const namespace = (args.namespace as string) || "default"; const name = args.name as string; if (!name) throw new Error("Pod name is required"); await api.deleteNamespacedPod(name, namespace); return `Pod '${name}' in namespace '${namespace}' has been deleted.`; } - src/tools/kubernetes/index.ts:36-46 (schema)The schema definition and input validation for the `k8s_delete_pod` tool.
name: "k8s_delete_pod", description: "Delete a specific pod (it will be recreated if managed by a controller)", inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Pod name" }, namespace: { type: "string", description: "Kubernetes namespace (default: 'default')" }, }, required: ["name"], }, }, - src/tools/kubernetes/index.ts:198-198 (registration)The registration/dispatch entry point in `handleKubernetesTool` that maps `k8s_delete_pod` to the `deletePod` handler.
case "k8s_delete_pod": return deletePod(a);