Capstone: Full GitOps LoopΒΆ
This is the final challenge of the whole pillar. You will send one change through the entire system: from a commit, through CI, into Git as new desired state, and out to a self-healing Kubernetes deployment, all automatically. π
The goalΒΆ
Prove your complete GitOps pipeline works end to end, then prove it heals itself.
Your taskΒΆ
- Add a small feature: a
/readyendpoint that returns{"ready": true}. - Add a test for it.
- Commit and push, then cut the release
v1.5.0. - Watch the full loop with no manual steps:
- CI tests, builds, and publishes the image
- CI updates
k8s/deployment.yamltov1.5.0and pushes it - Argo CD auto-syncs and deploys the new version
- Confirm the new version is live in the cluster.
- Then test self-healing: run
kubectl scale deployment snapshot --replicas=6and watch Argo CD revert it to the count in Git.
You should not need to change any pipeline or Argo CD settings. Everything you built already does this.
HintsΒΆ
- The route goes in
app.py; the test intest_app.py. - The tag drives the whole thing. A plain push only tests and builds.
- Watch it in three places: the Actions tab, your Git history, and the Argo CD dashboard.
Reference solution
Add to app.py:
Add to test_app.py:
def test_ready_endpoint():
client = app.test_client()
response = client.get("/ready")
assert response.status_code == 200
assert response.get_json() == {"ready": True}
Release it:
Then watch CI, the manifest commit, and Argo CD deploy v1.5.0 on their own.
β Success criteriaΒΆ
You have completed the Advanced track if:
- Releasing
v1.5.0ran the full pipeline with no manual steps - CI updated the manifest, and Argo CD deployed the new image
- The
/readyendpoint is live in the cluster - Scaling the deployment by hand was reverted by self-healing
π What you've builtΒΆ
Step back and look at the machine you have assembled. A single git push of a tag now:
- Runs your tests
- Builds and publishes a versioned image
- Records the new version in Git as desired state
- Deploys it to Kubernetes through GitOps
- Keeps the cluster healed and matching Git, forever
That is a complete, modern, production-grade delivery system.
π The full journeyΒΆ
You have now completed all three pillars, and they tell one story:
- Docker: package the app into a container
- Kubernetes: run it reliably at scale
- CI/CD & GitOps: deliver it automatically, and keep it in sync
Build it, orchestrate it, deliver it. You can take an idea from source code to a self-healing production deployment, entirely through automation. That is a genuine platform-engineering skill set. Congratulations. π
If you have not taken it yet, the Kubernetes course is the piece that sits right in the middle of this story.