Deployments¶
Two things matter here: how CI/CD builds and tags a release, and how that release actually lands in the cluster.
Tag-triggered CD, serialized¶
CI builds the image and runs tests on every push to main; once it
passes, CI creates a git tag. CD triggers on that tag push: it promotes
the exact image CI already built to a new Docker tag matching the git
tag, then deploys it. The PR-time build is never reused for this, it
only exists to smoke-test the PR itself.
CD runs serialized (concurrency: { group: cd, cancel-in-progress: false
}) so applies can't race each other. This matters most for infra-as-code,
where a concurrent pulumi up can corrupt state, but the
tag-then-promote shape works for any service.
Version-tag every service and library, not just infra repos. It's the cheapest way to know exactly what changed between two deployments.
Worked examples:
platform-infra'sci.yamlcreates the tag, itscd.yamlapplies it withpulumi up.hello-world-grpc-service'sci.yamlbuilds the image onmainand creates the tag; itscd.yamlpromotes that exact image to the new tag and deploys it.
Deploying to the cluster: GitOps, always¶
Every app deploys via GitOps into
k8s-manifests: the
pipeline bumps that app's image tag, the change merges, and Flux
reconciles it in-cluster. No pipeline talks to the cluster directly to
roll out a deploy.
Worked example:
patchats's update-tag composite
bumps the tag; see Automation for the OWNERS-gated
/merge flow that merges version-only bumps in k8s-manifests.
See Useful k8s commands for the full
kubectl/flux cheat sheet. To confirm which version is actually
running after a deploy:
k get pods -L version
-L version adds a column showing each pod's version label, so you can
see at a glance which pods are on the new tag and which are still rolling
over.