Skip to content

A Helm chart runs the server with one replica on its own volume - #1552

Open
gedaiu wants to merge 1 commit into
deeplethe:devfrom
re-cinq:feat/helm-chart-core-1516
Open

gedaiu wants to merge 1 commit into
deeplethe:devfrom
re-cinq:feat/helm-chart-core-1516

Conversation

@gedaiu

@gedaiu gedaiu commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Thank you for welcoming the chart, and for the clear constraints on #1516. This is the first of the three PRs: the core chart under deploy/chart and a CI check.

The chart runs one replica with a Recreate rollout on a single ReadWriteOnce volume for the data directory. The image is ghcr.io/deeplethe/utopia with the tag taken from appVersion, which is 0.1.0-rc9 like the docker-compose.yml default. By default it uses an external Postgres, through a Secret you name or URLs the chart writes into one. CloudNativePG is an optional mode, off by default, that creates the database with pgvector and the utopia_app role before the first migration. For an external database the README shows the SQL to create utopia_app the way docker/init-app-role.sh does. The Ingress is off by default, and the README says the chart is community-maintained.

A new chart job in CI runs helm lint in both database modes and checks that appVersion matches the compose image tag.

Two small choices you may want to change. The pod runs as uid 1000 with a read-only root filesystem, which is how we have run this image on our cluster for a while, though compose runs it as root. And a render with no database settings fails on purpose rather than producing a chart that cannot start. Network policies and the other optional parts will follow in the next two PRs.

Part of #1516

@gedaiu

gedaiu commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

@WaylandYang the core chart from #1516 is ready for a look whenever suits you. The network policies and optional parts will follow once this one is in shape. Thank you!

@WaylandYang WaylandYang 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.

Thanks, this matches what we agreed in #1516 closely: deploy/chart, one replica with Recreate and RWO, the image tag tied to compose, external Postgres with CloudNativePG optional, and community-maintained in the README. A few things before it merges:

  1. CI doesn't check the intended failure. helm lint treats a missing required value as information only, so the no-settings lint passes and nothing verifies that an unconfigured render fails. Could the job add helm template steps (one with minimal values that must succeed, one with none that must fail), and ideally kubeconform on the output?
  2. The CNPG password is regenerated under GitOps. It comes from lookup (templates/database.yaml:30), which returns nothing under helm template, --dry-run, Argo CD and Flux, so the role password is rebuilt on every render. Please accept an existing Secret (database.cnpg.existingSecret or similar), or at least document it.
  3. CNPG image. ghcr.io/cloudnative-pg/postgresql:16-bookworm is the legacy tag. pgvector is only guaranteed in the -standard- images, so please default to 16-standard-bookworm, pinned to a minor version.
  4. README notes:
    • The pod runs as uid 1000 but compose runs as root, so a data directory moved from compose is root-owned and not writable.
    • With ingress.tlsSecretName set, UTOPIA_COOKIE_SECURE should be true. Setting it automatically when TLS is on would be even better.

@gedaiu
gedaiu force-pushed the feat/helm-chart-core-1516 branch from 7e5b3e2 to 1ce4e3b Compare December 2, 2026 11:26
@gedaiu

gedaiu commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@WaylandYang thank you for the careful review, these were all good catches.

  1. The chart job now runs helm template too. A render without settings must fail with the "database.url or database.existingSecret is required" message. Four setups, both database modes included, go through a pinned kubeconform 0.8.0 with -strict. The CloudNativePG Cluster is checked against its schema from a pinned commit of datreeio/CRDs-catalog. If you'd rather not depend on that catalog, -ignore-missing-schemas is a one-line swap.
  2. There is now database.cloudnativepg.existingSecret for GitOps, and the README explains why the generated password only holds with lookup.
  3. The default image is 16.16-standard-bookworm.
  4. The README covers chowning a compose data directory to 1000:1000 before moving it. UTOPIA_COOKIE_SECURE is set to true automatically when ingress.tlsSecretName is set, with ingress.cookieSecure to override it. The server already turns Secure on by itself when the proxy sends X-Forwarded-Proto: https, so this covers proxies that don't.

Thanks again!

@WaylandYang WaylandYang 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.

Thanks, everything is addressed, and the image tag and the secure cookie look right. One small gap left in CI:

"Render and validate" can miss a failed render. It pipes helm template into kubeconform, and the default shell has no pipefail, so only kubeconform's exit code counts. Please add set -o pipefail at the top of that step. Then it's ready.

…nst your own Postgres or a CloudNativePG one

Signed-off-by: Bogdan Szabo <bogdan@re-cinq.com>
@gedaiu
gedaiu force-pushed the feat/helm-chart-core-1516 branch from 1ce4e3b to cb0117c Compare December 3, 2026 07:48
@gedaiu

gedaiu commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@WaylandYang thank you for catching that! set -o pipefail is now at the top of the step, and the branch is rebased onto the latest dev.

@WaylandYang WaylandYang 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.

Thanks, this is good to merge. Because each merge puts your other branches behind dev, we'll bring the approved PRs in together through one combined PR, with one commit per PR credited to you. No more rebases needed on this one.

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