Ravindra BagaleCourses & study guides मराठी

Chapter 84: DevOps Projects Part 14: Capstone CI/CD EKS DR Serverless E-commerce Terraform Jenkins Argo Prometheus

84.4 Project 100: End-to-end e-commerce — Terraform + Jenkins + K8s + Argo CD + Prometheus

Friends, this is the final capstone. Today we stand up shop infra with Terraform, ship with Jenkins, sync with Argo CD, and watch Prometheus.

What you will build in this project

  1. Terraform VPC and EKS.
  2. Jenkins builds SHA images.
  3. Argo CD syncs shop apps.
  4. Prometheus shows golden signals.

1. Start from a real company story

At BigBasket in Bengaluru, festival traffic needed one path from merge to live with eyes on the dashboard.

Rough cost of the old scatter: about Rs 60 lakh in failed carts one Diwali week.

Priya wired Terraform, Jenkins, Argo CD and Prometheus for the shop API and checkout.

Today we run that end-to-end path once.

TFEKSJenkinsSHAArgosyncPromSLIs
Picture 1: Terraform -> Jenkins SHA -> Argo sync -> Prometheus

Ravindra Bagale's Tip

Students skip the rollback drill. Rehearse undo before festival traffic. Keep that habit.

2. Start and prepare

Step 1: Why this project

Why: Real outages teach. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: echo why. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 1: a1

Type this:

echo 'Today we build ecom100'

You will see:

Today we build ecom100

What it means: Why.

Example 2: a2

Type this:

mkdir -p /tmp/ecom100 && echo 'Scope ready'

You will see:

Scope ready

What it means: Scope.

Example 3: a3

Type this:

echo 'Keep commands short and check every output'

You will see:

Keep commands short and check every output

What it means: Habit.

Step 2: Prepare workspace

Why: Folders and notes. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: prep. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 4: b1

Type this:

mkdir -p /tmp/ecom100 && printf '%s\n' 'lab notes' > /tmp/ecom100/NOTES.txt && cat /tmp/ecom100/NOTES.txt

You will see:

lab notes

What it means: Notes.

Example 5: b2

Type this:

echo 'Work only under /tmp/ecom100 for this project'

You will see:

Work only under /tmp/ecom100 for this project

What it means: Path.

Example 6: b3

Type this:

echo 'Write ACCEPT.txt at the end'

You will see:

Write ACCEPT.txt at the end

What it means: Accept file.

Step 3: Terraform shop base

Why: VPC and EKS. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: tf. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 7: c1

Type this:

printf '%s\n' 'module vpc {}' 'module eks {}' 'module rds {}' 'backend s3 + dynamodb lock' > /tmp/ecom100/TF.txt && cat /tmp/ecom100/TF.txt

You will see:

backend s3 + dynamodb lock

What it means: TF.

Example 8: c2

Type this:

echo 'terraform workspace select prod && terraform apply'

You will see:

terraform workspace select prod && terraform apply

What it means: Apply.

Example 9: c3

Type this:

echo 'Output cluster name and OIDC issuer for IRSA'

You will see:

Output cluster name and OIDC issuer for IRSA

What it means: Outputs.

3. Build the main pieces

Step 4: Jenkins SHA pipeline

Why: Build scan push. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: ci. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 10: d1

Type this:

printf '%s\n' 'stages: lint test build scan push' 'image: registry.example.com/shop/api:$GIT_SHA' > /tmp/ecom100/CI.txt && cat /tmp/ecom100/CI.txt

You will see:

image: registry.example.com/shop/api:$GIT_SHA

What it means: CI.

Example 11: d2

Type this:

echo 'Fail the build on HIGH and CRITICAL scan findings'

You will see:

Fail the build on HIGH and CRITICAL scan findings

What it means: Gate.

Example 12: d3

Type this:

echo 'Write the SHA into the deploy overlay commit'

You will see:

Write the SHA into the deploy overlay commit

What it means: Overlay.

Step 5: Argo CD shop apps

Why: Sync. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: argo. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 13: e1

Type this:

printf '%s\n' 'Apps: shop-api, shop-web, shop-checkout' 'Source: deploy repo overlays/prod' 'Sync policy: automated self-heal for non-prod; manual for prod' > /tmp/ecom100/ARGO.txt && cat /tmp/ecom100/ARGO.txt

You will see:

Apps: shop-api, shop-web, shop-checkout

What it means: Argo.

Example 14: e2

Type this:

echo 'argocd app sync shop-api --revision $SHA_COMMIT'

You will see:

argocd app sync shop-api --revision $SHA_COMMIT

What it means: Sync.

Example 15: e3

Type this:

printf '%s\n' 'Acceptance: all three apps Healthy Synced on the new SHA' > /tmp/ecom100/ACCEPT.txt && cat /tmp/ecom100/ACCEPT.txt

You will see:

Acceptance: all three apps Healthy Synced on the new SHA

What it means: Gate.

Step 6: Prometheus goldens

Why: Four signals. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: prom. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 16: f1

Type this:

printf '%s\n' 'Golden signals: latency traffic errors saturation' 'Panels for api, web, checkout' > /tmp/ecom100/PROM.txt && cat /tmp/ecom100/PROM.txt

You will see:

Golden signals: latency traffic errors saturation

What it means: Prom.

Example 17: f2

Type this:

echo 'Alert on checkout error rate burn'

You will see:

Alert on checkout error rate burn

What it means: Alert.

Example 18: f3

Type this:

echo 'Link Grafana panels to Loki and Jaeger where useful'

You will see:

Link Grafana panels to Loki and Jaeger where useful

What it means: Link.

4. Automate and verify

Step 7: Rollback drill

Why: Before festival. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: rollback. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 19: g1

