Skip to content

feat(k8s): speaker deploy, app settings that survive redeploys, and an accurate k8s guide - #357

Merged
AnkushMalaker merged 8 commits into
SimpleOpenSoftware:devfrom
Ushadow-io:feat/k8s-deploy-tooling
Nov 9, 2026
Merged

AnkushMalaker merged 8 commits into
SimpleOpenSoftware:devfrom
Ushadow-io:feat/k8s-deploy-tooling

Conversation

@thestumonkey

@thestumonkey thestumonkey commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Kubernetes deploy fixes and tooling, used to run Chronicle and speaker recognition on a MicroK8s cluster.

Backend and WebUI

  • One worker fleet: the workers sidecar owns the RQ workers, so the API container no longer starts a second fleet that transcribed every session twice.
  • The WebUI is built for Skaffold from backend/webui/Dockerfile.k8s and served by nginx.
  • The k8s backend image ships Pi. The chart accepts hostAliases.
  • The backend logs in to MongoDB as root. Kubernetes expands $(MONGO_ROOT_PASSWORD) from the Secret, so the password never enters Helm values. config.env.template now lists MONGO_ROOT_PASSWORD.

Settings saved in the app survive a redeploy

  • A ConfigMap is read-only, so the Settings page could not save on k8s. The backend and workers now use CONFIG_DIR=/app/data/config on the data volume, as the bind mount does under Docker Compose.
  • A config-seed init container (backend/src/backend/config_seed.py) fills that folder from the ConfigMap on every pod start:
    • defaults.yml is replaced (code defaults).
    • config.yml and plugins.yml keep every live value and only gain keys that are new in the repository.
  • plugins.yml is now in the ConfigMap.

Speaker recognition

  • make deploy-speaker builds amd64 images on a configurable buildx builder (scripts/k8s/buildx-push.sh, BUILDX_BUILDER), so it works from an arm64 machine.
  • COMPUTE_MODE=cu126 keeps Pascal GPUs (GTX 10xx), which cu128 drops.
  • The backend uses the in-cluster SPEAKER_SERVICE_URL.
  • The speaker WebUI build context includes chronicle-espresso-preset.js.

No machine names in the deploy

  • APP_NODE pins the backend, workers and WebUI (new node chart value). Before, skaffold.yaml pinned them to one named node.
  • TAILSCALE_HOSTNAME and TAILSCALE_PROXY_GROUP make the backend chart create the Tailscale ingress on make deploy, instead of a hand-applied manifest with a fixed hostname.
  • The speaker chart no longer defaults to a named GPU node; SPEAKER_NODE sets it. The unused shared-model node list is removed from skaffold.yaml.
  • An empty value turns each one off.

