8000 feat(helm): add Helm chart for Kubernetes deployment by ayushgharat234 · Pull Request #4399 · googleapis/mcp-toolbox · GitHub
[go: up one dir, main page]

Skip to content

feat(helm): add Helm chart for Kubernetes deployment - #4399

Open
ayushgharat234 wants to merge 2 commits into
googleapis:mainfrom
ayushgharat234:feat/helm-chart
Open

ayushgharat234 wants to merge 2 commits into
googleapis:mainfrom
ayushgharat234:feat/helm-chart

Conversation

@ayushgharat234
@ayushgharat234 ayushgharat234 commented Nov 2, 2026 •
Copy link
Copy Markdown

Description

Adds a Helm chart at charts/mcp-toolbox for deploying Toolbox to Kubernetes, with helm-unittest tests. This is the first of the three PRs proposed in #486. A kind-based CI job and docs will follow in separate PRs.

The tool configuration comes from a chart-managed Secret (config.toolsYaml), an existing Secret (config.existingSecret) or prebuilt tool sets (config.prebuilt). The default settings pass the restricted Pod Security Standard. Ingress, HPA and PDB are optional. The chart README covers usage.

Design decisions

Choice Reason
--poll-interval=10 by default (config.pollInterval) Kubernetes updates mounted Secrets by swapping a ..data symlink. The fsnotify watcher in cmd/root.go doesn't detect that swap, so without polling an updated Secret is never reloaded. The Secret is also mounted as a directory, because subPath mounts never receive updates.
runAsUser: 65532 set explicitly The image runs as the named user nonroot. With only runAsNonRoot: true, the kubelet can't verify that user and the pod fails with CreateContainerConfigError.
.gitignore: mcp-toolbox → /mcp-toolbox The unanchored binary pattern also ignored charts/mcp-toolbox/.

Testing

helm lint --strict and helm unittest (27 tests) pass. I also installed the chart on Kubernetes v1.36.1 in a namespace that enforces the restricted Pod Security Standard. The MCP endpoint responded, an updated Secret was reloaded in 58s with no restart, and allowedHosts returned 403 for an unlisted host while /healthz stayed reachable.

Verification output
=== Effective security context ===
{"fsGroup":65532,"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532,"seccompProfile":{"type":"RuntimeDefault"}}
{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true}

=== Container args ===
["--address=0.0.0.0","--port=5000","--config=/etc/toolbox/tools.yaml","--poll-interval=10"]

=== GET /healthz ===
HTTP 200

=== MCP initialize ===
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18",...,"serverInfo":{"name":"Toolbox","version":"1.15.0+container.release.linux.amd64.8e8e569"}}}

=== MCP tools/list (v1 config) ===
"name":"list-tables"

=== Hot reload: update the Secret to v2 (adds sqlite-version) ===
reloaded after 58s
"name":"list-tables"
"name":"sqlite-version"
NAME                                   RESTARTS
toolbox-mcp-toolbox-6f6448468c-sxf4v   0

=== allowedHosts: restrict to toolbox.example.com ===
/healthz, any Host:             HTTP 200
/mcp, Host evil.example.com:    HTTP 403
/mcp, Host toolbox.example.com: HTTP 200

PR Checklist

  • Make sure you reviewed CONTRIBUTING.md
  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure you have manually reviewed the entire diff before requesting a review
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

Fixes #486

Adds charts/mcp-toolbox with a chart-managed or existing Secret for tools.yaml, prebuilt tool sets, restricted Pod Security Standard defaults, optional Ingress, HPA and PodDisruptionBudget, and helm-unittest tests.

Anchors the mcp-toolbox binary pattern in .gitignore so it no longer ignores the chart directory.
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Helm chart for deploying the MCP Toolbox for Databases to Kubernetes, including templates for deployment, service, ingress, autoscaling, and security configurations, along with comprehensive unit tests. The review feedback suggests quoting ingress path values to prevent parsing errors, extending the security warning in the release notes to cover ingress-exposed ClusterIP services, and adding support for mounting custom volumes and volume mounts to facilitate database certificate and credential injection.

Comment thread charts/mcp-toolbox/templates/NOTES.txt Resolved
Comment thread charts/mcp-toolbox/values.yaml Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Helm chart for Kubernetes deployment

2 participants

0