Type this:

printf '%s\n' 'Revert the overlay SHA commit' 'Argo syncs previous image' 'Confirm cart success rate recovers' > /tmp/ecom100/RB.txt && cat /tmp/ecom100/RB.txt

You will see:

Confirm cart success rate recovers

What it means: Rollback.

Example 20: g2

Type this:

echo 'Time the drill; aim under your RTO'

You will see:

Time the drill; aim under your RTO

What it means: Time.

Example 21: g3

Type this:

echo 'Keep the undo command pinned in the war-room chat'

You will see:

Keep the undo command pinned in the war-room chat

What it means: Pin.

Step 8: Security baseline

Why: Non-negotiables. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: sec. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 22: h1

Type this:

printf '%s\n' 'No latest tags' 'Pod limits via Kyverno' 'Secrets via ESO or Vault' 'OIDC for cloud roles' > /tmp/ecom100/SEC.txt && cat /tmp/ecom100/SEC.txt

You will see:

No latest tags

What it means: Sec.

Example 23: h2

Type this:

echo 'Scan every image before it reaches the deploy repo'

You will see:

Scan every image before it reaches the deploy repo

What it means: Scan.

Example 24: h3

Type this:

echo 'RBAC: shop team cannot touch platform namespaces'

You will see:

RBAC: shop team cannot touch platform namespaces

What it means: RBAC.

Step 9: Definition of done

Why: Festival ready. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: dod. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 25: i1

Type this:

printf '%s\n' 'Infra in Terraform state' 'SHA live via Argo' 'Dashboards green for 30 minutes' 'Rollback drill logged' > /tmp/ecom100/DOD.txt && cat /tmp/ecom100/DOD.txt

You will see:

Rollback drill logged

What it means: DoD.

Example 26: i2

Type this:

echo 'Write a one-page runbook for the on-call'

You will see:

Write a one-page runbook for the on-call

What it means: Runbook.

Example 27: i3

Type this:

echo 'Celebrate: you finished all 100 projects'

You will see:

Celebrate: you finished all 100 projects

What it means: Done.

5. Harden and accept

Step 10: Story BigBasket

Why: Bengaluru lesson. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: story. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 28: j1

Type this:

printf '%s\n' 'At BigBasket in Bengaluru, festival traffic needed one merge-to-live path.' 'Priya wired Terraform, Jenkins, Argo CD and Prometheus.' > /tmp/ecom100/STORY.txt && wc -l /tmp/ecom100/STORY.txt

You will see:

2 /tmp/ecom100/STORY.txt

What it means: Story.

Example 29: j2

Type this:

echo 'Rough cost of the old scatter: about Rs 60 lakh in failed carts one Diwali week.'

You will see:

Rough cost of the old scatter: about Rs 60 lakh in failed carts one Diwali week.

What it means: Cost.

Example 30: j3

Type this:

echo 'Priya: PASS'

You will see:

Priya: PASS

What it means: Sign-off.

Step 11: Proof

Why: Files. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: ls. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 31: k1

Type this:

ls /tmp/ecom100

You will see:

NOTES.txt\nSTORY.txt\nACCEPT.txt

What it means: Tree.

Example 32: k2

Type this:

test -f /tmp/ecom100/ACCEPT.txt && echo ACCEPT_OK

You will see:

ACCEPT_OK

What it means: Accept present.

Example 33: k3

Type this:

echo 'All 100 DevOps projects complete'

You will see:

All 100 DevOps projects complete

What it means: Bridge.

Step 12: Acceptance

Why: End-to-end shop path works. We do this before the next step so mistakes stay small and easy to undo. Read the output carefully; the numbers and names tell you if the machine is healthy.

What: final. Follow the numbered examples below. Type each command, read the exact output, and match the meaning line before you move on. That is how real teams learn a tool.

Example 34: z1

Type this:

echo 'EKS from Terraform'

You will see:

EKS from Terraform

What it means: A.

Example 35: z2

Type this:

echo 'Argo Synced'

You will see:

Argo Synced

What it means: B.

Example 36: z3

Type this:

echo 'Prometheus green'

You will see:

Prometheus green

What it means: C.

Check yourself

Q1. Who wired BigBasket path?

Priya

Q2. IaC?

Terraform

Q3. CI?

Jenkins

Q4. GitOps?

Argo CD

Q5. Metrics?

Prometheus

Q6. Rollback?

SHA

Friends, you finished the e-commerce golden path. Did you understand? Let us try it once more. Break a probe, watch the alert, roll back by SHA, and prove carts recover.

Lab: try at home

  1. EKS up.
  2. SHA in Argo.
  3. Synced Healthy.
  4. Dashboard green.

Recap

  • IaC first.
  • CI builds SHA.
  • GitOps syncs.
  • Observe always.
  • Rollback rehearsed.

Lab

  1. Finish all four capstones; keep ACCEPT notes for each.
  2. Never deploy latest tags; always SHA or semver.
  3. Run the DR tabletop and the e-commerce rollback drill.
  4. After each project, write one paragraph: what broke and how you fixed it.
  5. You have finished all 100 DevOps projects.

Practice task

Pick the golden-path release and the two-region tabletop. Prove both before you call the chapter done.

Ravindra Bagale's Tip

One golden path. Honest RPO/RTO. Short Lambda handlers. Rehearse rollback before festival traffic.

In short

  • Build scan push deploy.
  • SHA not latest.
  • Honest RPO RTO.
  • DNS failover plan.
  • Lambda for spikes.
  • API Gateway front.
  • Terraform the base.
  • Jenkins builds SHA.
  • Argo syncs desired.
  • Prometheus watches.
  • Rollback rehearsed.
  • All 100 done.