Skip to main content
Glama

k8s_cordon_node

Mark a Kubernetes node as unschedulable to prevent new pods from being scheduled, enabling safe maintenance or troubleshooting.

Instructions

Mark a node as unschedulable (cordon) — prevents new pods from being scheduled

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesNode name

Implementation Reference

  • The handler function `cordonNode` that performs the actual K8s API call to cordon a node.
    export async function cordonNode(args: Record<string, unknown>): Promise<string> {
      const api = getCoreV1Api();
      const name = args.name as string;
      if (!name) throw new Error("Node name is required");
    
      await api.patchNode(
        name,
        { spec: { unschedulable: true } },
        undefined,
        undefined,
        undefined,
        undefined,
        undefined,
        { headers: { "Content-Type": "application/strategic-merge-patch+json" } }
      );
    
      return `Node '${name}' cordoned — no new pods will be scheduled on this node.`;
    }
  • Registration of the `k8s_cordon_node` tool definition in the Kubernetes toolset.
      name: "k8s_cordon_node",
      description: "Mark a node as unschedulable (cordon) — prevents new pods from being scheduled",
      inputSchema: {
        type: "object" as const,
        properties: {
          name: { type: "string", description: "Node name" },
        },
        required: ["name"],
      },
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/batu-sonmez/infraclaude'

If you have feedback or need assistance with the MCP directory API, please join our Discord server