Expert · GitOps, platform engineering and DevOps careers · topic 51 of 53 · 35 min
Capstone project: from commit to monitored production
Explanation
Why one end-to-end project beats ten tutorials
Interviewers see many CVs that list Docker, Kubernetes, Terraform and Jenkins. What they rarely see is proof that the person can connect them. A capstone project is that proof: one public repository where a commit travels all the way to a running, monitored service. It also gives you real stories for interviews: the bug that broke the pipeline, the alert that fired, the rollback you tested.
The app: a college canteen order API
Keep the app small so the effort goes into delivery, not features. Use a language you already know: Node.js with Express, Python with FastAPI, or Go. Five endpoints are enough:
- GET /menu: today's items and prices
- POST /orders: place an order (validate items and quantity; the server calculates the price)
- GET /orders/{id}: order status
- GET /healthz: returns 200 when the app is ready (for Kubernetes probes)
- GET /metrics: Prometheus metrics, such as request counts and durations by route and status code
Store orders in PostgreSQL. Write a handful of unit tests and one test that calls the API.
The pipeline, stage by stage
| Stage | What you build | Done when |
|---|---|---|
| 1. Git repository | Repo with README, .gitignore, branch protection on main | Direct pushes to main are blocked; pull requests need passing checks |
| 2. Dockerfile | Multi-stage build, non-root user, .dockerignore, health check endpoint | Image under about 200 MB, runs as a non-root user |
| 3. CI (GitHub Actions) | Lint, test, scan (dependencies and image), build, push image tagged with the commit SHA | A pull request shows green checks; main pushes ghcr.io/you/canteen-api:<sha> |
| 4. Infrastructure (Terraform) | A cluster or a VM running k3s, with remote state | terraform plan shows no changes after apply; terraform destroy works |
| 5. Kubernetes | Deployment, Service, Ingress, ConfigMap, Secret (or a Helm chart), probes and resource limits | kubectl rollout status succeeds; the API answers through the Ingress |
| 6. Delivery | Argo CD Application watching a deploy folder, or a deploy job in CI | Changing the image tag in Git updates the cluster |
| 7. Observability | Prometheus scraping /metrics, a Grafana dashboard, one SLO and an alert | You can show the alert firing when you break the app on purpose |
| 8. Docs | Runbook and README with a diagram | A stranger can run it and fix the main alert by following your docs |
A Dockerfile that passes review
FROM node:22-slim AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build && npm prune --omit=dev
FROM node:22-slim
ENV NODE_ENV=production
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
USER node
EXPOSE 8080
CMD ["node", "dist/server.js"]The CI workflow
name: ci
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
env:
IMAGE: ghcr.io/your-user/canteen-api:${{ github.sha }} # image names must be lowercase
steps:
- uses: actions/checkout@v7 # pin by commit SHA in your real repo (module 11)
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint
- run: npm test
- run: docker build -t "$IMAGE" .
- uses: aquasecurity/trivy-action@v0.36.0 # pin by commit SHA in your real repo
with:
image-ref: ${{ env.IMAGE }}
severity: HIGH,CRITICAL
exit-code: '1'
- if: github.ref == 'refs/heads/main'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
docker push "$IMAGE"Infrastructure without a surprise bill
Managed Kubernetes services charge for the control plane and the nodes even when idle. For a learning project, a free local cluster (kind, k3d or minikube) is perfectly acceptable, or one small cloud VM running k3s created by Terraform. If you use a cloud account, set a budget alert first, keep Terraform state in a remote backend, and run terraform destroy when you finish a session. Check current pricing and free tiers before you start.
One SLO and one alert
Pick one SLI (service level indicator) that matters to a hungry student: the share of POST /orders requests that succeed. Set an SLO (service level objective) such as 99% over 7 days. Then alert when the error rate is clearly too high for long enough to matter.
groups:
- name: canteen-slo
rules:
- alert: CanteenOrdersFailing
expr: |
sum(rate(http_requests_total{job="canteen-api",route="/orders",code=~"5.."}[5m]))
/
sum(rate(http_requests_total{job="canteen-api",route="/orders"}[5m])) > 0.05
for: 10m
labels:
severity: page
annotations:
summary: "More than 5% of order requests are failing"
runbook_url: "https://github.com/your-user/canteen-api/blob/main/docs/runbook.md"A six-week plan (about 6 to 8 hours a week)
| Week | Goal |
|---|---|
| 1 | App with tests, repository, branch protection, README skeleton |
| 2 | Dockerfile, Docker Compose with PostgreSQL, CI for lint and test |
| 3 | Scanning, image build and push in CI; Terraform for the cluster or VM |
| 4 | Kubernetes manifests or Helm chart; Argo CD or a deploy job |
| 5 | Prometheus, Grafana dashboard, SLO and alert; break it on purpose and watch the alert |
| 6 | Runbook, README with diagram, a short demo recording, tidy commit history, destroy cloud resources |
Need help?
Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.
Try:
Watch the lesson
Capstone project: from commit to monitored production · 1/7
One end to end project proves you can connect the tools. It also gives you real stories for interviews.
Prefer a video by a teacher? Find free videos on “end to end devops project github actions kubernetes argocd prometheus” on YouTube ↗
In real life: A final-year student in Nagpur gets shortlisted with one project
A final-year B.Tech student builds the canteen API capstone over six weeks of evenings, using a free local kind cluster and one small cloud VM that she destroys after each session. Her README opens with a diagram, a 3-minute demo video and a section called "What broke and how I fixed it". In an interview with a Pune product company, the panel spends twenty minutes on that section: a failed image scan, a probe that killed healthy pods, and an alert that was too noisy. She is asked to explain her rollback, demonstrates it live, and gets the offer for a junior DevOps role.
Practice (0/4 done)
Why tag the image with the Git commit SHA (canteen-api:3f9c2ab) instead of latest?
Stage 1: build the canteen API, put it in a GitHub repository with branch protection, and package it with Docker.
Stage 2: CI, infrastructure and deployment. Make every pull request lint, test and scan; make main push an image tagged with the SHA; create the cluster with Terraform; deploy with Kubernetes manifests or Helm through Argo CD (or a deploy job).
Stage 3: observability and documentation. Add a Grafana dashboard, one SLO with an alert, a runbook for that alert, and a README that sells the project in two minutes.
Quick quiz
Read more (free)
Related help
Before this, learn
This topic builds on these. If something here feels new, open them first.
Related topics
- DevOps certifications: which, when and howGitOps, platform engineering and DevOps careers · same module
- DevOps careers and interviews in IndiaGitOps, platform engineering and DevOps careers · same module
- Your portfolio project: a production-style Go APIGo Programming (backend and cloud) · Careers and interviews
- Capstone project briefFull-Stack Development · Capstone, portfolio and getting work
- Capstone: an end-to-end projectData Science, Machine Learning and AI · Ethics, privacy and careers
- IaC in a team: reviews, pipelines and policyCloud Computing (AWS, Azure, Google Cloud) · Infrastructure as code
Questions people ask about this
Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.
Which setting stops anyone pushing straight to main in your capstone repository?
Answer: Branch protection (or a ruleset) requiring pull requests
Branch protection rules or rulesets require pull requests and passing checks before merging.
Why does the capstone Dockerfile use two stages?
Answer: So the final image contains only what is needed to run, not the build tools
Multi-stage builds keep compilers and dev dependencies out of the final image: smaller and fewer things to attack.
What is the cheapest sensible way to run Kubernetes for a learning project?
Answer: A local cluster such as kind or minikube, or a small VM with k3s that you destroy after use
Local clusters are free, and destroying cloud resources after each session avoids surprise bills.
Why should an alert include a runbook_url?
Answer: The person paged can follow written first steps instead of guessing at 3 a.m.
A runbook link turns an alert into a clear next action.
Why do small, regular commits help in interviews?Related
Answer: They show how you worked and that you built it yourself
History tells a story of real work.
What is an artefact in a DevOps pipeline?Related
Answer: A file produced by the build, such as a .jar or container image, that is stored and deployed
Artefacts are build outputs. Storing them means you deploy exactly what was tested.
Which project is a good size for the capstone?Related
Answer: A flatmate expense splitter with login, groups, expenses, search and a settlement list
It has users, a few related tables, ownership and real features, and it can be finished well in four weeks.
What is the main benefit of a multi-stage build?Related
Answer: Build tools and source stay in earlier stages, so the final image is smaller and safer
Only what you COPY --from into the last stage ends up in the final image.
From Writing Dockerfiles: caching, multi-stage builds and small images
Pass the quiz (60% or more) or mark this topic as done when you are ready.
Your progress is saved on this device only.
Next steps
- 2 more topics in “GitOps, platform engineering and DevOps careers” before its exam: DevOps certifications: which, when and how, DevOps careers and interviews in India.
- Module 12 exam: GitOps, platform engineering and DevOps careers · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
- 53 topics left in the course before the final exam.