Makefile

  • make config-k8s regenerates skaffold.env from config.env, and puts config/*.yml into the ConfigMap. The Secret file is written with mode 600.
  • The config scripts take their packages from setup-requirements.txt.
  • deploy-apps and up-backend call deploy-k8s and deploy-docker instead of repeating them. deploy-k8s-full now deploys MongoDB and Redis via setup-infrastructure. deploy-infrastructure (which applied every file in k8s-manifests/) is removed.
  • setup-k8s now finds the registry script in scripts/k8s/.

Docs

  • README-K8S.md is rewritten. The old guide named scripts and files that no longer exist. Known limitations are listed at the end, including the infrastructure profile deploying MongoDB without authentication while the backend now logs in as root.

Test plan

  • uv run --group test pytest tests/test_config_seed.py: 7 passed, on upstream dev
  • helm template of the backend chart: renders with workers as a sidecar, as a separate deployment, and with persistence off
  • helm template with and without node, tailscale.hostname and nodeSelector.hostname: node pins and the Tailscale ingress appear only when set
  • make config-k8s writes the new values to skaffold.env, empty when unset
  • make -n deploy deploy-speaker deploy-k8s-full: runs the expected steps
  • make config-k8s generates the ConfigMap with all three config/*.yml files, the Secret and skaffold.env
  • Speaker recognition deployed with make deploy-speaker and reached from the backend at its in-cluster address
  • Settings change in the WebUI survives make deploy (not yet run on a cluster)

🤖 Generated with Claude Code

thestumonkey and others added 7 commits November 9, 2026 17:04
The backend container's start-k8s.sh started a full worker fleet alongside
the workers sidecar, so both fleets transcribed every session. When the
sidecar is enabled, the backend container now runs only the API, and the
separate workers Deployment is not rendered.

- Mount defaults.yml and config.yml from chronicle-config; drop the mem0 CA
- Use the Recreate strategy for the ReadWriteOnce data volume
- Add a production WebUI image built from the repository root
- Add a Tailnet ingress for the backend and WebUI
- Map speaker image COMPUTE_MODE values to the current uv extras
- Write generated secrets owner-only and ignore generated manifests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The k8s image now carries Node 22.19, Pi 0.85.1 and ripgrep, so Timeline
analysis and the memory agents can run. The backend chart accepts hostAliases
for Tailnet hosts that cluster DNS cannot resolve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tenv

The backend crashlooped on the cluster because the Mongo URI had no
credentials. The URI now takes the password from chronicle-secrets via
Kubernetes $(MONGO_ROOT_PASSWORD) expansion, so it never enters Helm values.

The config generator targets now use `uv run --with python-dotenv`,
because the repo root has no project environment to install it into.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The speaker profile builds amd64 images with a Skaffold custom builder
(scripts/k8s/buildx-push.sh) on a configurable buildx builder, so it works
from an arm64 build machine. COMPUTE_MODE selects the torch build: cu126
keeps Pascal GPUs, which cu128 drops. make config-k8s now regenerates
skaffold.env from config.env, so a stale copy cannot override it. The
backend reaches the service at its in-cluster address. The WebUI build
context now includes chronicle-espresso-preset.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A ConfigMap is read-only, so the Settings page could not save on
Kubernetes. The backend and workers now use CONFIG_DIR on the data volume,
as the shared bind mount does under Docker Compose. A config-seed init
container fills it from the ConfigMap on every pod start: defaults.yml is
replaced, and config.yml and plugins.yml keep every live value, gaining
only keys that are new in the repository. plugins.yml is added to the
ConfigMap for this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deploy-apps and up-backend now call deploy-k8s and deploy-docker instead
of repeating them. deploy-k8s-full deploys MongoDB and Redis through
setup-infrastructure; deploy-infrastructure, which applied every file in
k8s-manifests/, is removed. setup-k8s now finds the registry script in
scripts/k8s/. The config scripts take their packages from
setup-requirements.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guide named scripts and files that no longer exist and an old
skaffold.env workflow. It now follows make setup-k8s, make deploy and make
deploy-speaker, lists the config.env settings and generated files, explains
how app settings survive a redeploy, and records known limitations.
config.env.template gains MONGO_ROOT_PASSWORD, which the backend needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 50a20d09-d514-46af-82f0-0f7235b655f2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

skaffold.yaml pinned the backend and WebUI to one named node, and the
Tailscale ingress was a hand-applied manifest with a fixed hostname and
ProxyGroup. Both now come from config.env:

- APP_NODE pins the backend, workers and WebUI (a new `node` chart value).
- TAILSCALE_HOSTNAME and TAILSCALE_PROXY_GROUP make the backend chart
  create the Tailscale ingress on make deploy. k8s-manifests/
  tailscale-ingress.yaml is removed.
- The speaker chart no longer defaults to a named GPU node; SPEAKER_NODE
  sets it.

An empty value turns each one off. The shared-model node list that
skaffold.yaml passed to the speaker chart is removed: no template read it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnkushMalaker
AnkushMalaker merged commit 0c2a304 into SimpleOpenSoftware:dev Nov 9, 2026
4 of 8 checks passed
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.

2 participants