Skip to content

Expert · GitOps, platform engineering and DevOps careers · topic 51 of 53 · 35 min

Capstone project: from commit to monitored production

Explanation

Build one small project end to end: a college canteen order API in a protected Git repository, packaged with a multi-stage non-root Dockerfile, tested, scanned and pushed by GitHub Actions, deployed to Kubernetes on infrastructure made with Terraform, synced by Argo CD, and watched by Prometheus and Grafana with one SLO and an alert. A runbook and a clear README finish it. This one project is your strongest interview story.

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

StageWhat you buildDone when
1. Git repositoryRepo with README, .gitignore, branch protection on mainDirect pushes to main are blocked; pull requests need passing checks
2. DockerfileMulti-stage build, non-root user, .dockerignore, health check endpointImage 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 SHAA 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 stateterraform plan shows no changes after apply; terraform destroy works
5. KubernetesDeployment, Service, Ingress, ConfigMap, Secret (or a Helm chart), probes and resource limitskubectl rollout status succeeds; the API answers through the Ingress
6. DeliveryArgo CD Application watching a deploy folder, or a deploy job in CIChanging the image tag in Git updates the cluster
7. ObservabilityPrometheus scraping /metrics, a Grafana dashboard, one SLO and an alertYou can show the alert firing when you break the app on purpose
8. DocsRunbook and README with a diagramA stranger can run it and fix the main alert by following your docs

A Dockerfile that passes review

dockerfile
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"]
Build tools stay in the first stage. The final image runs as the built-in non-root user "node".

The CI workflow

yaml
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"
Every pull request is linted, tested and scanned. Only main pushes an image, tagged with the exact commit.

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.

yaml
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 simple threshold alert that links to the runbook. A burn-rate alert (module 10) is a good stretch goal.

A six-week plan (about 6 to 8 hours a week)

WeekGoal
1App with tests, repository, branch protection, README skeleton
2Dockerfile, Docker Compose with PostgreSQL, CI for lint and test
3Scanning, image build and push in CI; Terraform for the cluster or VM
4Kubernetes manifests or Helm chart; Argo CD or a deploy job
5Prometheus, Grafana dashboard, SLO and alert; break it on purpose and watch the alert
6Runbook, README with diagram, a short demo recording, tidy commit history, destroy cloud resources
Careful: Common mistakes: building a huge app and never reaching deployment; committing a kubeconfig or .env file; leaving a cloud cluster running for a month; a README that says only "my DevOps project". Keep the app tiny, scan for secrets, destroy resources after each session, and write the README for a busy interviewer.
Tip: Record a 3-minute screen video: open a pull request, watch the checks pass, merge, watch Argo CD sync, then break the app and show the alert. Link it at the top of the README.

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 project, end to end

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)

Task 1 · Question

Why tag the image with the Git commit SHA (canteen-api:3f9c2ab) instead of latest?

Task 2 · Practice

Stage 1: build the canteen API, put it in a GitHub repository with branch protection, and package it with Docker.

Task 3 · Practice

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).

Task 4 · Practice

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

Question 1

1.Which setting stops anyone pushing straight to main in your capstone repository?

Question 2

2.Why does the capstone Dockerfile use two stages?

Question 3

3.What is the cheapest sensible way to run Kubernetes for a learning project?

Question 4

4.Why should an alert include a runbook_url?

Read more (free)

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.

From Your portfolio project: a production-style Go API

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.

From The DevOps toolchain and your learning roadmap

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.

From Capstone project brief

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

  1. 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.
  2. Module 12 exam: GitOps, platform engineering and DevOps careers · 12 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. 53 topics left in the course before the final exam.

← Previous: GitOps and platform engineering