-
Notifications
You must be signed in to change notification settings - Fork 32
Add integrations-hub Helm chart for Kubernetes deployment #614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c4e55d0
Add integrations-hub Helm chart for Kubernetes deployment
openhands-agent f840986
Update integrations-hub Helm chart for Python/FastAPI backend
openhands-agent 50f4176
Update chart version.
chuckbutkus 9e0d95c
Merge branch 'main' into add-integrations-hub-chart
chuckbutkus b0e8821
Add migration initContainer to integrations-hub deployment
openhands-agent 306c98c
feat: Set default admin emails for integrations-hub
openhands-agent 638ff46
Align integrations-hub chart env vars with the development branch bac…
openhands-agent 00d8d64
Merge branch 'main' into add-integrations-hub-chart
chuckbutkus 0a4b137
Update chart version
chuckbutkus 5bdc1ea
Pin umbrella's integrations-hub dep to local sibling version 0.1.0
openhands-agent ab5a810
Mount integrations-hub under a configurable sub-path (default /integr…
openhands-agent fdf1a39
Merge branch 'main' into add-integrations-hub-chart
chuckbutkus 625fc94
Update chart version
chuckbutkus 4e66120
Avoid exposing integrations DB password in args
openhands-agent 63cfc3b
Merge branch 'main' into add-integrations-hub-chart
chuckbutkus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| apiVersion: v2 | ||
|
chuckbutkus marked this conversation as resolved.
|
||
| name: integrations-hub | ||
| description: OpenHands Integrations Hub - Agent context layer with managed connectors and MCP integrations | ||
| type: application | ||
| version: 0.1.0 | ||
| appVersion: "0.1.0" | ||
| dependencies: | ||
| - name: postgresql | ||
| version: 15.x.x | ||
| repository: https://charts.bitnami.com/bitnami | ||
| condition: postgresql.enabled | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,192 @@ | ||
| {{- /* | ||
| Environment variables consumed by the Integrations Hub backend | ||
| (Python/FastAPI on the `development` branch of OpenHands/integrations-hub). | ||
|
|
||
| The backend reads its config in backend/app/config.py using the prefix | ||
| `INTHUB_*`, with legacy unprefixed fallbacks for backwards compatibility: | ||
|
|
||
| INTHUB_POSTGRES_URL fallback: POSTGRES_URL, DATABASE_URL | ||
| INTHUB_DISABLE_AUTH (bool, defaults to false) | ||
| INTHUB_OPENHANDS_BASE_URL fallback: OPENHANDS_BASE_URL | ||
| INTHUB_OPENHANDS_AUTH_COOKIE_NAME fallback: OPENHANDS_AUTH_COOKIE_NAME | ||
| INTHUB_INTERNAL_AUTH_SECRET fallback: INTERNAL_AUTH_SECRET, AUTH_SECRET, NEXTAUTH_SECRET | ||
| INTHUB_CRON_SECRET fallback: CRON_SECRET | ||
| APP_ADMIN_EMAILS (use the unprefixed name; the prefixed | ||
| form is JSON-decoded by the SDK env | ||
| parser and would require list syntax) | ||
| INTHUB_CREDENTIAL_ENCRYPTION_KEY fallback: CREDENTIAL_ENCRYPTION_KEY | ||
| INTHUB_STATIC_DIR set in the Dockerfile to /app/out | ||
| INTHUB_ROOT_PATH sub-path mount; defaulted by the | ||
| Dockerfile to /integrations-hub and | ||
| overridable via .Values.rootPath | ||
|
|
||
| In addition, backend/app/oauth_flow.py reads: | ||
| AUTH_REDIRECT_PROXY_URL stable origin for OAuth callback proxy | ||
| AUTH_URL / NEXTAUTH_URL preview-deployment callback target | ||
| */}} | ||
| {{- define "integrations-hub.env.defaults" }} | ||
| # Database connection -- backend reads INTHUB_POSTGRES_URL first; we build | ||
| # it from the configured host/port/user/db plus the password secret using | ||
| # Kubernetes $(VAR_NAME) expansion. If .Values.database.url is set it wins. | ||
| {{- if .Values.database.url }} | ||
| - name: INTHUB_POSTGRES_URL | ||
| value: {{ .Values.database.url | quote }} | ||
| {{- else }} | ||
| - name: INTHUB_DB_HOST | ||
| value: {{ .Values.database.host | quote }} | ||
| - name: INTHUB_DB_PORT | ||
| value: {{ .Values.database.port | quote }} | ||
| - name: INTHUB_DB_USER | ||
| value: {{ .Values.database.user | quote }} | ||
| - name: INTHUB_DB_NAME | ||
| value: {{ .Values.database.name | quote }} | ||
| - name: INTHUB_DB_PASS | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.database.secretName }} | ||
| key: {{ .Values.database.secretKey }} | ||
| - name: INTHUB_POSTGRES_URL | ||
| value: "postgresql://$(INTHUB_DB_USER):$(INTHUB_DB_PASS)@$(INTHUB_DB_HOST):$(INTHUB_DB_PORT)/$(INTHUB_DB_NAME)" | ||
| {{- end }} | ||
|
|
||
| # OpenHands identity provider used to validate session cookies / API keys. | ||
| {{- $openhandsBaseUrl := .Values.openhands.baseUrl }} | ||
| {{- if and (not $openhandsBaseUrl) .Values.global }} | ||
| {{- if .Values.global.ingress }} | ||
| {{- if .Values.global.ingress.host }} | ||
| {{- $host := .Values.global.ingress.host }} | ||
| {{- if and .Values.global.ingress.prefixWithBranch .Values.global.branchSanitized }} | ||
| {{- $host = printf "%s.%s" .Values.global.branchSanitized .Values.global.ingress.host }} | ||
| {{- end }} | ||
| {{- $openhandsBaseUrl = printf "https://%s" $host }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if $openhandsBaseUrl }} | ||
| - name: INTHUB_OPENHANDS_BASE_URL | ||
| value: {{ $openhandsBaseUrl | quote }} | ||
| {{- end }} | ||
| {{- if .Values.openhands.authCookieName }} | ||
| - name: INTHUB_OPENHANDS_AUTH_COOKIE_NAME | ||
| value: {{ .Values.openhands.authCookieName | quote }} | ||
| {{- end }} | ||
|
|
||
| # Local-dev auth bypass. Defaults to false; the FastAPI app will reject | ||
| # non-loopback requests when this is true, so it should never be enabled | ||
| # in staging/production. | ||
| - name: INTHUB_DISABLE_AUTH | ||
| value: {{ .Values.disableAuth | default false | quote }} | ||
|
|
||
| # Sub-path mount for the FastAPI app. The Dockerfile already defaults | ||
| # INTHUB_ROOT_PATH to /integrations-hub so the image works behind the | ||
| # default ingress out of the box; this block re-emits the value so chart | ||
| # overrides flow through. Rendered unconditionally (including when | ||
| # .Values.rootPath is "") so that an empty override actually clears the | ||
| # image default instead of silently inheriting it. | ||
| - name: INTHUB_ROOT_PATH | ||
| value: {{ .Values.rootPath | default "" | quote }} | ||
|
|
||
| # Credential encryption key (required: signs/encrypts stored OAuth tokens | ||
| # and other provider secrets at rest). | ||
| - name: INTHUB_CREDENTIAL_ENCRYPTION_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.credentialEncryption.secretName }} | ||
| key: {{ .Values.credentialEncryption.secretKey }} | ||
|
|
||
| # Internal service-to-service secret. Optional in SPA-only K8s deployments | ||
| # (the backend validates the OpenHands session cookie directly when no | ||
| # Next.js proxy is in front of it) but required if any internal caller | ||
| # attaches the X-Integrations-Hub-Internal-Secret header. | ||
| {{- if and .Values.auth .Values.auth.internalSecretName }} | ||
| - name: INTHUB_INTERNAL_AUTH_SECRET | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.auth.internalSecretName }} | ||
| key: {{ .Values.auth.internalSecretKey | default "internal-auth-secret" }} | ||
| {{- end }} | ||
|
|
||
| # Admin allowlist for /api/admin/* routes. Use the unprefixed name -- | ||
| # INTHUB_APP_ADMIN_EMAILS goes through the SDK env parser which expects | ||
| # JSON list syntax. | ||
| {{- if .Values.admin.emails }} | ||
| - name: APP_ADMIN_EMAILS | ||
| value: {{ .Values.admin.emails | quote }} | ||
| {{- end }} | ||
|
|
||
| # Cron secret -- required by /api/cron/expire-grants. | ||
| - name: INTHUB_CRON_SECRET | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.cron.secretName }} | ||
| key: {{ .Values.cron.secretKey }} | ||
|
|
||
| # OAuth preview-deployment proxy (optional). When set, service OAuth | ||
| # callbacks register/exchange against the stable origin and then forward | ||
| # back to the preview deployment captured in OAuth state. | ||
| {{- if .Values.openhands.redirectProxyUrl }} | ||
| - name: AUTH_REDIRECT_PROXY_URL | ||
| value: {{ .Values.openhands.redirectProxyUrl | quote }} | ||
| {{- end }} | ||
| {{- if .Values.openhands.authUrl }} | ||
| - name: AUTH_URL | ||
| value: {{ .Values.openhands.authUrl | quote }} | ||
| {{- end }} | ||
|
|
||
| {{- if .Values.datadog.enabled }} | ||
| # Datadog APM | ||
| - name: DD_AGENT_HOST | ||
| value: "datadog-agent.all-hands-system.svc.cluster.local" | ||
| - name: DD_TRACE_AGENT_PORT | ||
| value: "8126" | ||
| - name: DD_SERVICE | ||
| value: {{ .Values.datadog.serviceName | quote }} | ||
| - name: DD_ENV | ||
| value: {{ .Values.datadog.env | quote }} | ||
| - name: DD_TRACE_ENABLED | ||
| value: "true" | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| integrations-hub.env — Deduplicated environment variable list. | ||
|
|
||
| This wrapper renders the default env vars from "integrations-hub.env.defaults", | ||
| then removes any entries whose name conflicts with a key in .Values.env, | ||
| and finally appends the .Values.env overrides. The result is a clean list | ||
| with no duplicate names, which prevents: | ||
| - Helm warnings about duplicate env vars | ||
| - Strategic Merge Patch conflicts during helm upgrade | ||
| ("The order in patch list doesn't match $setElementOrder list") | ||
|
|
||
| How it works: | ||
| 1. Render "integrations-hub.env.defaults" via include (evaluates all conditionals) | ||
| 2. Parse the rendered YAML list into Go objects with fromYamlArray | ||
| 3. Filter out any default entries whose name appears in .Values.env | ||
|
chuckbutkus marked this conversation as resolved.
|
||
| 4. Append .Values.env entries (user overrides always win) | ||
| 5. Re-render the deduplicated list with toYaml | ||
| */}} | ||
| {{- define "integrations-hub.env" }} | ||
| {{- $defaults := include "integrations-hub.env.defaults" . | fromYamlArray }} | ||
| {{- /* Build a lookup dict of override keys for O(1) membership checks */}} | ||
| {{- $overrideKeys := dict }} | ||
| {{- if .Values.env }} | ||
| {{- range $key, $_ := .Values.env }} | ||
| {{- $_ := set $overrideKeys $key true }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- /* Keep only default entries that are NOT overridden by .Values.env */}} | ||
| {{- $filtered := list }} | ||
| {{- range $entry := $defaults }} | ||
| {{- if not (hasKey $overrideKeys (get $entry "name")) }} | ||
| {{- $filtered = append $filtered $entry }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- /* Append user overrides from .Values.env (these take precedence) */}} | ||
| {{- if .Values.env }} | ||
| {{- range $key, $value := .Values.env }} | ||
| {{- $filtered = append $filtered (dict "name" $key "value" ($value | toString)) }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
chuckbutkus marked this conversation as resolved.
|
||
| {{- $filtered | toYaml }} | ||
| {{- end }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 Important - Missing Documentation: No README.md for the new chart.
Helm charts should include a README.md with:
This is especially important for a new chart where users need guidance on the GCP vs non-GCP configurations, secret creation, and the
rootPath/NEXT_PUBLIC_BASE_PATHcoordination.