uncordon_node
Mark a Kubernetes node as schedulable to allow pod deployment after maintenance or issues, using the k8s-pilot server for cluster management.
Instructions
Uncordon a node (mark as schedulable).
Args: context_name: The Kubernetes context name node_name: The name of the node to uncordon
Returns: JSON string containing the result of the operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| node_name | Yes |
Implementation Reference
- tools/node.py:400-442 (handler)The handler function for the 'uncordon_node' MCP tool. It uses the Kubernetes CoreV1Api to read the node status, checks if it's already schedulable, and if not, patches the node's spec.unschedulable to False. The @mcp.tool() decorator registers it as an MCP tool.@mcp.tool() @use_current_context def uncordon_node(context_name: str, node_name: str): """ Uncordon a node (mark as schedulable). Args: context_name: The Kubernetes context name node_name: The name of the node to uncordon Returns: JSON string containing the result of the operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] # Get the current node node = core_v1.read_node(node_name) # Check if already uncordoned if not node.spec.unschedulable: result = { "name": node_name, "status": "already schedulable", "unschedulable": False } return json.dumps(result) # Apply the patch body = { "spec": { "unschedulable": False } } patched_node = core_v1.patch_node(node_name, body) result = { "name": patched_node.metadata.name, "status": "uncordoned", "unschedulable": patched_node.spec.unschedulable } return json.dumps(result)