One chart whose values.yaml is a near-literal transcription of infra/docker-compose.yml, rendered by three generic templates (Deployment, Job, Service) over a `workloads` map — so the two stacks can be diffed by eye instead of by archaeology, and adding a service is a values edit. Platform-forced deviations, each commented where it appears: - `args`, never `command`: compose replaces the image CMD, Kubernetes replaces the ENTRYPOINT. The chart fails to render on `command`, because the symptom (postgres refusing to run as root, Keycloak exec-ing `start-dev`) is nothing like the cause. - The four Django services apply their own setup_configuration in the web pod rather than in a separate init Job: both scripts migrate, and without compose's depends_on they race the same database. - OpenZaak and Objecten are addressed by service FQDN, because Django rejects a single-label host in a URL — the reason compose passes container IPs around. - NodePorts, no ingress; databases are emptyDir until persistence.storageClass is set, so the stack comes up on a cluster with no CSI driver. The upstream config inputs stay in the repo and become ConfigMaps via infra/helm/seed-configmaps.sh — the Kubernetes sibling of infra/seed-config.sh — so the compose stack and the chart cannot fork. infra/helm/registry.yaml runs an in-cluster registry because Talos cannot side-load an image and a laptop-side one needs a root-level firewall change.
30 lines
970 B
YAML
30 lines
970 B
YAML
{{- /*
|
|
The one-shot bootstrap containers from compose (oz-init, nrc-init, flowable-init,
|
|
the *-init setup_configuration runs, the zaaktype seed and the NRC abonnement)
|
|
become Jobs. All of them are idempotent, so ordering is not enforced with hooks:
|
|
each waits for the ports it needs (waitFor) and Kubernetes retries the rest.
|
|
A wiped database is re-seeded by `make k8s-reseed`.
|
|
*/ -}}
|
|
{{- range $name, $w := .Values.workloads }}
|
|
{{- if and (ne $w.enabled false) $w.job }}
|
|
---
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: {{ $name }}
|
|
labels:
|
|
{{- include "big.labels" (dict "root" $ "name" $name) | nindent 4 }}
|
|
app.kubernetes.io/component: init
|
|
spec:
|
|
backoffLimit: 20
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "big.labels" (dict "root" $ "name" $name) | nindent 8 }}
|
|
app.kubernetes.io/component: init
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
{{- include "big.podspec" (dict "root" $ "name" $name "w" $w) | nindent 6 }}
|
|
{{- end }}
|
|
{{- end }}
|