7. Capstone: The Full Loop, End to End¶
What this proves¶
One push runs the entire curriculum: test → build → scan → sign → package → gated deploy → observe → rollback. If you can narrate every arrow in this diagram from memory — with the file where it lives — you've finished the course.
flowchart LR
subgraph CI["CI (.gitlab-ci.yml + .gitlab/ci/)"]
T[maven:test] --> B[build:kaniko
SHA-tagged image]
B --> SC[scan:trivy-image
CRITICAL gate]
B --> CF[scan:trivy-config
advisory]
SC --> SG[sign:cosign
OIDC keyless]
SG --> P[chart:package
+ helm unittest]
P --> D[deploy:dev
auto, --wait]
P --> PR[deploy:prod
manual + resource_group]
end
subgraph REG["Registry"]
I[(image:sha
+ signature
+ SBOM)]
end
subgraph K8S["Cluster"]
D --> POD1[dev pods]
PR --> POD2[prod pods]
ADM[Kyverno: signed only] -.->|verify| POD2
end
B --> I
SG --> I
PR -.->|rollback:prod| POD2
The narrative — rehearse it¶
git push→workflow:rulesdecides this is one pipeline, not two.maven:testruns (JUnit artifact for the UI);cache:keeps the.m2repo warm.build:kanikobuilds rootless, pushes<img>:<sha>— immutable, traceable. DockerConcepts-07 explains why distroless would make this even better.securitystage:scan:trivy-imageblocks on CRITICAL;sign:cosignsigns with the job's own OIDC token — no keys anywhere (lesson 03 + DevSecOps theory).chart:packagelints + packages;dist/*.tgzflows vianeedsartifact handoff.deploy:devauto-deploys on main only when app/chart changed;--waitmakes "deployed" mean "Ready."deploy:prodwaits for a human click, serialized byresource_group: prod— the audit trail is theenvironment:record.- In-cluster: Kyverno verifies the cosign signature at admission (KC lab 18); Flagger canaries the traffic shift (KC lab 14); ESO delivers the SSO secret (KC lab 12).
- Break: bad tag →
pending-upgradewedge →rollback:prod→ postmortem (DevOpsLearning labs 13–14).
The self-test (close every file first)¶
| Question | File |
|---|---|
| Where's the DAG edge between test and build? | .gitlab/ci/build-kaniko.yml → needs |
| Why can't a feature branch deploy prod? | rules + protected KUBECONFIG_DATA |
| Who proves the image is safe? | scan:trivy-image gate |
| Who proves the image is ours? | sign:cosign + Kyverno verifyImages |
| How does prod serialize? | resource_group: prod |
| What makes a failed deploy look failed? | --wait + probes |
| Where's the audit record of "who deployed"? | environment: prod deployments page |
Score yourself: 7/7 = ready to defend this pipeline in an interview.
Final checklist before you call it done¶
- Pipeline ran green end-to-end on a real cluster at least once
- You caused AND resolved a
pending-upgradewedge -
helm rollbackexecuted, not just read about - A Kyverno
verifyImages(or lab-18 equivalent) policy inspected - One postmortem written — real or drill
- You can give the push-vs-pull (GitOps) answer in 30 seconds