Skip to main content
Glama

create-ephemeral-container

Debug Kubernetes pods by creating temporary containers to run diagnostic commands and troubleshoot issues without restarting the pod.

Instructions

Create an ephemeral debug container in a pod

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
podYesThe name of the pod
imageYesThe container image to use for debugging
nameYesThe name of the ephemeral container
namespaceNoThe namespace of the pod (optional, defaults to current context namespace)
commandNoThe command to run in the container

Implementation Reference

  • The handler function for the 'create-ephemeral-container' tool. It destructures the arguments, constructs a kubectl debug command with ephemeral container options, executes it via execAsync, and returns the stdout or a success message.
    case "create-ephemeral-container": { const { pod, image, name, namespace, command } = args; const nsArg = namespace ? `-n ${namespace}` : ""; const commandArg = command ? `-- ${command}` : ""; const cmd = `kubectl debug ${pod} ${nsArg} --image=${image} --container=${name} --ephemeral-containers ${commandArg}`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || `Ephemeral container ${name} created in pod ${pod}` }] }; }
  • server.js:1326-1354 (registration)
    The tool registration entry in the tools array, which includes the name, description, and inputSchema. This is returned by the ListToolsRequestHandler.
    name: "create-ephemeral-container", description: "Create an ephemeral debug container in a pod", inputSchema: { type: "object", properties: { pod: { type: "string", description: "The name of the pod" }, image: { type: "string", description: "The container image to use for debugging" }, name: { type: "string", description: "The name of the ephemeral container" }, namespace: { type: "string", description: "The namespace of the pod (optional, defaults to current context namespace)" }, command: { type: "string", description: "The command to run in the container" } }, required: ["pod", "image", "name"] } },
  • The inputSchema defining the parameters for the create-ephemeral-container tool, including required fields pod, image, name.
    inputSchema: { type: "object", properties: { pod: { type: "string", description: "The name of the pod" }, image: { type: "string", description: "The container image to use for debugging" }, name: { type: "string", description: "The name of the ephemeral container" }, namespace: { type: "string", description: "The namespace of the pod (optional, defaults to current context namespace)" }, command: { type: "string", description: "The command to run in the container" } }, required: ["pod", "image", "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/thekaranpargaie/kube-mcp'

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