Skip to main content
Glama

create-backup

Back up Kubernetes cluster resources to a specified file, optionally filtering by namespace to protect configurations and data.

Instructions

Create a backup of cluster resources

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNoThe namespace to backup (optional, backs up all namespaces if not specified)
outputNoOutput file path for the backup

Implementation Reference

  • The handler logic for the 'create-backup' tool. It executes a kubectl command to get all resources (in specified namespace or all) in YAML format and saves to the provided output file path (defaults to 'backup.yaml'). Returns success message or stdout.
    const { namespace, output = "backup.yaml" } = args || {}; const nsArg = namespace ? `-n ${namespace}` : "--all-namespaces"; const cmd = `kubectl get all ${nsArg} -o yaml > ${output}`; const { stdout } = await execAsync(cmd); return { content: [{ type: "text", text: stdout || `Backup created in ${output}` }] }; }
  • server.js:1373-1388 (registration)
    Tool registration in the tools list returned by ListToolsRequestHandler, including name, description, and inputSchema.
    name: "create-backup", description: "Create a backup of cluster resources", inputSchema: { type: "object", properties: { namespace: { type: "string", description: "The namespace to backup (optional, backs up all namespaces if not specified)" }, output: { type: "string", description: "Output file path for the backup" } } } }
  • Input schema definition for the 'create-backup' tool, defining optional namespace and output file path parameters.
    type: "object", properties: { namespace: { type: "string", description: "The namespace to backup (optional, backs up all namespaces if not specified)" }, output: { type: "string", description: "Output file path for the backup" } } }

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