feat(gitea): replace Bitnami PostgreSQL and Redis with CNPG and Valkey#102
feat(gitea): replace Bitnami PostgreSQL and Redis with CNPG and Valkey#102adamancini wants to merge 3 commits intomainfrom
Conversation
Remove all four Bitnami subchart dependencies (postgresql, postgresql-ha, redis-cluster, redis) from the Gitea Helm chart and replace them with: - PostgreSQL via CloudNativePG operator with an embedded Cluster CR - Valkey (Redis-compatible) via the official valkey-io/valkey-helm subchart Additional changes: - Add CNPG operator and cert-manager as Embedded Cluster extensions - Update EC version to 2.13.3+k8s-1.33, ingress-nginx to 4.14.1 - Replace bitnami/kubectl with registry.k8s.io/kubectl:v1.33.0 - Add KOTS config for Valkey cache settings - Default internal_postgres_enabled to true - Fix deprecated helm.sh/hook: test-success annotation to test - Fix Makefile .SHELLFLAGS for GNU make compatibility - Fix Makefile repo URL quoting for CI environments - Add CI workflow with lint-and-template and helm-install-test jobs - Add Python smoke tests for Gitea HTTP, PostgreSQL, and Valkey - Add Makefile test targets (test-lint, test-install, test-smoke, etc.) - Bump chart version to 11.0.0 Resolves #97
f137b95 to
fcc9da6
Compare
| {{- end -}} | ||
| {{- /* redis queue */ -}} | ||
| {{- /* redis/valkey queue */ -}} | ||
| {{- if or ((index .Values "redis-cluster").enabled) ((index .Values "redis").enabled) -}} |
There was a problem hiding this comment.
if we've removed redis, should we remove this stanza?
There was a problem hiding this comment.
the stanza is for upstream compatibility since we're vendoring the Gitea chart; if we completely remove the redis stanza we'll have to keep removing it on every rebase from upstream — since both redis-cluster.enabled and redis.enabled are false, it falls through to the Valkey branch.
|
@adamancini I found this issue with the release:
# gitea-chart.yaml
#Line 50 | Error: unexpected "\\" in operand
#Error unable-to-render.
HOST: "redis://:repl{{ ConfigOption \"valkey_password\" }}@gitea-valkey:6379/0?pool_size=100&idle_timeout=180s&"Naturally this is causing the Admin Console to fail spinning up:
|
fixt |
…OTS chart KOTS processes files as Go templates before YAML parsing. The backslash-escaped quotes inside double-quoted YAML strings (\"valkey_password\") are invalid Go template syntax, causing "unexpected \\ in operand" errors that prevent Admin Console from rendering. Switch to single-quoted YAML strings so the inner double quotes pass through the Go template parser cleanly.
scottrigby
left a comment
There was a problem hiding this comment.
nice work @adamancini
good questions @jmboby. appreciated reading Ada's answers
I would have also asked the redis string one. making merging easier as Ada said makes sense.
lgtm
| enabled: true | ||
| instances: 1 | ||
| image: | ||
| repository: ghcr.io/cloudnative-pg/postgresql |



Summary
valkey-io/valkey-helmchart as a subchartgitea.config.database.*andgitea.config.cache/session/queue.*bitnami/kubectlimage withregistry.k8s.io/kubectl:v1.33.0internal_postgres_enabledtotrue(aligns with Valkey which already defaults true)helm.sh/hook: test-successannotation totestgitea-ci.yml) with lint-and-template and helm-install-test jobstest-lint,test-install-operators,test-install,test-smoke,test-all)Motivation
Bitnami is transitioning to a paid Broadcom subscription model after September 2025. Rather than forking/modifying the upstream Gitea chart templates, this disables the Bitnami subcharts and wires Gitea to operator-managed PostgreSQL and Valkey. The Gitea chart's
_helpers.tplalready supports this — when subchart conditions are false, explicitgitea.config.*values take precedence.External database support
The chart supports both embedded (CNPG) and external PostgreSQL. When
postgres.embedded.enabled: false, no CNPG Cluster CR is created and Gitea connects to whatevergitea.config.database.HOSTpoints to. The KOTS config exposespostgres_hostas a user-editable field for this purpose.Test plan
helm dependency update charts/gitearesolves Valkey, no Bitnamihelm lint charts/giteapasseshelm template gitea charts/gitea --debugrenders CNPG Cluster CR, Valkey subchart, and correct Gitea connection stringsgitea.config.database.HOST,cache.HOST,session.PROVIDER_CONFIG,queue.CONN_STRall point to correct servicesmake package-and-updatepackages chart as gitea-11.0.0.tgzregistry.k8s.io/kubectl:v1.33.0resolves correctly (v prefix required)Review feedback addressed
vprefix (v1.33.0not1.33.0) — fixed in 84f19d6helm install, users can pre-install the operator or point to an external database.Resolves #97