create-namespace
Create a new namespace in Kubernetes clusters to organize and isolate resources, enabling logical separation for applications or teams.
Instructions
Create a new namespace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the namespace to create |
Implementation Reference
- server.js:1851-1861 (handler)Handler function that executes the 'kubectl create namespace' command using the provided namespace name and returns the command output or a success message.case "create-namespace": { const { name } = args; const cmd = `kubectl create namespace ${name}`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || `Created namespace ${name}` }] }; }
- server.js:710-722 (schema)Tool schema definition including name, description, and input schema requiring a 'name' parameter of type string.name: "create-namespace", description: "Create a new namespace", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name of the namespace to create" } }, required: ["name"] } },
- server.js:1392-1394 (registration)Registration of all tools list handler, which includes 'create-namespace' in the tools array returned to clients.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });