secret_delete
Remove a Kubernetes Secret from a specified namespace to manage sensitive data securely. This tool helps delete secrets when they are no longer needed or to maintain cluster security.
Instructions
Delete a Secret from the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Secret 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/secret.py:104-121 (handler)The handler function for the 'secret_delete' MCP tool. It uses the Kubernetes CoreV1Api to delete a secret in the given namespace. Decorated with @mcp.tool() for registration, @use_current_context for context management, and @check_readonly_permission for access control.@mcp.tool() @use_current_context @check_readonly_permission def secret_delete(context_name: str, namespace: str, name: str): """ Delete a Secret from the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Secret name Returns: Status of the deletion operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] core_v1.delete_namespaced_secret(name=name, namespace=namespace) return {"name": name, "status": "Deleted"}
- tools/secret.py:104-104 (registration)The @mcp.tool() decorator registers the secret_delete function as an MCP tool.@mcp.tool()