UNPKG

mcp-server-kubernetes

Version:

MCP server for interacting with Kubernetes clusters via kubectl

104 lines (103 loc) 3.26 kB
/** * Tool: node_management * Manage Kubernetes nodes with cordon, drain, and uncordon operations. * Provides safety features for node operations and implements proper error handling * and confirmation requirements for destructive operations. * Note: Use kubectl_get with resourceType="nodes" to list nodes. */ /** * Schema for node_management tool. * - operation: Node operation to perform (cordon, drain, uncordon) * - nodeName: Name of the node to operate on (required for cordon, drain, uncordon) * - force: Force the operation even if there are unmanaged pods (for drain) * - gracePeriod: Grace period for pod termination (for drain) * - deleteLocalData: Delete local data even if emptyDir volumes are used (for drain) * - ignoreDaemonsets: Ignore DaemonSet-managed pods (for drain) * - timeout: Timeout for drain operation * - dryRun: Show what would be done without actually doing it (for drain) * - confirmDrain: Explicit confirmation to drain the node (required for drain) */ export declare const nodeManagementSchema: { name: string; description: string; annotations: { destructiveHint: boolean; }; inputSchema: { type: string; properties: { operation: { type: string; description: string; enum: string[]; }; nodeName: { type: string; description: string; }; force: { type: string; description: string; default: boolean; }; gracePeriod: { type: string; description: string; default: number; }; deleteLocalData: { type: string; description: string; default: boolean; }; ignoreDaemonsets: { type: string; description: string; default: boolean; }; timeout: { type: string; description: string; default: string; }; dryRun: { type: string; description: string; default: boolean; }; confirmDrain: { type: string; description: string; default: boolean; }; }; required: string[]; }; }; /** * Interface for node_management tool parameters. */ interface NodeManagementParams { operation: "cordon" | "drain" | "uncordon"; nodeName?: string; force?: boolean; gracePeriod?: number; deleteLocalData?: boolean; ignoreDaemonsets?: boolean; timeout?: string; dryRun?: boolean; confirmDrain?: boolean; } /** * Main node_management function that handles all node operations. * Implements safety features and proper error handling for node management tasks. * @param params - Node management parameters * @returns Promise with operation results */ export declare function nodeManagement(params: NodeManagementParams): Promise<{ content: { type: string; text: string; }[]; }>; export {};