FIRST PASS - renders and lints, but has NOT been installed on a cluster. See #3898. Needs a real deploy and an upgrade test from 0.2.x before merge. The chart deployed checkmate-client, checkmate-backend and checkmate-mongo, none of which CI publishes any more. Chart.yaml pinned appVersion to v3.8.1 with a comment explaining the chart could not be bumped until it moved to the all-in-one image. This does that move. Structure. The application image serves the client and the API from one origin, so the separate client deployment, service, nginx ConfigMap and ingress are removed and templates/api/ becomes templates/app/. One ingress now routes / to the app rather than one routing / to nginx and another routing /api/v1 to the API - which also drops the CORS annotations, since the browser is same-origin. MongoDB moves to upstream mongo:8.0, matching docker/docker-compose.yaml. Environment. UPTIME_APP_API_BASE_URL and UPTIME_APP_CLIENT_HOST are gone; the server stopped reading them. CLIENT_HOST is derived from the app's own ingress, and is omitted from `env` when secrets.CLIENT_HOST is set, because `env` takes precedence over `envFrom` and would otherwise discard the override silently. Back-compat. checkmate.app merges any legacy client/api/server block over the app defaults, so most values files upgrade unedited. client.image and client.tag are deliberately not inherited - that repo is unpublished, and honouring it would pin an install to an unpullable image. checkmate.api is kept as an alias. Two upgrade cases fail loudly instead of deploying something wrong: a set client.image, and client/api ingress hosts that differ (one origin cannot serve both). Worker is unchanged in shape - still opt-in, still the same image as the app, still deriving QUEUE_PRIMARY_PROCESSES. It referenced .Values.client.protocol, which no longer exists; rendering with worker.enabled=true caught that nil pointer. Verified with helm lint and helm template across: defaults, worker enabled, worker plus KEDA autoscaling, each of the three legacy value blocks, the two new guards, the change_me guard, and the CLIENT_HOST override. No checkmate-client, checkmate-backend, checkmate-mongo or UPTIME_APP_* strings remain in rendered output. Not done: INSTALLATION.md has a new migration section but its body still documents the two-tier layout in places, and no cluster test has been run. Claude-Session: https://claude.ai/code/session_01AbYLvwpEaZFXktHVcqrFRd
51 lines
2.6 KiB
YAML
51 lines
2.6 KiB
YAML
{{- $app := include "checkmate.app" . | fromYaml -}}
|
|
{{- if eq $app.ingress.host "change_me" }}
|
|
{{- fail "app.ingress.host must be overridden and not set to 'change_me'" }}
|
|
{{- end }}
|
|
|
|
{{- $protocol := $app.protocol }}
|
|
{{- if not (or (eq $protocol "http") (eq $protocol "https")) }}
|
|
{{- fail "app.protocol must be either 'http' or 'https'" }}
|
|
{{- end }}
|
|
|
|
{{/* Enforce protocol when TLS is enabled to avoid mixed-content */}}
|
|
{{- if and $app.ingress.tls.enabled (ne $protocol "https") }}
|
|
{{- fail "app.ingress.tls.enabled is true but app.protocol is not 'https'. Set app.protocol: https to avoid mixed content." }}
|
|
{{- end }}
|
|
|
|
{{/* Fail early if TLS enabled without cert-manager annotations (cluster-issuer or issuer) */}}
|
|
{{- $ann := $app.ingress.annotations | default dict }}
|
|
{{- $hasIssuer := or (hasKey $ann "cert-manager.io/cluster-issuer") (hasKey $ann "cert-manager.io/issuer") }}
|
|
|
|
{{- if and $app.ingress.tls.enabled (not $hasIssuer) }}
|
|
{{- fail "app.ingress.tls.enabled is true but no cert-manager issuer annotation found. Add 'cert-manager.io/cluster-issuer' or 'cert-manager.io/issuer'." }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Upgrade guard. The client and API are one service now, so a values file that still
|
|
points the two at different hosts cannot be honoured — fail loudly rather than
|
|
silently dropping one of them.
|
|
*/}}
|
|
{{- if and .Values.client .Values.api }}
|
|
{{- $clientHost := (.Values.client.ingress | default dict).host }}
|
|
{{- $apiHost := (.Values.api.ingress | default dict).host }}
|
|
{{- if and $clientHost $apiHost (ne $clientHost $apiHost) }}
|
|
{{- fail (printf "client.ingress.host (%s) and api.ingress.host (%s) differ, but Checkmate now serves the client and the API from one origin. Set a single app.ingress.host instead." $clientHost $apiHost) }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
The client image is no longer published. Point this out rather than letting the
|
|
install fail later on an ImagePullBackOff nobody can action.
|
|
*/}}
|
|
{{- if and .Values.client .Values.client.image }}
|
|
{{- fail "client.image is set, but the separate client image is no longer published. Remove the client block; the application image in app.image now serves the client." }}
|
|
{{- end }}
|
|
|
|
{{/* Worker grace period must exceed the server drain timeout (25s) or workers are SIGKILLed mid-drain */}}
|
|
{{- if and .Values.worker.enabled (le (int .Values.worker.terminationGracePeriodSeconds) 25) }}
|
|
{{- fail "worker.terminationGracePeriodSeconds must be greater than 25 (the server drain timeout) or workers are killed mid-drain" }}
|
|
{{- end }}
|
|
|
|
{{/* Secret name can be omitted; we default to <release>-tls in templates */}}
|