Skip to content

feat(deploy): run joinly beside the broker on Kubernetes, as a sidecar - #596

Merged
amahpour merged 2 commits into
mainfrom
feat/k8s-joinly
Nov 4, 2026
Merged

amahpour merged 2 commits into
mainfrom
feat/k8s-joinly

Conversation

@amahpour

@amahpour amahpour commented Nov 4, 2026

Copy link
Copy Markdown
Owner

The maintainer asked how meetings (#573) run on their EKS setup, and approved running joinly as a sidecar (#591). Until now, [meeting] joinly_url could be set only in config.toml on the broker's volume, which a manifest (or Argo) can't write.

What it does

  • SWITCHBOARD_JOINLY_URL sets [meeting] joinly_url from the environment. A non-empty value wins over the file, as SWITCHBOARD_HUMAN_NAME does. It goes through the same check as the key (http or https, 300 characters at most, no user name or password).
    • An invalid value stops startup with an error that names the variable and doesn't echo the value. It is never silently ignored, because that would turn /meeting off without a word.
    • The "No meeting server is set" hint now names both ways to set it.
  • deploy/kubernetes/meetings/joinly.yaml is a strategic-merge patch of the example StatefulSet that adds joinly as a second container in the broker's pod:
    • Private. JOINLY_SERVER_HOST=127.0.0.1, because the image defaults to 0.0.0.0. It has no containerPort and no Service, so nothing in the cluster but the broker beside it reaches it. No NetworkPolicy is needed.
    • Locked down. It runs as the image's uid 1001 (the speech models live in its 0700 home), with a read-only root, every capability dropped, no privilege escalation and the pod's RuntimeDefault seccomp. Only /tmp is writable (2 GiB), and XDG_CONFIG_HOME=/tmp gives PulseAudio somewhere to write. Each relaxation is commented with what failed without it.
    • Resources: requests of 1 CPU and 2 GiB, a 4 GiB memory limit, no CPU limit, and a memory-backed /dev/shm.
    • Probes: startup and liveness run as exec with the image's Python against /health, since a localhost-bound joinly can't be reached by an httpGet probe. There is no readinessProbe on purpose: a slow joinly must not take the broker out of its Service.
    • kubectl.kubernetes.io/default-container: switchboard, so kubectl logs and exec (the one-time password, switchboard login) still reach the broker by default.
  • deploy/kubernetes/meetings/joinly-zoom-fix.yaml, a second patch, mounts the pinned Zoom speaker-name fix (fix: zoom active speaker in the single-video layout, and the participants button joinly-ai/joinly#187) from a ConfigMap. It is a separate patch because a subPath mount of a missing ConfigMap fails the container even when marked optional.
  • Applying it: kubectl patch --patch-file, or kustomize under Argo or Flux (resources: [switchboard.yaml], patches: [...], and a configMapGenerator for zoom.py). The patches live in meetings/ so that a GitOps tool reading deploy/kubernetes/ doesn't take them for a second StatefulSet.

Previews

Nothing visible changes in the web UI.

Verification

On a local kind cluster (kind v0.33.0, kubectl v1.37.2, with the maintainer's yes to install them). The cluster was deleted afterwards.

$ kubectl get pod switchboard-0            -> 2/2 Running, 0 restarts
broker: SWITCHBOARD_JOINLY_URL=http://127.0.0.1:8000/mcp/ -> [meeting] joinly_url -> http://127.0.0.1:8000/mcp/
$ kubectl exec switchboard-0 -c switchboard -- python3 -c '...urlopen("http://127.0.0.1:8000/health")...'
{"status":"healthy"}
MCP session from the broker container: tools listed; Chromium started (invalid meeting code; no real meeting joined)
second pod -> <pod-ip>:7419/healthz : ok                          (control)
second pod -> <pod-ip>:8000/health  : Connection refused          (joinly is private)
$ grep -c single-main-container__video-frame <zoom.py in the joinly container>
1     (the pinned fix is the file loaded; the mount is read-only)
joinly container: uid=1001 CapEff=0 NoNewPrivs=1 Seccomp=2; touch /app/x -> Read-only file system

The test copy also set enableServiceLinks: false. Without it the base manifest crash-loops on any cluster, which is #595, fixed in its own pull request.

Tests:

  • New in tests/unit/test_config.py: the variable is used, beats the file, and fails startup on a bad value; an empty or unset one leaves the file's value.
  • New in tests/unit/test_deploy_joinly.py: six guards on the patch (the localhost host, no port, exec probes, no readinessProbe, uid 1001, read-only root, a memory-backed shm, a pinned tag). The patch was mutated eight ways, and each mutation failed its guard.
  • tests/integration/test_meetings.py: the hint.
$ uv run pytest -q -n auto
3283 passed, 65 skipped in 103.87s (0:01:43)
$ uv run python scripts/lint.py        # exit 0
$ uv run --group docs zensical build --strict
No issues found

Docs

Searched *.md for joinly_url, joinly and Kubernetes.

  • DEPLOY.md: the environment table, "A meeting bot", and a new "Meetings on Kubernetes" section (the sidecar and why, resources, egress, the 3.7 GB first pull, the Zoom fix, Argo with kustomize, how to check it).
  • DESIGN.md: §2 and §52.
  • The rest: USAGE.md, the meetings guide (Set it up, Troubleshooting, Reference), SECURITY.md, and changes/k8s-joinly.md.

Closes #591

🤖 Generated with Claude Code

amahpour and others added 2 commits November 4, 2026 13:21
deploy/kubernetes/meetings/ patches the StatefulSet with joinly on the
pod's localhost only (no Service, no port), as uid 1001 with a read-only
root, no capabilities and /tmp writable, and a second patch mounts the
pinned Zoom speaker-name fix from a ConfigMap. SWITCHBOARD_JOINLY_URL sets
[meeting] joinly_url from the manifest. Verified on a kind cluster.

Closes #591

Co-Authored-By: Claude Opus 5.5 <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.

deploy: run joinly beside the broker on Kubernetes (EKS), as a sidecar

1 participant