service_delete
Remove a Kubernetes Service from a specified namespace using k8s-pilot. Input context name, namespace, and service name to execute the deletion and receive operation status.
Instructions
Delete a Service from the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Service name
Returns: Status of the deletion operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/service.py:106-123 (handler)The service_delete tool handler function that deletes a Kubernetes Service using CoreV1Api.delete_namespaced_service. Registered via @mcp.tool() decorator.@mcp.tool() @use_current_context @check_readonly_permission def service_delete(context_name: str, namespace: str, name: str): """ Delete a Service from the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Service name Returns: Status of the deletion operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] core_v1.delete_namespaced_service(name=name, namespace=namespace) return {"name": name, "status": "Deleted"}