deployment_delete
Delete Kubernetes deployments by specifying context, namespace, and deployment name to remove resources from clusters managed by k8s-pilot.
Instructions
Delete a Deployment from the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment 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/deployment.py:113-127 (handler)The handler function that implements the logic to delete a Kubernetes Deployment using the AppsV1Api client.def deployment_delete(context_name: str, namespace: str, name: str): """ Delete a Deployment from the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment name Returns: Status of the deletion operation """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] apps_v1.delete_namespaced_deployment(name=name, namespace=namespace) return {"name": name, "status": "Deleted"}
- tools/deployment.py:110-110 (registration)The @mcp.tool() decorator registers the deployment_delete function as an MCP tool.@mcp.tool()
- tools/deployment.py:114-124 (schema)Docstring defining the input parameters (context_name, namespace, name) and return value for the tool.""" Delete a Deployment from the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Deployment name Returns: Status of the deletion operation """
- tools/deployment.py:111-112 (helper)Decorators providing current context management and readonly permission check for the tool.@use_current_context @check_readonly_permission