Skip to content

Name our images localhost/dbpantry-* and never fall back to ghcr.io - #30

Merged
imanimanyara merged 2 commits into
mainfrom
fix/k8s-local-images
Nov 13, 2026
Merged

imanimanyara merged 2 commits into
mainfrom
fix/k8s-local-images

Conversation

@imanimanyara

Copy link
Copy Markdown
Member

Summary

dbpantry publishes no image (D-77), yet every image was still built, run and deployed as ghcr.io/simtabi/dbpantry-*. A kind, minikube or real cluster missing an image therefore pulled from a registry that holds nothing. Our images are now named localhost/dbpantry-<component>:<tag>, from one default (owner: "Yes, use localhost/"), and nothing falls back to ghcr.io.

  • One default. MDB_IMAGE_PREFIX_DEFAULT=localhost in scripts/env-lib.sh, with mdb_image_prefix, mdb_image and mdb_image_ref.
    • mdb_image_ref moves the pooler descriptor's localhost/dbpantry-pgbouncer:dev to the prefix in force.
    • The Makefile reads the default from there.
    • Files that cannot source it repeat it, and check 73 holds them to it: Compose (${MDB_IMAGE_PREFIX:-localhost}), the patroni Dockerfile's ARG IMAGE_PREFIX, the chart's global.imageRegistry, the pooler descriptor, and the CI scan steps.
  • A set prefix reaches every image. Export MDB_IMAGE_PREFIX=registry.example.com/team and make build, Compose, the scripts and make up all use it. On Kubernetes, scripts/helm-values renders global.imageRegistry from it, and the backend's kind loading reads that value back, so kind loads exactly the names the chart runs. Setting global.imageRegistry by hand prefixes every chart image too. imagePullPolicy stays IfNotPresent.
  • Why localhost/ rather than dbpantry/<component>: check 49 requires a fully qualified reference, because Podman refuses short names (D-60), and Docker would expand a short name to Docker Hub on a pull. localhost is fully qualified, is Podman's own prefix for local builds, reaches no remote registry, and loads into kind and minikube as it is.
  • Docs:
    • docs/guides/kubernetes.md has a new Images section covering make build, kind load docker-image (automatic on kind contexts), minikube image load, and pushing to your own registry with MDB_IMAGE_PREFIX. It also updates the quick start, requirements, settings table and troubleshooting.
    • The licensing, Podman, Apple container and architecture guides and the design tables use the local names.
    • The ghcr.io/simtabi mentions that remain only describe the frozen images or their history.
  • Check 49: its Compose parser resolved only a leading ${VAR:-default}, so it would have read ${MDB_IMAGE_PREFIX:-localhost}/dbpantry-pg:${…} as localhost}/…. It now resolves every default, innermost first, and still counts 55 references.
  • New check 73, images-local-by-default (fast, structure):
    • every default is localhost, and every Compose image line takes its prefix from ${MDB_IMAGE_PREFIX:-localhost}
    • no tracked file outside prose names a dotted registry before dbpantry-, across 321 files
    • ghcr.io/simtabi appears only in 9 files that describe the frozen images, each held to its measured count
    • a set prefix reaches mdb_image, the pooler, make shell, helm-values, kind loading and the rendered chart
  • Recorded as D-78 in design.md. The CHANGELOG has an Upgrade note: existing local images keep their old names, so run make build once and the next make up recreates the containers; volumes and data are untouched.

