pv_delete
Remove a PersistentVolume from a Kubernetes cluster to free storage resources and manage cluster capacity.
Instructions
Delete a PersistentVolume from the cluster.
Args: context_name: The Kubernetes context name name: The PersistentVolume name
Returns: Status of the deletion operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes |
Implementation Reference
- tools/pv.py:104-104 (registration)Registers the pv_delete tool using the MCP decorator.@mcp.tool()
- tools/pv.py:104-120 (handler)The handler function for pv_delete tool, decorated with context and permission checks, implements deletion of PersistentVolume via Kubernetes CoreV1Api.@mcp.tool() @use_current_context @check_readonly_permission def pv_delete(context_name: str, name: str): """ Delete a PersistentVolume from the cluster. Args: context_name: The Kubernetes context name name: The PersistentVolume name Returns: Status of the deletion operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] core_v1.delete_persistent_volume(name=name) return {"name": name, "status": "Deleted"}