Skip to main content
Glama

upgrade_helm_chart

Upgrades an existing Helm chart release in Kubernetes by applying new configurations or versions to maintain application deployments.

Instructions

Upgrade an existing Helm chart release

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the Helm release to upgrade
chartYesChart name or path to chart directory
namespaceYesKubernetes namespacedefault
contextNoKubeconfig Context to use for the command (optional - defaults to null)
repoNoHelm repository URL (optional if using local chart path)
valuesNoCustom values to override chart defaults
valuesFileNoPath to values file (alternative to values object)

Implementation Reference

  • The primary handler function that executes the 'helm upgrade' command, managing repositories, values files/objects, temporary files, and error handling.
    export async function upgradeHelmChart( params: HelmUpgradeOperation ): Promise<{ content: { type: string; text: string }[] }> { try { // Add repository if provided if (params.repo) { const repoName = params.chart.split("/")[0]; executeCommand("helm", ["repo", "add", repoName, params.repo]); executeCommand("helm", ["repo", "update"]); } const args = [ "upgrade", params.name, params.chart, "--namespace", params.namespace, ]; // Add values file if provided if (params.valuesFile) { args.push("-f", params.valuesFile); } // Add values object if provided if (params.values) { const valuesContent = dump(params.values); const tempFile = `/tmp/values-${Date.now()}.yaml`; writeFileSync(tempFile, valuesContent); try { args.push("-f", tempFile); executeCommand("helm", args); } finally { unlinkSync(tempFile); } } else { executeCommand("helm", args); } return { content: [ { type: "text", text: JSON.stringify({ status: "upgraded", message: `Helm chart '${params.name}' upgraded successfully in namespace '${params.namespace}'`, }), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify({ status: "failed", error: `Failed to upgrade Helm chart: ${error.message}`, }), }, ], }; } }
  • The JSON schema defining the input parameters and structure for the upgrade_helm_chart tool.
    export const upgradeHelmChartSchema = { name: "upgrade_helm_chart", description: "Upgrade an existing Helm chart release", annotations: { destructiveHint: true, }, inputSchema: { type: "object", properties: { name: { type: "string", description: "Name of the Helm release to upgrade", }, chart: { type: "string", description: "Chart name or path to chart directory", }, namespace: namespaceParameter, context: contextParameter, repo: { type: "string", description: "Helm repository URL (optional if using local chart path)", }, values: { type: "object", description: "Custom values to override chart defaults", }, valuesFile: { type: "string", description: "Path to values file (alternative to values object)", }, }, required: ["name", "chart", "namespace"], }, };
  • src/index.ts:435-446 (registration)
    The switch case in the CallToolRequestSchema handler that registers and dispatches execution of the upgrade_helm_chart tool to its handler function.
    case "upgrade_helm_chart": { return await upgradeHelmChart( input as { name: string; chart: string; repo: string; namespace: string; values?: Record<string, any>; context?: string; } ); }
  • src/index.ts:123-123 (registration)
    Inclusion of the upgradeHelmChartSchema in the allTools array, making it available via ListToolsRequest.
    upgradeHelmChartSchema,
  • src/index.ts:5-11 (registration)
    Import statement bringing the handler and schema into the main index file for registration.
    installHelmChart, installHelmChartSchema, upgradeHelmChart, upgradeHelmChartSchema, uninstallHelmChart, uninstallHelmChartSchema, } from "./tools/helm-operations.js";

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/Flux159/mcp-server-kubernetes'

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