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
59 lines
2.3 KiB
Smarty
59 lines
2.3 KiB
Smarty
{{- /*
|
|
Back-compat shim for the all-in-one image migration.
|
|
|
|
Chart 0.2.x deployed a separate client and API, configured through `client.*` and
|
|
`api.*` (and, before that, `server.*`). Checkmate now ships one image that serves
|
|
both, so those collapse into a single `app.*` block.
|
|
|
|
Existing installs keep working: any legacy block is merged over the `app.*`
|
|
defaults, in the order client -> api -> server, so a value set in an older block
|
|
still wins. Only `image`/`tag` are deliberately NOT inherited from `client.*` —
|
|
that repo (checkmate-client) is no longer published, so honouring it would pin an
|
|
install to an image that cannot be pulled.
|
|
|
|
New installs have no legacy keys and this is a no-op deepCopy of `.Values.app`.
|
|
Consume it as:
|
|
{{- $app := include "checkmate.app" . | fromYaml -}}
|
|
*/}}
|
|
{{- define "checkmate.app" -}}
|
|
{{- $app := deepCopy .Values.app -}}
|
|
{{- with .Values.client -}}
|
|
{{- $legacy := omit (deepCopy .) "image" "tag" "port" -}}
|
|
{{- $app = mergeOverwrite $app $legacy -}}
|
|
{{- end -}}
|
|
{{- with .Values.api -}}
|
|
{{- $app = mergeOverwrite $app (deepCopy .) -}}
|
|
{{- end -}}
|
|
{{- with .Values.server -}}
|
|
{{- $app = mergeOverwrite $app (deepCopy .) -}}
|
|
{{- end -}}
|
|
{{- $app | toYaml -}}
|
|
{{- end -}}
|
|
|
|
{{- /*
|
|
Deprecated alias kept so any out-of-tree template referencing `checkmate.api`
|
|
still resolves. Prefer `checkmate.app`.
|
|
*/}}
|
|
{{- define "checkmate.api" -}}
|
|
{{- include "checkmate.app" . -}}
|
|
{{- end -}}
|
|
|
|
{{- /*
|
|
Resolve a full image reference from a repo + optional tag. `appVersion` is the single source of
|
|
truth for tags: bumping Chart.appVersion moves every tier at once. Call as:
|
|
{{ include "checkmate.image" (dict "image" $repo "tag" $tag "root" $) }}
|
|
|
|
If `image` already carries a tag (a ":" in its final path segment) it is used verbatim — this keeps
|
|
legacy `server.image: repo:tag` overrides working and lets anyone pin a full ref (e.g. tag "latest").
|
|
A ":" only in the registry segment (a registry port like "reg:5000/x") is ignored, so a tag is still
|
|
appended. Otherwise the tag is `tag` if set, else the chart's appVersion.
|
|
*/}}
|
|
{{- define "checkmate.image" -}}
|
|
{{- $lastSegment := .image | splitList "/" | last -}}
|
|
{{- if contains ":" $lastSegment -}}
|
|
{{- .image -}}
|
|
{{- else -}}
|
|
{{- printf "%s:%s" .image (.tag | default .root.Chart.AppVersion) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|