feat(kargo): add a progressive delivery pipeline with a verification gate - #2
Merged
Merged
Conversation
…gate Adds Kargo 1.11.2 and a four-stage pipeline promoting a podinfo image through dev1-0 -> dev1-1 -> tst -> prd, gated on a real health check at each step. A promotion is a Git commit, not a cluster write. Each Stage's promotionTemplate clones the repo, rewrites spec.image in that stage's XMicroservice under crossplane/xrs/stages/<stage>/, commits and pushes; Argo CD then syncs it. The cluster state still comes only from Git and every promotion is visible in history. Freight flows one way -- dev1-0 takes it directly from the Warehouse, each later stage sources only from its predecessor -- so nothing reaches prd without passing every gate before it. The gate is an Argo Rollouts AnalysisTemplate, not a Kargo kind: Kargo delegates verification to Rollouts' analysis engine. Its chart checks for those CRDs at startup and silently disables the integration when they are absent, so the bootstrap installs Argo Rollouts first and waits for the CRDs to be established -- otherwise the gate would never run and nothing would report why. The check calls podinfo's /healthz through the Service the XMicroservice composition created, three times with no retries, which exercises the whole chain: Kargo committed, Argo CD synced, Crossplane composed a Deployment and Service, and pods are serving. podinfo rather than the nginx image the team-a demo uses, because it publishes clean semver tags and serves a health endpoint, which is what makes the gate a real check rather than a formality. Stage namespaces are separate from tenants.yaml on purpose: team-a/team-b are tenants and dev1-0/dev1-1/tst/prd are environments. They are different axes, and a tenant's queues should not be disturbed by a promotion. The per-stage XRs deliberately do not get their own Argo CD Application -- the existing `xrs` app sets directory.recurse, so it already covers crossplane/xrs/stages, and a second Application over the same path would leave two owners fighting over the same resources. Git credentials follow the Backstage pattern: rendered from .env by the bootstrap into a Secret outside any Argo CD source path, since it holds a real token. Kargo matches credentials by the kargo.akuity.io/cred-type=git label rather than by name. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Adds Kargo 1.11.2 and a four-stage pipeline promoting a podinfo image through dev1-0 → dev1-1 → tst → prd, gated on a real health check at each step.
Promotion is a Git commit, not a cluster write
Each Stage's
promotionTemplateclones the repo, rewritesspec.imagein that stage'sXMicroserviceundercrossplane/xrs/stages/<stage>/, commits and pushes. Argo CD then syncs it — so cluster state still comes only from Git, and every promotion is visible in history.Freight flows one way:
dev1-0takes it directly from the Warehouse, and each later stage sources only from its predecessor. Nothing reachesprdwithout passing every gate before it.The gate is an Argo Rollouts kind, not a Kargo one
AnalysisTemplatelives inargoproj.io— Kargo delegates verification to Rollouts' analysis engine. Its chart documents that it self-disables when those CRDs are missing:So the gate would silently never run and nothing would say why. The bootstrap installs Argo Rollouts first and waits for
analysistemplates.argoproj.ioto be established before installing Kargo.The check calls podinfo's
/healthzthrough the Service theXMicroservicecomposition created — three consecutive successes,failureLimit: 0. That exercises the whole chain: Kargo committed → Argo CD synced → Crossplane composed a Deployment and Service → pods are serving. A bad image fails here and the Freight never becomes eligible for the next stage.Choices worth reviewing
tenants.yaml—team-a/team-bare tenants,dev1-0/dev1-1/tst/prdare environments. Different axes, and a tenant's queues shouldn't be disturbed by a promotion.xrsapp setsdirectory.recurse, so it already coverscrossplane/xrs/stages. A second Application over the same path would leave two owners fighting over the same resources..envby the bootstrap into a Secret kept outside any Argo CD source path, since it holds a real token. Kargo matches credentials by thekargo.akuity.io/cred-type=gitlabel rather than by name.Note on the Warehouse
The Warehouse CRD sets
x-kubernetes-preserve-unknown-fieldsonsubscriptions, so a misspelled optional field is silently ignored rather than rejected. The subscription therefore uses only the minimal documented form and relies on the defaultSemVerselection strategy — verified against a running Kargo rather than guessed from the schema.🤖 Generated with Claude Code