Repository navigation
Kubernetes kustomize manifests + cargo xtask release that pins the image tag - #36
Merged
Merged
Conversation
A base for the Forge server (Deployment, Service, ServiceAccount, a ConfigMap of non-secret FORGE_* settings; secrets from a `forge-env` Secret), components for an Ingress or HTTPRoute, in-cluster Redis, PostgreSQL and versitygw, two replicas with a PDB, and following :latest, plus a production and an evaluation overlay. Every workload meets the restricted Pod Security Standard. The base pins the image to the release version. CI renders every overlay and the base with each component and validates the output with kubeconform (strict). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hTuRP6x9Hu6EqeHq2Ce7a
`cargo xtask release <version>` sets the version in Cargo.toml, Cargo.lock, web/package.json and the image tag of the Kubernetes base, turns CHANGELOG.md's [Unreleased] section into the release's, commits and creates the annotated tag (default branch only; --no-tag for a release pull request). It never pushes. The release workflow now also refuses a tag whose Kubernetes base names another image version, so the manifests at a tag always deploy that tag's image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hTuRP6x9Hu6EqeHq2Ce7a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Kubernetes manifests (
deploy/kubernetes), kustomize with componentsbase/: the Forge server. It has a Deployment, Service, ServiceAccount and a ConfigMap generator for non-secretFORGE_*settings. Secrets come from aforge-envSecret throughenvFrom.docs/deployment.md: a startup probe on/healthzgives migrations 5 min, liveness is/healthz, readiness is/readyz.preStopsleeps 10 s, the termination grace period is 300 s, and rolling updates usemaxUnavailable: 0./tmpis anemptyDir(6 Gi, above the 4 GiB staging budget).RuntimeDefaultseccomp and drops all capabilities.enableServiceLinks: false. A Service namedforgewould otherwise injectFORGE_PORT=tcp://…-style variables into Forge's own config namespace.components/:ingress: Ingress with TLS and ingress-nginx body-size/buffering/timeout annotations.httproute: a Gateway API HTTPRoute instead of the Ingress.redis: in-cluster Redis with a password and a NetworkPolicy.high-availability: 2 replicas, topology spread and a PodDisruptionBudget.postgres: an in-cluster PostgreSQL 17 StatefulSet.s3-versitygw: an in-cluster versitygw on a PersistentVolume.image-latest: runs:latestwithimagePullPolicy: Always.overlays/production: external PostgreSQL and S3, Redis, 2 replicas, Ingress.overlays/evaluation: everything in-cluster.forge-envfrom a git-ignoredforge.env, with a committedforge.env.example. Both namespaces enforce therestrictedPod Security Standard, and every workload meets it.forge-envSecret. They build Forge's connection URLs with$(VAR)expansion fromenvFrom.deploy/is now in.dockerignore, so a localforge.envcan't end up in the image build context.Pinned image tag, updated before the tag is created
ghcr.io/schmitch/forgewithimages: newTag: 0.1.0.cargo xtask release <version> [--no-tag]:Cargo.toml,Cargo.lock(cargo update --workspace),web/package.jsonand the base'snewTag.## [Unreleased]inCHANGELOG.mdto the new version and updates the links at the bottom. A section that already exists is kept as is.release: vX.Y.Zand creates the annotated tag. It never pushes.[Unreleased], and tagging offmain/master.--no-tagis the release-PR flow for a protectedmain.release.ymlnow also refuses a tag whose Kubernetes base names a different version. Sodeploy/kubernetes/base?ref=vX.Y.Zalways deploys imageX.Y.Z.CI
kubernetesjob inci.yml. It renders every overlay, and the base with each component on its own, then validates the output withkubeconform -strict(Kubernetes 1.33 schemas plus the Gateway API CRD catalog).Docs
deploy/kubernetes/README.md, a "Releasing" section inDEVELOPMENT.md, links fromREADME.mdanddocs/deployment.md, andCHANGELOG.mdentries.Test plan
cargo test -p xtask: 8 new unit tests for the version,newTag, package.json and changelog edits. One of them checks that the real files each match exactly once.cargo clippy -p xtask --all-targets -D warnings,cargo fmt --all --check.github/scripts/kustomize-check.sh 1.33.0locally: 70 resources in 9 renders, all valid (strict).cargo xtask releaseend to end in a scratch clone:0.2.0produced the expected 5-file commit and tag.release.ymlguard and the release-notesawkboth work on that commit.0.1.0(the first release) tags without an empty commit.--no-tagon a branch commits only.sha256sum -c, extract) locally.kubectl apply -kon kind/k3d before merging.Notes
release.ymlalready publishes toghcr.io/schmitch/forgeonv*.*.*tags, but no tag exists yet, so no image has been published.cargo xtask release 0.1.0 && git push --atomic origin main v0.1.0is the first release.imagePullSecretsto theforgeServiceAccount.preStop.sleepaction needs Kubernetes 1.30 or later.Generated by Claude Code