statefulset_delete
Delete a StatefulSet from a specified Kubernetes namespace to remove stateful applications and manage cluster resources.
Instructions
Delete a StatefulSet from the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The StatefulSet name
Returns: Status of the deletion operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes | ||
| name | Yes |
Implementation Reference
- tools/statefulset.py:111-128 (handler)The handler function for the 'statefulset_delete' MCP tool. It deletes a StatefulSet using the Kubernetes API. Registered via the @mcp.tool() decorator.@mcp.tool() @use_current_context @check_readonly_permission def statefulset_delete(context_name: str, namespace: str, name: str): """ Delete a StatefulSet from the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The StatefulSet name Returns: Status of the deletion operation """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] apps_v1.delete_namespaced_stateful_set(name=name, namespace=namespace) return {"name": name, "status": "Deleted"}
- tools/statefulset.py:111-111 (registration)The @mcp.tool() decorator registers the statefulset_delete function as an MCP tool.@mcp.tool()