Verification

  • make verify-structure: 73 checks, all well-formed. make lint: shellcheck clean. make go-ci: green. actionlint 1.7.12: clean.
  • Ran these checks locally, all passing: 02, 05, 31, 46 (161 links resolve), 47, 49, 55, 71 and 73.
  • helm lint deploy/helm/dbpantry: 1 chart linted, 0 failed.
  • helm template (helm 4) with pg (HA) and mysql renders localhost/dbpantry-patroni:17 and localhost/dbpantry-mysql:8.4; with --set global.imageRegistry=registry.example.com/team it renders registry.example.com/team/dbpantry-pg:17 and …/dbpantry-mysql:8.4.
  • make -n shell runs localhost/dbpantry-cli:dev, or registry.example.com/team/dbpantry-cli:dev with the prefix exported. An empty MDB_IMAGE_PREFIX now counts as unset in Make too.
  • Check 73 was proven red one defect at a time, and each file restored from a copy (confirmed with cmp). Each of these failed:
    • the chart default set to ghcr.io/simtabi
    • the env-lib default set to docker.io/simtabi
    • a literal ghcr.io/simtabi/dbpantry-pg in docker-compose.yml
    • a quay.io/…/dbpantry-cli in scripts/scan
    • the patroni ARG IMAGE_PREFIX=ghcr.io/simtabi
    • kind loading hard-coded to localhost
    • the chart ignoring global.imageRegistry
    • helm-values dropping imageRegistry
    • the Makefile ignoring MDB_IMAGE_PREFIX
  • The runtime checks (the full make verify) run in CI's verify jobs. Locally, a sandbox mktemp shim was needed for gen-compose; nothing in the repo depends on it.

Removed

  • Every hard-coded ghcr.io/simtabi image prefix:
    • Compose: docker-compose.yml (caddy, pg, mysql, mariadb), compose.ha.yml (patroni, pgbouncer), and the engine services scripts/gen-compose generates
    • Images and descriptors: the pgbouncer descriptor (engines/postgres/engine.conf) and the patroni Dockerfile's ARG IMAGE_PREFIX
    • Make and scripts: the Makefile (make shell), and scripts/{build,upgrade,verify-backups,transfer,scan}
    • Checks: scripts/verify/lib.sh (image_name) and checks 02, 08, 14, 29, 32 and 55
    • CI: the Trivy scan steps in ci.yml and release.yml
    • Kubernetes: the backend's kind list (_mdb_k8s_local_images) and the chart's global.imageRegistry: ghcr.io/simtabi
  • The Kubernetes guide's "use the published ones on GHCR", and the Podman guide's "or pulled from GHCR".
  • The licensing guide's gh attestation verify oci://ghcr.io/… example, since no image is published. The guide now points at the frozen images.

Nothing is deleted from ghcr.io.

dbpantry publishes no image (D-77), but every image was still built, run
and deployed as ghcr.io/simtabi/dbpantry-*, so a cluster missing one
pulled from a registry that holds nothing. One default now names them:
MDB_IMAGE_PREFIX_DEFAULT=localhost in scripts/env-lib.sh, with
mdb_image_prefix, mdb_image and mdb_image_ref. It replaces every hard-coded
registry in Compose, the generated engine and pooler services, the patroni
build, the Makefile, five scripts, six checks and both scan steps. The Helm
chart defaults global.imageRegistry to localhost, helm-values passes it the
prefix in force, and kind loading follows it. A set MDB_IMAGE_PREFIX or
global.imageRegistry still prefixes every image.

localhost rather than an unqualified name: check 49 and Podman need a
fully qualified reference, and Docker would expand a short one to Docker
Hub. Check 49 now resolves every ${VAR:-default} in a reference. New check
73 holds every default to localhost, fails on a remote registry for our
images, and proves a set prefix reaches every image. Recorded as D-78;
existing local images need one make build.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 18:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

The first CI run failed four checks, each a reader of the old image name
that the literal search for ghcr.io/simtabi missed:

- check 42 allowlisted our images as ghcr\.io/simtabi/[a-z-]+, and check
  72 matched them by the same regex, so the pooler read as a third-party
  rebuild and our images as having no healthcheck. Both now name
  localhost/dbpantry-*; 72 under the prefix in force.
- scripts/init passed the caddy service's raw image: line, now Compose
  syntax, to run, so make init-prod (check 26) failed. It resolves the
  line with the new mdb_compose_ref first.
- check 73 listed one image in CI: make verify exports COMPOSE_PROFILES,
  which helm-values ranks above the MDB_PROFILES the check set. It sets
  both, counts the escaped spelling, and fails on any script that runs a
  Compose image: line without mdb_compose_ref.
@imanimanyara
imanimanyara merged commit 00726f1 into main Nov 13, 2026
25 checks passed
@imanimanyara
imanimanyara deleted the fix/k8s-local-images branch November 13, 2026 20:27
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