Skip to content

feat: add Helm chart for hub/broker Kubernetes deployment#146

Draft
nissessenap wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
nissessenap:helm
Draft

feat: add Helm chart for hub/broker Kubernetes deployment#146
nissessenap wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
nissessenap:helm

Conversation

@nissessenap
Copy link
Copy Markdown
Contributor

@nissessenap nissessenap commented Apr 13, 2026

Summary

  • Adds a Helm chart at charts/scion/ for deploying the hub/broker to Kubernetes, supporting two modes: hub (default, co-located hub+broker+web) and broker (standalone broker connecting to an external hub)
  • Adds .github/workflows/publish-chart.yml to package and push the chart as an OCI artifact to oci://ghcr.io/googlecloudplatform/scion/charts/scion on tag push
  • Includes a settings-configmap + init container workaround for scion server start requiring image_registry even in hub mode (see note below)

Stupid AI created a PR, this is far from done.

@google-cla
Copy link
Copy Markdown

google-cla Bot commented Apr 13, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@nissessenap nissessenap marked this pull request as draft April 13, 2026 05:05
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

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 the Scion AI agent orchestration platform, supporting both hub and broker deployment modes with templates for deployments, services, ingress, RBAC, and persistence. The review feedback identifies several necessary improvements to ensure functional parity and operational reliability. Key suggestions include correctly setting the hub endpoint environment variable in broker mode, adding a checksum for the settings ConfigMap to the pod annotations to ensure restarts on configuration updates, and making the hardcoded busybox init container image configurable. Additionally, the reviewer recommends enabling health probes for the broker process and implementing the mounting logic for the currently unused credentials secret.

Comment on lines +40 to +42
{{- with .Values.imageRegistry }}
SCION_IMAGE_REGISTRY: {{ . | quote }}
{{- end }}
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.

high

In broker mode, the broker needs to know the endpoint of the external hub it should connect to. The SCION_HUB_ENDPOINT environment variable (referenced in pkg/config/settings.go) should be set from .Values.broker.hubEndpoint when the mode is set to broker.

  {{- with .Values.imageRegistry }}
  SCION_IMAGE_REGISTRY: {{ . | quote }}
  {{- end }}
  {{- if eq .Values.mode "broker" }}
  {{- with .Values.broker.hubEndpoint }}
  SCION_HUB_ENDPOINT: {{ . | quote }}
  {{- end }}
  {{- end }}

template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
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.

medium

The pod annotations checksum currently only monitors configmap.yaml. It should also include settings-configmap.yaml to ensure that the pod is automatically recreated if the imageRegistry or other settings in that ConfigMap are updated.

        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
        checksum/settings: {{ include (print $.Template.BasePath "/settings-configmap.yaml") . | sha256sum }}

Comment thread charts/scion/templates/deployment.yaml Outdated
{{- end }}
initContainers:
- name: init-settings
image: busybox:1.37
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.

medium

The busybox image used for the init-settings container is hardcoded. It is a best practice in Helm charts to make all images configurable via values.yaml to support air-gapped environments or organizations using internal image mirrors.

          image: {{ .Values.busyboxImage | default "busybox:1.37" }}

Comment on lines +143 to +160
{{- if eq .Values.mode "hub" }}
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /readyz
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
{{- end }}
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.

medium

Health probes are currently restricted to hub mode. However, the broker process also exposes /healthz and /readyz endpoints (as seen in pkg/runtimebroker/server.go). Probes should be enabled for broker mode as well, targeting the broker port (default 9800).

          {{- if or (eq .Values.mode "hub") (eq .Values.mode "broker") }}
          livenessProbe:
            httpGet:
              path: /healthz
              port: {{ if eq .Values.mode "hub" }}http{{ else }}broker{{ end }}
            initialDelaySeconds: 10
            periodSeconds: 15
            timeoutSeconds: 5
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /readyz
              port: {{ if eq .Values.mode "hub" }}http{{ else }}broker{{ end }}
            initialDelaySeconds: 5
            periodSeconds: 10
            timeoutSeconds: 5
            failureThreshold: 3
          {{- end }}

Comment thread charts/scion/values.yaml
nickname: ""

# -- For broker-only mode: K8s Secret containing broker-credentials.json
credentialsSecret: ""
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.

medium

The credentialsSecret value is defined here but is not used anywhere in the deployment templates. If this is intended to provide the broker-credentials.json file for HMAC authentication when connecting to a hub, it should be mounted as a volume in the scion container at /home/nonroot/.scion/broker-credentials.json.

Add a Helm chart at charts/scion/ that supports two deployment modes:
- hub (default): co-located hub + broker + web UI with SQLite persistence
- broker: standalone broker connecting to an external hub

The chart includes Deployment (Recreate strategy for SQLite safety),
Service, Ingress, PVC, ServiceAccount, RBAC (Role or ClusterRole for
agent pod management), ConfigMap for env var configuration, and a
settings-configmap with an init container to seed ~/.scion/settings.yaml
(workaround for server start requiring image_registry even when running
as a hub — see inline comment).

Also adds .github/workflows/publish-chart.yml to package and push the
chart as an OCI artifact to ghcr.io on tag push.

Tested on a kind cluster: helm install succeeds, health probes pass,
helm upgrade rolls cleanly.

Ref: GoogleCloudPlatform#133

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant