Zero to Hero Learning Path

Master DevOps from
absolute scratch

A structured, beginner-friendly journey through cloud computing, automation, containers, and monitoring โ€” explained with real-world analogies and hands-on examples.

19
Modules
100+
Hands-on Examples
15
Mini Projects
0
Assumed Knowledge
Your Progress
0%
๐Ÿ—บ๏ธ
Start Here

Your DevOps Learning Roadmap

What is DevOps?

DevOps is the combination of two words: Development (writing software) and Operations (running and managing that software). In simple terms, DevOps is a way of working where the people who build software and the people who run it work together smoothly, automatically, and continuously.

Before DevOps, developers would write code and "throw it over the wall" to operations teams who would then struggle to deploy it. Bugs were found late, deployments were scary, and things broke in production all the time.

๐Ÿ• Real-World Analogy

Think of a pizza restaurant. The chef (developer) makes the pizza, and the delivery team (operations) delivers it. In old-school IT, the chef makes the pizza and just hands it to delivery โ€” but delivery doesn't know the right address, it's not packed properly, and it arrives cold. DevOps is like giving the chef and delivery team a shared system, clear communication, and automated processes โ€” so every pizza is delivered hot, on time, every time.

Your Learning Path

Each module below builds on the previous one. Don't skip ahead โ€” every concept is connected. Click any card to start learning!

00
๐Ÿ”„
DevOps Lifecycle
00b
๐ŸŒ
Networking Basics
00c
๐Ÿ“
YAML & Config Files
01
โ˜๏ธ
Why Cloud Computing
02
๐Ÿ”ถ
AWS Core Services
03
๐Ÿง
Linux Basics
04
๐ŸŒฟ
Git & GitHub
05
โšก
Shell Scripting
06
๐Ÿ”จ
Maven
07
๐Ÿค–
Jenkins CI/CD
08
๐Ÿณ
Docker
09
โ˜ธ๏ธ
Kubernetes
10
๐Ÿ—๏ธ
Terraform
11
๐Ÿ“Š
Monitoring
12
๐Ÿ”’
VPC Deep Dive
13
๐Ÿชฃ
S3 Storage Classes
14
โŒจ๏ธ
AWS CLI
15
โšก
Lambda, RDS & More
16
๐Ÿ”
DevSecOps Basics
17
๐ŸŽฏ
Interview Prep
18
๐Ÿš€
What's Next

The DevOps Infinity Loop

DevOps is often shown as an infinity loop (โˆž) โ€” because the process never stops. You plan, build, test, deploy, monitor, and then use what you learn to plan again. This is called the DevOps Lifecycle.

DEV OPS ๐Ÿ“‹ PLAN ๐Ÿ’ป CODE ๐Ÿ”จ BUILD ๐Ÿงช TEST ๐Ÿ”€ MERGE ๐Ÿ”— INTEGRATE ๐Ÿš€ RELEASE ๐Ÿ“ฆ DEPLOY โš™๏ธ OPERATE ๐Ÿ“Š MONITOR ๐Ÿ’ฌ FEEDBACK ๐Ÿ”ง CONFIG โˆž DEVOPS
The DevOps Infinity Loop โ€” a continuous cycle of building, deploying, and improving
Start Your Journey โ†’
๐Ÿ”„ Module 00: DevOps Lifecycle
Understand the big picture โ€” what happens from when a developer writes code to when users see it live.
โ†’
๐Ÿ”„
Module 0.1 โ€” Before You Begin

The DevOps Lifecycle

How Does Software Actually Get to Users?

Before diving into tools, you need to understand the big picture. How does an idea in a developer's head end up as a feature on your phone? That journey is the Software Delivery Lifecycle โ€” and DevOps is about making that journey fast, safe, and automatic.

Without DevOps: a feature might take weeks or months to reach users, with manual steps, broken deployments, and late-night emergencies. With DevOps: the same feature can go live in minutes, automatically, with tests and checks built in.

๐Ÿญ Analogy โ€” Factory Assembly Line

Think of a car factory. In the old days, each car was hand-built by one team โ€” slow, inconsistent, error-prone. Modern factories use an automated assembly line: each station does one job perfectly, parts move automatically, quality is checked at every step, and hundreds of cars roll out daily. DevOps is that assembly line โ€” but for software.

The Journey: Code to Production

๐Ÿ’ก PLAN Jira / Notion ๐Ÿ’ป CODE Git / GitHub โš™๏ธ BUILD & TEST Jenkins / Maven ๐Ÿณ PACKAGE Docker Image ๐Ÿš€ DEPLOY Kubernetes / EC2 ๐Ÿ“Š MONITOR Prometheus / Grafana โ‘  Dev โ‘ก Dev โ‘ข CI โ‘ฃ CI โ‘ค CD โ‘ฅ Ops โ† Continuous Feedback Loop
From idea to production โ€” every box in this pipeline is a module you'll learn in this course

Old Way vs DevOps Way

TopicโŒ Old Way (Manual)โœ… DevOps Way (Automated)
DeploymentsManual, risky, every few monthsAutomated, safe, multiple times per day
TestingQA team tests manually at endTests run automatically on every code push
ServersPhysical machines, takes weeks to set upCloud VMs created in seconds with code
FailuresDiscovered by angry usersCaught by monitoring before users notice
Team silosDev and Ops barely talkShared responsibility, shared tools
โœ… Key Takeaway

DevOps is NOT just tools. It's a culture of collaboration + automation. The tools (Docker, Jenkins, Kubernetes etc.) are the how. The culture โ€” fast feedback, shared ownership, continuous improvement โ€” is the why.

Next โ†’
๐ŸŒ Networking Basics
Before cloud and servers make sense, you need to understand how computers talk to each other over a network.
โ†’
๐ŸŒ
Module 0.2 โ€” Before You Begin

Networking Basics for DevOps

Why Do DevOps Engineers Need to Know Networking?

Every app you deploy runs on servers that communicate over a network. When your app is slow or unreachable, it's often a network issue. Understanding how data travels between machines is essential for debugging, securing, and scaling applications.

๐Ÿ“ฎ Analogy โ€” The Postal System

Think of the internet like a postal system. Every house (computer) has an address (IP address). Letters have a "to" and "from" address. The postal system figures out the best route to deliver it (this is called routing). The type of delivery service (standard vs express) is like different protocols (HTTP vs HTTPS). And the post office that sorts the mail is like a router.

Key Networking Concepts

๐Ÿ 
IP Address
A unique address for every device on a network. Like your home address but for computers. Example: 192.168.1.10 (private) or 54.210.1.45 (public).
๐Ÿšช
Port
A "door" on a server for a specific service. Port 80 = HTTP websites. Port 443 = HTTPS. Port 22 = SSH login. Port 3306 = MySQL database.
๐Ÿ“‹
DNS
Domain Name System โ€” translates human-readable names like google.com into IP addresses. It's the internet's phone book.
๐Ÿ”’
HTTP vs HTTPS
HTTP sends data in plain text (anyone can read it). HTTPS encrypts it with SSL/TLS โ€” essential for any production site.
โš–๏ธ
Load Balancer
Distributes traffic across multiple servers so no single server gets overwhelmed. Like a receptionist directing customers to available staff.
๐Ÿ”ฅ
Firewall
Controls which traffic is allowed in and out. AWS calls them "Security Groups". You decide: "allow port 80 from everyone, but port 22 only from my IP."

How a Web Request Works โ€” Step by Step

๐Ÿ‘ค USER Types URL ๐Ÿ“‹ DNS Resolves IP โš–๏ธ LOAD BALANCER Picks a server ๐Ÿ–ฅ๏ธ Server 1 ๐Ÿ–ฅ๏ธ Server 2 ๐Ÿ–ฅ๏ธ Server 3 ๐Ÿ—„๏ธ DATABASE Returns data โ‘ DNS โ‘กRoute โ‘ฃDB Query
How typing "google.com" leads to a response โ€” DNS lookup โ†’ Load Balancer โ†’ Server โ†’ Database

Useful Networking Commands

Terminal โ€” Networking
# Check your IP address ip addr show # Linux ifconfig # older Linux / macOS # Test if a host is reachable ping google.com ping 192.168.1.1 # DNS lookup โ€” what IP does this domain map to? nslookup github.com dig github.com # Check if a port is open on a server telnet 192.168.1.10 80 nc -zv 192.168.1.10 443 # Trace the route packets take traceroute google.com # See what's listening on which ports netstat -tulpn ss -tulpn # modern alternative # Download a file / test an HTTP endpoint curl http://localhost:8080/health wget https://example.com/file.zip
โœ… Remember These Port Numbers

22 = SSH (terminal access to servers) ยท 80 = HTTP ยท 443 = HTTPS ยท 3306 = MySQL ยท 5432 = PostgreSQL ยท 6379 = Redis ยท 8080 = common dev server port ยท 9090 = Prometheus ยท 3000 = Grafana

Next โ†’
๐Ÿ“ YAML & Config Files
Almost every DevOps tool โ€” Docker, Kubernetes, Ansible, GitHub Actions โ€” uses YAML for configuration. You need to be fluent in it.
โ†’
๐Ÿ“
Module 0.3 โ€” Before You Begin

YAML & Config Files

What is YAML and Why Does It Matter?

YAML (YAML Ain't Markup Language) is a human-readable format for writing configuration files. If JSON is for machines, YAML is for humans โ€” it's clean, readable, and used everywhere in DevOps.

You'll write YAML for Docker Compose, Kubernetes manifests, GitHub Actions pipelines, Ansible playbooks, and more. Getting comfortable with YAML will save you hours of debugging.

๐Ÿ“‹ Analogy โ€” Form Filling

YAML is like filling out a structured form. Instead of checkboxes and dropdown menus, you write key-value pairs with indentation showing which items belong together. The indentation (spaces โ€” never tabs!) is everything in YAML.

YAML Basics โ€” Syntax

config.yaml โ€” YAML Syntax Examples
# --- KEY: VALUE PAIRS --- name: my-app version: "1.0" port: 8080 debug: true # --- LISTS (use - for each item) --- languages: - Python - Java - Go # --- NESTED (indentation = hierarchy) --- database: host: localhost port: 5432 name: mydb credentials: user: admin password: secret123 # --- LIST OF OBJECTS --- servers: - name: web-1 ip: 10.0.0.1 role: frontend - name: db-1 ip: 10.0.0.2 role: database # --- MULTI-LINE STRINGS --- description: | This is a multi-line string. The pipe | keeps newlines. # โš ๏ธ NEVER use TABS. Always use 2-space indentation.

YAML in Action โ€” GitHub Actions Pipeline

Here's a real GitHub Actions CI/CD pipeline written in YAML. Don't worry about understanding every detail โ€” just notice the structure:

.github/workflows/deploy.yml
name: Deploy My App # When to run this pipeline on: push: branches: [main] # What to do jobs: build-and-deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Run tests run: npm test - name: Build Docker image run: docker build -t myapp:latest . - name: Push to Docker Hub run: docker push myusername/myapp:latest

Common YAML Mistakes to Avoid

โŒ Wrongโœ… RightWhy
name:myappname: myappSpace after colon is required
Tab indentation2-space indentationYAML doesn't allow tabs
port: "8080" when a number is neededport: 8080Numbers shouldn't be quoted
Inconsistent indentationAlways consistent 2 spacesInconsistency causes parse errors
๐Ÿš€ Mini Project โ€” Write Your First YAML

Create a file called app-config.yaml describing a fictional app: give it a name, version, a list of 3 features, and a nested database section with host, port, and name. Validate it at yamllint.com.

Next โ†’
โ˜๏ธ Module 01: Why Cloud Computing
Now that you have the foundations, let's understand the infrastructure that runs modern software.
โ†’
โ˜๏ธ
Module 01 โ€” Foundation

Why Cloud Computing?

The Problem: Traditional Servers

Imagine you want to launch a website. In the old world (on-premise infrastructure), here's what you had to do:

  • 1Buy expensive physical servers (โ‚น5โ€“50 lakhs)
  • 2Set up a data center room with cooling and power backup
  • 3Hire people to manage it 24/7
  • 4Wait weeks or months before going live
  • 5If traffic spikes, your site crashes โ€” you can't add more servers instantly
๐Ÿจ Real-World Analogy โ€” Hotel vs Airbnb

Traditional servers are like building your own hotel every time you travel. You spend months constructing it, buying furniture, hiring staff โ€” just for a 3-day trip. Then you have to maintain it forever even when no one's using it.

Cloud computing is like Airbnb or OYO โ€” you book only when you need, pay only for what you use, scale up for a holiday weekend and scale down after. No ownership headaches. No maintenance worries.

What is Cloud Computing?

Cloud computing means renting computing resources (servers, storage, databases, networking) over the internet from a provider instead of owning physical hardware. You pay only for what you use, like an electricity bill.

โšก
On-Demand
Get a server in 60 seconds. No procurement process.
๐Ÿ“ˆ
Scalable
Handle 10 users or 10 million users with the same ease.
๐Ÿ’ณ
Pay-as-you-go
Pay only for resources you actually use, by the hour.
๐ŸŒ
Global
Deploy your app close to users worldwide.

Old vs New: Side by Side

FactorTraditional (On-Premise)Cloud Computing
Setup TimeWeeks to monthsMinutes
CostHigh upfront capitalPay as you use
ScalingBuy new hardwareClick of a button
MaintenanceYour team's problemProvider handles it
Disaster RecoveryExpensive backup systemsBuilt-in redundancy

Types of Cloud Services

Cloud providers offer different "layers" of service. Think of it as how much of the stack they manage for you:

๐Ÿ—๏ธ IaaS โ€” Infrastructure as a Service You manage: OS, Runtime, Apps, Data Provider manages: Servers, Storage, Networking Example: AWS EC2 (rent a virtual machine) ๐Ÿ”ง PaaS โ€” Platform as a Service You manage: Apps, Data Provider manages: OS, Runtime, Middleware, Servers Example: AWS Elastic Beanstalk, Heroku ๐Ÿ“ฆ SaaS โ€” Software as a Service You just USE the software Provider manages: Everything Example: Gmail, Salesforce, Zoom

Why do we need DevOps in the Cloud era?

Cloud gave us power โ€” unlimited servers, global reach, instant scaling. But now teams were deploying dozens of times a day. How do you manage all that? You need automation, consistency, and speed. That's exactly what DevOps tools (Jenkins, Docker, Kubernetes, Terraform) provide.

Cloud is the land. DevOps is how you build on it.

โœ… Module Summary
  • Traditional servers are expensive, slow, and hard to scale
  • Cloud computing lets you rent servers over the internet, pay-as-you-go
  • Three service types: IaaS, PaaS, SaaS
  • Cloud makes DevOps possible by giving us on-demand, programmable infrastructure
Next Module โ†’
๐Ÿ”ถ AWS Core Services
Now that you know WHY we use cloud, let's learn HOW โ€” specifically with Amazon Web Services (the world's most popular cloud platform).
โ†’
๐Ÿ”ถ
Module 02 โ€” Foundation

AWS Core Services

What is AWS?

Amazon Web Services (AWS) is the world's most popular cloud platform, used by Netflix, Airbnb, NASA, and millions of companies. AWS has 200+ services, but as a DevOps beginner, you only need to master the core 6.

Core Service #1 โ€” EC2 (Virtual Servers)

๐Ÿ’ป Analogy โ€” Renting a Laptop

EC2 (Elastic Compute Cloud) is like renting a computer in Amazon's data center. You choose the size (1 CPU or 64 CPUs), the operating system (Linux or Windows), and you pay by the hour. It's just a computer you control via the internet.

AWS CLI โ€” Launch EC2 Instance
# Launch a free-tier EC2 instance (Amazon Linux 2) aws ec2 run-instances \ --image-id ami-0c55b159cbfafe1f0 \ --instance-type t2.micro \ --key-name MyKeyPair # SSH into your new server ssh -i "MyKeyPair.pem" ec2-user@your-public-ip # You're now inside a cloud server! ๐ŸŽ‰

Core Service #2 โ€” S3 (Object Storage)

๐Ÿ“ฆ Analogy โ€” Google Drive for Your App

S3 (Simple Storage Service) is like Google Drive but for developers. Store images, videos, backups, website files โ€” anything. Files are stored in "buckets" and accessed via URLs. You can even host a full website from S3!

AWS CLI โ€” S3 Operations
# Create a bucket aws s3 mb s3://my-awesome-website # Upload a file aws s3 cp index.html s3://my-awesome-website/ # Enable static website hosting aws s3 website s3://my-awesome-website --index-document index.html # Your site is now live at: # http://my-awesome-website.s3-website-us-east-1.amazonaws.com

Core Service #3 โ€” IAM (Access Control)

๐Ÿ”‘ Analogy โ€” Office ID Cards

IAM (Identity and Access Management) is like an office building with different access cards. The security guard can enter the lobby. The developer can enter the server room. The manager can access everything. IAM lets you control WHO can do WHAT in your AWS account.

IAM Policy โ€” Allow S3 Read Only
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": ["s3:GetObject", "s3:ListBucket"], "Resource": "arn:aws:s3:::my-bucket/*" }] }

Core Service #4 โ€” VPC (Your Private Network)

๐Ÿ˜๏ธ Analogy โ€” Gated Community

VPC (Virtual Private Cloud) is like a gated community for your servers. You define the roads (subnets), the gates (security groups), and who can come in or go out. Your database lives in the private area (no internet access), while your web server lives in a public area (accessible to users).

INTERNET | [Internet Gateway] | [Public Subnet] โ†โ†’ Web Server (EC2) | [Private Subnet] โ†โ†’ Database (RDS) (No direct internet access)

Other Key Services

๐Ÿ—„๏ธ
RDS
Managed relational databases (MySQL, PostgreSQL). No server management needed.
ฮป
Lambda
Run code without any server. Pay only when your code actually runs.
๐Ÿ‘€
CloudWatch
Monitor your AWS resources. Get alerts when something goes wrong.
โš–๏ธ
ELB
Load Balancer โ€” distributes traffic across multiple servers.
๐Ÿš€ Mini Project โ€” Deploy a Static Website

Goal: Host your personal portfolio site on S3 with HTTPS via CloudFront.

  1. 1Create an S3 bucket with a unique name
  2. 2Upload your HTML/CSS files
  3. 3Enable "Static Website Hosting" in bucket settings
  4. 4Set bucket policy to allow public read
  5. 5Your site is live! Share the URL ๐ŸŽ‰
โœ… Module Summary
  • EC2 = Virtual servers you rent in the cloud
  • S3 = Unlimited file/object storage with web hosting capability
  • IAM = Control who can access what in your account
  • VPC = Your private, isolated network in the cloud
  • RDS, Lambda, CloudWatch = Managed database, serverless compute, monitoring
Next Module โ†’
๐Ÿง Linux Basics
All cloud servers run Linux. You need to be comfortable on the command line to configure, deploy, and manage them effectively.
โ†’
๐Ÿง
Module 03 โ€” Foundation

Linux Basics

What is an Operating System?

Before diving into Linux, let's understand what an OS actually does. An Operating System is the software that manages all hardware and software resources on your computer. Without it, your applications have no way to talk to the CPU, memory, or disk.

โš™๏ธ
Process Management
Decides which processes run, for how long, and allocates CPU time. Without this, every program would fight for the processor.
๐Ÿ’พ
Memory Management
Tracks how much RAM each process uses, decides how much to allocate, and keeps record of free memory.
๐Ÿ“
File Management
Organises files and directories, tracks file information (size, permissions, location), and manages reads/writes.
๐Ÿ”’
Security & User Management
Manages authorised users, restricts access to unauthorised users, and prevents harmful activities on the system.

Linux Architecture

โšก HARDWARE CPU ยท RAM ยท Disk ยท Network Card ยท Keyboard ยท Mouse ๐Ÿง  KERNEL โ€” Core of Linux Process Mgmt ยท Memory Mgmt ยท Device Control ยท System Security ๐Ÿš SHELL โ€” CLI Interface bash ยท zsh ยท sh ยท fish ยท Users type commands here ๐Ÿ“ฆ APPLICATION SOFTWARE nginx ยท docker ยท python ยท your code Higher Level โ†‘
Linux architecture โ€” user commands flow down through Shell โ†’ Kernel โ†’ Hardware

What is Linux & Why Does It Matter?

Linux is a free, open-source operating system founded by Linus Torvalds in 1991. About 96% of the world's servers run Linux โ€” including all major cloud providers (AWS, GCP, Azure). If you're doing DevOps, you're doing Linux.

๐Ÿง
Popular Linux Flavours
Ubuntu / Debian โ€” beginner-friendly, great for servers
Red Hat (RHEL) โ€” enterprise standard
CentOS / Fedora โ€” RHEL-based, free
Kali Linux โ€” security & penetration testing
Amazon Linux โ€” AWS-optimised
๐ŸชŸ
Linux vs Windows
Free & open source vs paid closed source
More secure, no antivirus needed
CLI-first vs GUI-first
No reboot needed for most updates
Enterprise-designed โ€” multi-user, better multitasking
๐ŸŽฎ Analogy โ€” Cheat Codes

Using a GUI (graphical interface) is like playing a game normally. Using the Linux terminal is like knowing the cheat codes โ€” you can do in 1 second what takes 5 minutes with a mouse.

Essential Commands โ€” Navigation

Terminal โ€” File Navigation
# Print current directory (where am I?) pwd /home/arjun # List files in current directory ls Documents Downloads projects script.sh # List with details (permissions, size, date) ls -la # Change directory cd projects cd .. # go one level up cd ~ # go to home directory # Create a new directory mkdir my-app # Create a file touch hello.txt

Essential Commands โ€” Files

Terminal โ€” File Operations
# View file contents cat hello.txt less hello.txt # scrollable view # Write to a file echo "Hello World" > hello.txt echo "Line 2" >> hello.txt # append (don't overwrite) # Copy, Move, Delete cp hello.txt backup.txt mv hello.txt greetings.txt # also used for renaming rm greetings.txt rm -rf old-folder/ # delete folder (careful!) # Search inside files grep "error" app.log grep -r "TODO" ./src # search in all files

Permissions (chmod)

Linux controls who can read, write, or execute a file. Think of it as setting access rules.

File permissions look like: -rwxr-xr-- - = regular file (d = directory) rwx = owner can Read, Write, Execute r-x = group can Read, Execute (not write) r-- = others can only Read chmod 755 script.sh โ†’ owner=rwx, group=rx, others=rx chmod 644 config.txt โ†’ owner=rw, group=r, others=r chmod +x deploy.sh โ†’ make executable for everyone
Terminal โ€” Permissions
# Make a script executable chmod +x deploy.sh ./deploy.sh # now you can run it # Change file owner chown arjun:developers myfile.txt # Run as superuser (admin) sudo apt update # sudo = "do as super user"

Process & System Commands

Terminal โ€” System Management
# See running processes ps aux top # live view (like task manager) # Kill a process kill 1234 # 1234 = process ID kill -9 1234 # force kill # Disk and memory df -h # disk usage free -h # memory usage # Install software (Ubuntu/Debian) sudo apt update && sudo apt install nginx -y # Manage services sudo systemctl start nginx sudo systemctl enable nginx sudo systemctl status nginx

User Management

Linux allows multiple users on one machine. Every user has a type, a UID, and specific permissions.

User TypeUIDDescription
๐Ÿ”ด Root User0Superuser โ€” full control over everything. Access via sudo. Direct login disabled by default.
โš™๏ธ System Users1โ€“999Created by OS for background services (daemons). No password, no login. E.g. www-data for nginx.
๐Ÿ‘ค Normal Users1000+Created by admins for real people. Limited permissions โ€” can only affect their own files.
Terminal โ€” User Management
# Create a new user sudo useradd -m arjun # -m creates home directory sudo passwd arjun # set password # Modify a user (add to sudo group) sudo usermod -aG sudo arjun # Delete a user sudo userdel -r arjun # -r removes home dir too # Switch to another user su - arjun # See current user whoami # See all users on the system cat /etc/passwd # See which groups a user belongs to groups arjun

File Test Operators โ€” Check Before You Act

In shell scripts, you often need to check if a file or directory exists before doing something with it. These are called file test operators:

Shell โ€” File Test Operators
# Check if a file exists if [ -e config.yaml ]; then echo "Config file exists" fi # Common file test operators: # -e โ†’ path exists (file or directory) # -f โ†’ is a regular file # -d โ†’ is a directory # -r โ†’ file is readable # -w โ†’ file is writable # -x โ†’ file is executable # -s โ†’ file is NOT empty (has content) # Practical example in a deploy script if [ ! -d "/var/log/myapp" ]; then mkdir -p /var/log/myapp echo "Created log directory" fi if [ -x "./deploy.sh" ]; then ./deploy.sh else echo "Error: deploy.sh is not executable" chmod +x deploy.sh fi
๐Ÿš€ Mini Project โ€” Set Up a Web Server
Commands
sudo apt update sudo apt install nginx -y sudo systemctl start nginx && sudo systemctl enable nginx echo "<h1>Hello from my EC2 server!</h1>" | sudo tee /var/www/html/index.html # Visit http://your-ec2-ip in a browser ๐ŸŽ‰
โœ… Module Summary
  • Linux OS manages processes, memory, files, network, and security
  • Architecture: Applications โ†’ Shell โ†’ Kernel โ†’ Hardware
  • 96% of servers run Linux โ€” Ubuntu, RHEL, Amazon Linux are most common
  • Navigation: pwd, ls, cd, mkdir, touch
  • Files: cat, cp, mv, rm, grep
  • Permissions: chmod (755 = rwxr-xr-x), chown, sudo
  • Users: root (UID 0), system (1-999), normal (1000+)
  • File tests: -e -f -d -r -w -x -s in shell scripts
Next Module โ†’
๐ŸŒฟ Git & GitHub
Now that you can navigate servers, you need to track your code changes and collaborate with teams โ€” that's where Git comes in.
โ†’
๐ŸŒฟ
Module 04 โ€” Code & Build

Git & GitHub

The Problem Without Version Control

Imagine you and your friend are both editing the same Word document. You each make changes and email it back and forth. After 5 rounds, nobody knows which version is the latest. Someone accidentally overwrites the other's changes. The file is now a mess called final_final_v3_ACTUAL_FINAL.docx.

In software, this is catastrophic. A team of 10 developers could be working on the same codebase. Without coordination, everything breaks. This is why we use a Version Control System (VCS).

Types of Version Control Systems

TypeHow it worksToolsProblem
๐Ÿ“‚ Local VCS (LVCS)Saves versions only on your local machineRCS, SCCSNo backup, no collaboration
๐ŸŒ Centralized VCS (CVCS)One central server stores all code; everyone connects to itSVN, PerforceNo internet = can't save; server failure = all lost
โœ… Distributed VCS (DVCS)Every developer has a full copy of the entire repoGit, MercurialNone โ€” best of both worlds

Git is a DVCS โ€” it combines Local VCS (work offline, full local history) with Central VCS (push to shared remote, full collaboration). This is why Git is the industry standard.

โฐ Analogy โ€” Google Docs + Time Machine

Git is like Google Docs for code โ€” everyone can work on it, every change is tracked, and you can go back to any previous version instantly. GIT stands for Global Information Tracker. Created in 2005 by Linus Torvalds (same person who created Linux!) to manage the Linux kernel source code.

Git vs GitHub โ€” They're Different!

GitGitHub
What it isVersion control tool (software on your computer)Website that hosts Git repositories in the cloud
Where it runsOn your local machineIn the cloud (github.com)
AnalogyThe camera taking photosThe photo album stored online
Can work offline?YesNo
Alternativesโ€”GitLab, Bitbucket, Azure DevOps

Git's Three Working Areas

๐Ÿ’ป Working Directory Where you create, edit, delete files git add ๐Ÿ“‹ Staging Area Temporary hold โ€” files ready to commit git commit ๐Ÿ—‚๏ธ Local Repository Permanent snapshots (.git folder) Then: git push โ†’ uploads to GitHub (remote repository)
Git's three areas โ€” every file goes through these stages before reaching GitHub

The Core Git Workflow

Edit Code
โ†’
git add
โ†’
git commit
โ†’
git push
โ†’
GitHub
Terminal โ€” Complete Git Workflow
# 1. Configure Git (one time only) git config user.name "Arjun" git config user.email "arjun@email.com" git config --edit # open config to edit manually # 2. Initialize project git init # 3. Check status and add files git status git add app.py # add single file git add . # add ALL files git add *.js # add all .js files # 4. Commit with a message git commit -m "feat: add login page" # 5. Connect to GitHub remote git remote add origin https://github.com/user/repo.git git remote -v # verify connection # 6. Push to GitHub git push origin main # 7. Pull latest changes from team git pull origin main # Useful extras git log # see commit history git ls-files # list tracked files git remote remove origin # remove connection

Branching โ€” Types & Commands

A branch is a separate line of development โ€” a safe sandbox to work in without touching the main codebase.

๐ŸŒฟ Main / Master Branch

The default branch created when you init a repo. This is your production code โ€” always stable and working. Never push broken code directly here.

โœจ Feature Branch

Created to develop a new feature. Isolated from main โ€” you experiment freely. Once done, raise a Pull Request to merge back into main.

๐Ÿš€ Release Branch

Created when preparing a release. Only bug fixes go here โ€” no new features. When ready, merged into main and tagged with a version number.

๐Ÿ”ฅ Hotfix Branch

Created for critical production bugs that need immediate fixing. Branched directly from main, fixed fast, merged back to main and also back to any in-progress release branch.

main: A---B---C-----------H (production) \ / feature: D---E---F (your new feature, merged via PR) \ hotfix: G (urgent fix, merged directly to main)
Terminal โ€” Branching Commands
# List all branches git branch # local branches git branch -a # local + remote branches git branch -r # remote branches only # Create and switch to new branch git checkout -b feature/login-page # Or using newer syntax: git switch -c feature/login-page # Switch between branches git checkout main git switch main # Push branch to GitHub git push origin feature/login-page # Merge feature into main git checkout main git merge feature/login-page # Delete branch after merge git branch -d feature/login-page # safe delete (merged) git branch -D feature/login-page # force delete git push origin --delete feature/login-page # delete remote
โœ… Module Summary
  • VCS types: Local (LVCS) โ†’ Centralized (CVCS) โ†’ Distributed (DVCS โ€” Git)
  • Git was created by Linus Torvalds in 2005 for the Linux kernel
  • Three areas: Working Directory โ†’ Staging Area โ†’ Local Repository โ†’ GitHub
  • Core workflow: git init โ†’ add โ†’ commit โ†’ remote add โ†’ push
  • Branch types: main, feature, release, hotfix โ€” each has a purpose
  • git fetch downloads but doesn't merge; git pull = fetch + merge
Next Module โ†’
โšก Shell Scripting
You know Linux commands. Now learn to chain them into automated scripts that run on their own.
โ†’
โšก
Module 05 โ€” Code & Build

Shell Scripting

What is a Shell?

A shell is a user interface that provides access to operating system services. It acts as a translator between the user and the kernel โ€” you type a command, the shell interprets it, and the kernel executes it.

๐Ÿ–ผ๏ธ GUI Shell

Graphical interface โ€” icons, windows, menus. Examples: Windows Explorer, Linux GNOME, KDE. Easy to learn but slow and not scriptable.

โŒจ๏ธ CLI Shell

Text-based โ€” you type commands. Examples: Windows CMD, PowerShell, Linux Terminal. Faster, automatable, used in all DevOps work.

Types of CLI shells in Linux: sh (original Bourne Shell), bash (Bourne Again Shell โ€” default on most Linux), zsh (Z Shell โ€” macOS default, advanced features), fish (user-friendly, auto-suggestions), ksh (Korn Shell โ€” enterprise), csh (C Shell โ€” C-like syntax).

Terminal โ€” Discover Your Shell
# Which shell are you using right now? echo $0 -bash # List all available shells on the system cat /etc/shells /bin/sh /bin/bash /usr/bin/zsh /usr/bin/fish

What is Shell Scripting?

A shell script is an executable file containing multiple shell commands that run sequentially โ€” like a recipe. Instead of typing 20 commands every morning, you write them once in a script and run them with a single command.

๐Ÿค– Analogy โ€” Teaching a Robot

Imagine training a robot to clean your house. Instead of telling it what to do step by step every day, you write instructions once and hand it the list. Shell scripting is exactly that โ€” you write instructions for your computer to follow automatically, every time.

Variables, Input & Operators

Shell Script โ€” Variables & Operators
#!/bin/bash # Declare a variable (no spaces around =) APP_NAME="myapp" PORT=8080 # Access variable value with $ echo "Starting $APP_NAME on port $PORT" # Take input from user read USERNAME echo "Hello, $USERNAME!" # Arithmetic operators (use $(( )) for math) TOTAL=$(( 10 + 5 )) # addition DIFF=$(( 10 - 3 )) # subtraction PROD=$(( 4 * 5 )) # multiplication MOD=$(( 10 % 3 )) # modulus (remainder) # Relational operators (for comparisons) # -eq equal -ne not equal # -gt greater than -lt less than # -ge >= (or equal) -le <= (or equal) # Logical operators # && AND || OR ! NOT

Conditions & Loops

Shell Script โ€” If / For / While / Until
#!/bin/bash # IF / ELIF / ELSE if [ -f "package.json" ]; then echo "Node project" && npm install elif [ -f "pom.xml" ]; then echo "Java project" && mvn package else echo "Unknown project" && exit 1 fi # FOR LOOP โ€” iterate over a list for server in web1 web2 web3; do echo "Deploying to $server" ssh $server "sudo systemctl restart app" done # WHILE LOOP โ€” runs while condition is true COUNT=1 while [ $COUNT -le 5 ]; do echo "Attempt $COUNT" COUNT=$(( COUNT + 1 )) done # UNTIL LOOP โ€” runs UNTIL condition becomes true until [ $COUNT -gt 10 ]; do echo "Waiting... $COUNT" COUNT=$(( COUNT + 1 )) done

Functions & I/O Redirection

Shell Script โ€” Functions
#!/bin/bash # Define a function deploy_app() { local APP=$1 # $1 = first argument local ENV=$2 # $2 = second argument echo "Deploying $APP to $ENV..." docker pull $APP:latest docker run -d --name $APP $APP:latest echo "โœ… $APP deployed to $ENV" } # Call the function deploy_app "myapp" "production" deploy_app "api" "staging"
Shell Script โ€” I/O Redirection
# Linux has 3 standard streams: # 0 = stdin (Standard Input) # 1 = stdout (Standard Output) # 2 = stderr (Standard Error) # Output redirection echo "Hello" > output.txt # OVERWRITE (careful!) echo "World" >> output.txt # APPEND (safe) # Input redirection mysql -u root -p mydb < backup.sql # feed SQL file as input # Error redirection ./deploy.sh 2> errors.log # send errors to file ./deploy.sh &> all.log # send BOTH stdout and stderr # Discard output entirely (send to /dev/null) ./noisy-script.sh > /dev/null 2>&1 # Pipe โ€” send output of one command as input to another cat app.log | grep "ERROR" | tail -20 ps aux | grep nginx
๐Ÿš€ Mini Project โ€” Automated Backup Script
backup.sh
#!/bin/bash DATE=$(date +%Y-%m-%d) BACKUP_DIR="/backups/$DATE" SOURCE_DIR="/var/www/html" mkdir -p $BACKUP_DIR cp -r $SOURCE_DIR $BACKUP_DIR echo "Backup completed: $BACKUP_DIR" # Upload to S3 aws s3 cp $BACKUP_DIR s3://my-backups/$DATE --recursive echo "โœ… Backup uploaded to S3"
โœ… Module Summary
  • A shell translates your commands to the kernel โ€” bash is the most common
  • Shell scripts automate repetitive Linux commands โ€” start with #!/bin/bash
  • Variables: NAME=value, access with $NAME, read input with read
  • Conditions: if/elif/else; Loops: for, while, until
  • Functions: group reusable commands, pass arguments with $1, $2...
  • Redirection: > overwrites, >> appends, 2> errors, &> both
  • Pipe | chains commands โ€” the backbone of all DevOps automation
Next Module โ†’
๐Ÿ”จ Maven โ€” Build Tool
Software needs to be "built" before deployment. Maven automates this for Java projects.
โ†’
๐Ÿ”จ
Module 06 โ€” Code & Build

Maven โ€” Build Tool

What Problem Does Maven Solve?

When you write Java code, your computer can't run it directly. You need to: compile it (translate to machine code), download external libraries, run tests, and package everything into a single deployable file. Doing this manually for every developer on a team is chaotic.

๐Ÿ—๏ธ Analogy โ€” Construction Site Manager

Building a house requires ordering materials, scheduling workers, following blueprints. Maven is the construction manager for your Java project. You describe what you want to build (in a file called pom.xml), and Maven handles all the steps: fetching materials (dependencies), building (compilation), testing, and packaging.

The Maven Build Lifecycle

clean
โ†’
compile
โ†’
test
โ†’
package
โ†’
JAR/WAR โœ…
pom.xml โ€” Project Configuration
<project> <groupId>com.mycompany</groupId> <artifactId>my-web-app</artifactId> <version>1.0.0</version> <packaging>jar</packaging> <!-- External libraries my app needs --> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>3.0.0</version> </dependency> </dependencies> </project>

Maven Lifecycle Commands

Terminal โ€” Maven Commands
# Clean old build files mvn clean # Compile source code mvn compile # Run tests mvn test # Package into JAR/WAR file (most common) mvn package BUILD SUCCESS โ†’ Created: target/my-web-app-1.0.0.jar # Do all steps in one command mvn clean install
โœ… Module Summary
  • Maven automates Java project building: compile โ†’ test โ†’ package
  • pom.xml is Maven's configuration file (your project blueprint)
  • Dependencies are automatically downloaded from Maven Central
  • Output is a JAR/WAR file โ€” ready to deploy on any server
Next Module โ†’
๐Ÿค– Jenkins โ€” CI/CD
You can build manually. But what if every Git push automatically triggered a build, test, and deploy? That's CI/CD โ€” and Jenkins does it for you.
โ†’
๐Ÿค–
Module 07 โ€” CI/CD

Jenkins โ€” Continuous Integration & Delivery

What is CI/CD?

CI (Continuous Integration) means: every time a developer pushes code, it's automatically built and tested. No more "it works on my machine!" problems.

CD (Continuous Delivery/Deployment) means: if all tests pass, the code is automatically deployed to production. No manual deployment steps.

๐Ÿญ Analogy โ€” Factory Assembly Line

Imagine a car factory. Old way: workers build the whole car, then quality checks it at the end โ€” finding defects when it's too late. CI/CD way: at every step of the assembly line, the car part is automatically checked. Problems are caught immediately. Jenkins is the factory manager running the assembly line โ€” triggering each step automatically.

Jenkins Pipeline โ€” How It Works

Developer Pushes Code
โ†’
GitHub Webhook
โ†’
Jenkins Triggered
โ†’
Build + Test
โ†’
Deploy ๐Ÿš€

Your First Jenkinsfile

A Jenkinsfile is a script that defines what Jenkins should do. It lives in your project's root directory alongside your code.

Jenkinsfile โ€” CI/CD Pipeline
pipeline { agent any // run on any available server stages { stage('Checkout') { steps { git branch: 'main', url: 'https://github.com/arjun/my-app.git' } } stage('Build') { steps { sh 'mvn clean package' } } stage('Test') { steps { sh 'mvn test' } } stage('Docker Build & Push') { steps { sh 'docker build -t arjun/my-app:${BUILD_NUMBER} .' sh 'docker push arjun/my-app:${BUILD_NUMBER}' } } stage('Deploy') { steps { sh 'kubectl set image deployment/my-app my-app=arjun/my-app:${BUILD_NUMBER}' } } } post { success { echo 'โœ… Pipeline succeeded!' } failure { echo 'โŒ Pipeline failed โ€” check logs!' } } }

Why Docker After Jenkins?

โš ๏ธ Problem Jenkins Reveals

Jenkins builds and deploys perfectly on the build server. But on the production server: "It works in Jenkins but crashes in prod!" Why? Different Java version, different OS, missing libraries. Jenkins automates deployment โ€” but doesn't guarantee the environment is the same everywhere. That's where Docker comes in.

๐Ÿš€ Mini Project โ€” CI/CD Pipeline for a Java App

Set up Jenkins โ†’ Connect to GitHub โ†’ Create a pipeline that builds with Maven, runs tests, builds a Docker image, and deploys to Kubernetes on every push to main branch.

โœ… Module Summary
  • CI = Automatically build & test on every code push
  • CD = Automatically deploy if tests pass
  • Jenkinsfile defines your pipeline as code โ€” stored in Git
  • Jenkins catches bugs early and eliminates manual deployments
Next Module โ†’
๐Ÿณ Docker โ€” Containerization
Package your entire app + its environment into a single portable container. "Works on my machine" becomes "works everywhere."
โ†’
๐Ÿณ
Module 08 โ€” Containers

Docker โ€” Containerization

The "Works on My Machine" Problem

Developer A writes an app on Windows with Python 3.9. Developer B pulls the code on Mac with Python 3.11. The production server runs Linux with Python 3.7. Everyone is confused when things break at each step. This is one of the most frustrating problems in software engineering.

๐Ÿšข Analogy โ€” Shipping Containers

Before shipping containers, loading cargo onto ships was chaotic. Different sizes, different methods, things breaking. Then someone invented the standard shipping container โ€” one size, works on any ship, any truck, any train, any port in the world.

Docker containers are the shipping containers of software. You pack your app, its dependencies, its runtime โ€” everything โ€” into a single container. It runs identically on your laptop, your colleague's laptop, Jenkins, and production. No surprises.

VM vs Container โ€” What's the Difference?

VIRTUAL MACHINE (Heavy) CONTAINER (Lightweight) โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Your App โ”‚ โ”‚ App1 โ”‚ App2 โ”‚ App3 โ”‚ โ”‚ + Libraries โ”‚ โ”‚+Libs โ”‚+Libs โ”‚+Libs โ”‚ โ”‚ + Guest OS (4GB) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ + Hypervisor โ”‚ โ”‚ Container Engine โ”‚ โ”‚ + Host OS โ”‚ โ”‚ (Docker) โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ Host OS โ”‚ Boots in minutes โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Takes GBs of RAM Starts in seconds Full OS overhead Shares host OS kernel

Core Docker Concepts

๐Ÿ“„
Dockerfile
A recipe/blueprint that describes how to build your container image.
๐Ÿ’ฟ
Image
A snapshot built from a Dockerfile. Like a frozen template you can deploy anywhere.
๐Ÿ“ฆ
Container
A running instance of an image. Like a live restaurant vs a recipe book.
๐Ÿ—„๏ธ
Registry
Docker Hub โ€” a store of images. Pull official images or push your own.

Dockerize a Node.js App

Dockerfile
# Start from an official Node.js base image FROM node:18-alpine # Set working directory inside the container WORKDIR /app # Copy dependency files first (for caching) COPY package*.json ./ # Install dependencies RUN npm install # Copy the rest of the application code COPY . . # Expose port 3000 to the outside world EXPOSE 3000 # Command to run when container starts CMD ["node", "app.js"]
Terminal โ€” Build & Run
# Build the image docker build -t my-node-app:1.0 . Successfully built a1b2c3d4e5f6 Successfully tagged my-node-app:1.0 # Run the container docker run -d -p 3000:3000 --name my-app my-node-app:1.0 # Check running containers docker ps CONTAINER ID IMAGE STATUS PORTS a1b2c3d4e5f6 my-node-app:1 Up 2min 0.0.0.0:3000->3000 # View logs docker logs my-app # Stop and remove docker stop my-app && docker rm my-app # Push to Docker Hub docker tag my-node-app:1.0 arjun/my-node-app:1.0 docker push arjun/my-node-app:1.0

Docker Compose โ€” Multi-Container Apps

Real apps have multiple pieces: a web server, a database, maybe a cache. Docker Compose lets you define and run them all together.

docker-compose.yml
version: '3.8' services: web: build: . ports: ["3000:3000"] depends_on: [db] environment: - DB_HOST=db db: image: postgres:15 environment: - POSTGRES_DB=myapp - POSTGRES_PASSWORD=secret volumes: - db-data:/var/lib/postgresql/data volumes: db-data:
Terminal
docker compose up -d # start everything docker compose down # stop everything

Why Kubernetes After Docker?

โš ๏ธ Problem Docker Reveals at Scale

Docker is great for running containers. But what happens when your app needs 100 containers running across 10 servers? Who decides which server runs which container? What if a container crashes โ€” who restarts it? What if traffic spikes โ€” who adds more containers? Docker alone can't answer these questions. You need an orchestrator. That's Kubernetes.

๐Ÿš€ Mini Project โ€” Dockerize a Python Flask App

Write a simple Flask web app โ†’ Create a Dockerfile โ†’ Build the image โ†’ Run it locally โ†’ Push to Docker Hub โ†’ Pull it on your EC2 and run it there. Your app is now portable!

โœ… Module Summary
  • Docker packages apps into portable containers that run anywhere
  • Dockerfile = recipe, Image = packaged product, Container = running instance
  • Containers are lighter and faster than virtual machines
  • Docker Compose manages multi-container applications
  • Docker Hub is the public registry for sharing images
Next Module โ†’
โ˜ธ๏ธ Kubernetes โ€” Container Orchestration
Manage hundreds of Docker containers across dozens of servers automatically โ€” self-healing, scaling, and load balancing included.
โ†’
โ˜ธ๏ธ
Module 09 โ€” Orchestration

Kubernetes

What is Kubernetes?

Kubernetes (K8s) is an open-source system that automatically manages containerized applications at scale. It handles starting, stopping, distributing, scaling, and healing containers โ€” so you don't have to do it manually.

๐Ÿฝ๏ธ Analogy โ€” Restaurant Manager

You have 50 waiters (containers) serving 500 customers across 5 floors (servers). The restaurant manager (Kubernetes): decides which floor each waiter goes to, replaces waiters who go sick automatically, adds more waiters when the restaurant gets busy, ensures every customer gets served. You just tell the manager "I want 50 waiters" โ€” the rest is handled automatically.

Kubernetes Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ KUBERNETES CLUSTER โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ CONTROL PLANE โ”‚ โ”‚ WORKER NODES โ”‚ โ”‚ โ”‚ โ”‚ (The Brain) โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ โ”‚ API Server โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ†’ โ”‚ Node 1 โ”‚ โ”‚ Node 2 โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ Scheduler โ”‚ โ”‚ โ”‚ [Pod][Pod] โ”‚ โ”‚ [Pod][Pod] โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ etcd (database) โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ”‚ โ”‚ Controller Manager โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ Pod = smallest unit in K8s = one or more containers running together

Key Kubernetes Objects

๐Ÿ“ฆ
Pod
Smallest deployable unit. Wraps one or more containers. Has its own IP address.
๐Ÿ”„
Deployment
Manages Pods โ€” ensures X replicas always run. Handles rolling updates.
๐ŸŒ
Service
Stable network endpoint for Pods. Load balances traffic across all replicas.
โš™๏ธ
ConfigMap
Store configuration (env variables) separately from your container image.

Deploy an App on Kubernetes

deployment.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: my-node-app spec: replicas: 3 # run 3 copies at all times selector: matchLabels: app: my-node-app template: metadata: labels: app: my-node-app spec: containers: - name: my-node-app image: arjun/my-node-app:1.0 ports: - containerPort: 3000 --- apiVersion: v1 kind: Service metadata: name: my-node-app-svc spec: type: LoadBalancer selector: app: my-node-app ports: - port: 80 targetPort: 3000
Terminal โ€” kubectl Commands
# Deploy the app kubectl apply -f deployment.yaml deployment.apps/my-node-app created service/my-node-app-svc created # Check pods are running kubectl get pods NAME READY STATUS RESTARTS my-node-app-7d6b8c-abc12 1/1 Running 0 my-node-app-7d6b8c-def34 1/1 Running 0 my-node-app-7d6b8c-ghi56 1/1 Running 0 # Scale up to 10 replicas kubectl scale deployment my-node-app --replicas=10 # Rolling update (zero downtime) kubectl set image deployment/my-node-app my-node-app=arjun/my-node-app:2.0 # If something goes wrong, roll back instantly kubectl rollout undo deployment/my-node-app

Self-Healing โ€” Kubernetes' Superpower

๐Ÿ”„ Watch This Happen

You told Kubernetes: "I want 3 replicas." If one Pod crashes at 3am, Kubernetes automatically starts a new one โ€” within seconds โ€” without anyone waking up. This is called self-healing and it's what makes Kubernetes so powerful for production systems.

๐Ÿš€ Mini Project โ€” Deploy a Full App on K8s

Use Minikube (local K8s) โ†’ Deploy your Dockerized Node.js app โ†’ Expose it via a Service โ†’ Scale it to 5 replicas โ†’ Simulate a pod crash and watch K8s heal itself.

โœ… Module Summary
  • Kubernetes orchestrates containers across multiple servers
  • Pods = containers, Deployments = desired state, Services = networking
  • Self-healing: K8s restarts crashed containers automatically
  • Auto-scaling: handles traffic spikes by adding/removing pods
  • Rolling updates: deploy new versions with zero downtime
Next Module โ†’
๐Ÿ—๏ธ Terraform โ€” Infrastructure as Code
You can manage apps on Kubernetes, but who creates the servers and networks? Terraform lets you define ALL infrastructure in code โ€” no clicking in consoles.
โ†’
๐Ÿ—๏ธ
Module 10 โ€” Infrastructure as Code

Terraform

The Problem: ClickOps

Imagine you manually click through the AWS console to create 5 EC2 instances, 3 S3 buckets, 2 VPCs, security groups, and IAM roles. Three months later, you need to recreate this entire setup for a new client. Or worse โ€” something breaks and you have no idea what the original settings were.

Manual infrastructure = inconsistent, undocumented, irreproducible. This is called "ClickOps" โ€” and it's a DevOps anti-pattern.

๐Ÿ  Analogy โ€” Architectural Blueprint

When a builder constructs a house, they work from a blueprint. The blueprint describes exactly every room, door, pipe, and wire. You can build the same house in Mumbai or Delhi from the same blueprint. Terraform is the blueprint for your cloud infrastructure โ€” write it once, deploy anywhere, recreate identically anytime.

How Terraform Works

Write .tf files
โ†’
terraform init
โ†’
terraform plan
โ†’
terraform apply
โ†’
Infrastructure Created โœ…

Create an EC2 Instance with Terraform

main.tf โ€” Terraform Configuration
# Tell Terraform which cloud provider to use provider "aws" { region = "ap-south-1" # Mumbai region } # Create a VPC resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" tags = { Name = "my-vpc" } } # Create an EC2 instance resource "aws_instance" "web_server" { ami = "ami-0c55b159cbfafe1f0" instance_type = "t2.micro" key_name = "my-key" tags = { Name = "web-server" Environment = "production" } } # Output the public IP address output "server_ip" { value = aws_instance.web_server.public_ip }
Terminal โ€” Terraform Commands
# Download the AWS provider plugin terraform init Terraform has been successfully initialized! # Preview what will be created (no changes yet) terraform plan Plan: 2 to add, 0 to change, 0 to destroy. + aws_vpc.main + aws_instance.web_server # Actually create the infrastructure terraform apply Apply complete! Resources: 2 added. server_ip = "13.233.45.67" # Destroy everything when no longer needed terraform destroy Destroy complete! Resources: 2 destroyed.

Key Benefits of Terraform

๐Ÿ“‹
Documented
Your infrastructure is described in code. New team members can read exactly what was built.
โ™ป๏ธ
Reproducible
Recreate identical environments (dev, staging, prod) from the same code.
๐Ÿ”„
Version Controlled
Store Terraform files in Git. See who changed what and when.
๐ŸŒ
Multi-Cloud
Same tool works for AWS, Azure, GCP, and 1000+ other providers.
๐Ÿš€ Mini Project โ€” Infrastructure Setup with Terraform

Write Terraform code to create: 1 VPC, 2 subnets (public + private), 1 EC2 web server in public subnet, 1 RDS database in private subnet, security groups with proper rules. Then destroy it all with one command.

โœ… Module Summary
  • Terraform manages cloud infrastructure as code โ€” no manual clicking
  • Write .tf files โ†’ terraform plan (preview) โ†’ terraform apply (create)
  • Infrastructure is version-controlled, documented, and reproducible
  • Works with AWS, Azure, GCP, and 1000+ providers
  • terraform destroy removes everything cleanly
Final Module โ†’
๐Ÿ“Š Prometheus & Grafana โ€” Monitoring
Your app is running in production. But how do you know it's healthy? You need monitoring โ€” alerts, dashboards, and insights into your system's performance.
โ†’
๐Ÿ“Š
Module 11 โ€” Monitoring

Prometheus & Grafana

Why Monitoring? The Final Piece

You've built your app, containerized it, deployed it on Kubernetes, automated your pipeline with Jenkins, and provisioned infrastructure with Terraform. But your work isn't done โ€” you need to watch what's happening in production.

Without monitoring: servers could be running at 99% CPU right now and you wouldn't know until users complain. Memory could be slowly leaking. A database could be about to run out of space. Monitoring catches these before they become disasters.

โœˆ๏ธ Analogy โ€” Airplane Cockpit

A pilot doesn't fly blind. The cockpit has hundreds of gauges showing altitude, speed, fuel, engine temperature, wind direction. If anything goes wrong, an alarm sounds immediately. Prometheus is the system collecting all those gauge readings. Grafana is the cockpit dashboard displaying them beautifully.

Prometheus โ€” Metrics Collector

Prometheus is an open-source monitoring system. It "scrapes" (collects) metrics from your applications and servers every few seconds and stores them in a time-series database.

Your App / Kubernetes / Linux โ†“ (exposes metrics at /metrics endpoint) โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ PROMETHEUS โ”‚ โ”‚ Scrapes metrics every 15 sec โ”‚ โ”‚ Stores: CPU%, memory, req/sec โ”‚ โ”‚ Evaluates alert rules โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ†“ โ†“ [Grafana Dashboard] [AlertManager] Beautiful charts โ†’ Slack/Email alerts
prometheus.yml โ€” Configuration
global: scrape_interval: 15s # collect metrics every 15 seconds scrape_configs: - job_name: 'my-node-app' static_configs: - targets: ['localhost:3000'] - job_name: 'kubernetes-nodes' kubernetes_sd_configs: - role: node

PromQL โ€” Querying Your Metrics

Prometheus has its own query language called PromQL. It looks complex but starts simply:

PromQL โ€” Example Queries
# CPU usage % (human-readable) 100 - (avg(irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) # Available memory in GB node_memory_MemAvailable_bytes / 1024 / 1024 / 1024 # HTTP requests per second rate(http_requests_total[5m]) # Alert: disk almost full (node_filesystem_size_bytes - node_filesystem_free_bytes) / node_filesystem_size_bytes > 0.85 # p99 response time histogram_quantile(0.99, rate(http_request_duration_seconds_bucket[5m]))

Grafana โ€” Beautiful Dashboards

Grafana connects to Prometheus and turns raw metrics into stunning, real-time visual dashboards. You can build dashboards with graphs, gauges, heatmaps, and tables โ€” and share them with your whole team.

๐Ÿ“ˆ
Time Series Graphs
See how CPU, memory, and request rates change over time.
๐Ÿ”ด
Alerts
Get Slack/email notifications when CPU > 80% or error rate spikes.
๐Ÿ—‚๏ธ
Pre-built Dashboards
Import ready-made dashboards for Kubernetes, Node.js, and more from grafana.com.
๐Ÿ‘ฅ
Team Sharing
Share dashboards with your entire team. Everyone has visibility.

Deploy the Full Stack with Docker Compose

docker-compose.monitoring.yml
version: '3.8' services: prometheus: image: prom/prometheus:latest ports: ["9090:9090"] volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml grafana: image: grafana/grafana:latest ports: ["3000:3000"] environment: - GF_SECURITY_ADMIN_PASSWORD=admin volumes: - grafana-data:/var/lib/grafana depends_on: [prometheus] node-exporter: image: prom/node-exporter:latest ports: ["9100:9100"] alertmanager: image: prom/alertmanager:latest ports: ["9093:9093"] volumes: grafana-data:
Terminal
docker compose -f docker-compose.monitoring.yml up -d # Prometheus: http://localhost:9090 # Grafana: http://localhost:3000 (admin/admin) # Import dashboard ID 1860 from grafana.com for Node Exporter Full ๐ŸŽ‰
๐Ÿš€ Final Mini Project โ€” Full Monitoring Stack

Deploy Prometheus + Grafana + Node Exporter on your EC2 server โ†’ Import the "Node Exporter Full" dashboard from Grafana.com โ†’ Set up an alert that fires on Slack when CPU usage exceeds 70% for 5 minutes.

๐ŸŽ“ You've Completed the DevOps Journey!

โœ… Core DevOps Stack โ€” Modules 01โ€“11 Complete!
  • โ˜๏ธ Cloud Computing + AWS โ€” On-demand infrastructure, EC2, S3, IAM, VPC
  • ๐Ÿง Linux โ€” Architecture, command line, permissions, user management
  • ๐ŸŒฟ Git & GitHub โ€” DVCS, branching strategy, collaboration
  • โšก Shell Scripting โ€” Automation, functions, I/O redirection
  • ๐Ÿ”จ Maven โ€” Build, test, and package Java applications
  • ๐Ÿค– Jenkins โ€” CI/CD pipelines, automated testing and deployment
  • ๐Ÿณ Docker โ€” Containerization, Dockerfiles, Docker Compose
  • โ˜ธ๏ธ Kubernetes โ€” Orchestration, scaling, self-healing, rolling updates
  • ๐Ÿ—๏ธ Terraform โ€” Infrastructure as Code, reproducible environments
  • ๐Ÿ“Š Prometheus & Grafana โ€” Metrics, dashboards, alerting

Continue to Module 5 โ€” AWS Deep Dive to master VPC, S3 storage classes, AWS CLI, Lambda, RDS & DynamoDB โ†’

Next Module โ†’
๐Ÿ”’ VPC & Networking Deep Dive
Now let's go deeper into AWS โ€” understand subnets, security groups, NAT gateways, and how to architect a secure network.
โ†’
๐Ÿ”’
Module 12 โ€” AWS Deep Dive

VPC & Networking in AWS

What is a VPC?

A Virtual Private Cloud (VPC) in AWS is a logically isolated virtual network in the cloud where you can run your own resources securely. It gives you complete control over your networking environment โ€” similar to having your own private data centre, but hosted on AWS infrastructure.

VPC ensures isolation from other users. You control how resources communicate internally and externally.

๐Ÿ˜๏ธ Analogy โ€” Gated Housing Society

Think of a VPC like a gated housing society. The entire society is your VPC. Inside, there are different blocks (subnets) โ€” some blocks face the main road and are accessible to visitors (public subnet), while other blocks are deep inside the society and only residents can access them (private subnet). The main gate is your Internet Gateway, and the security guards are your Security Groups and NACLs.

VPC Architecture

๐ŸŒ INTERNET ๐Ÿšช Internet Gateway VPC 10.0.0.0/16 ๐Ÿ“‹ Route Table 0.0.0.0/0 โ†’ IGW ๐ŸŸข Public Subnet 10.0.1.0/24 ๐Ÿ–ฅ๏ธ EC2 (Web) 10.0.1.10 Public IP โœ“ ๐Ÿ”„ NAT Gateway Outbound only for private subnet ๐Ÿ›ก๏ธ Security Group โ€” port 80, 443 open Stateful: allow in โ†’ auto allow response out Instance-level firewall (ALLOW only) ๐Ÿ”ด Private Subnet 10.0.2.0/24 ๐Ÿ—„๏ธ RDS Database 10.0.2.10 No Public IP โš™๏ธ App Server 10.0.2.20 No Public IP ๐Ÿ›ก๏ธ NACL โ€” subnet-level firewall Stateless: must allow IN and OUT separately Supports both ALLOW and DENY rules internal traffic
A typical 2-tier AWS VPC โ€” public subnet (web servers + NAT) and private subnet (database + app servers)

Key VPC Components Explained

๐Ÿ”ฒ
Subnet
A segment of VPC IP address ranges where you place resources like EC2 and RDS. Each subnet lives in one Availability Zone. Public subnets face the internet; private subnets don't.
๐Ÿ“‹
Route Table
A set of rules that decide where network traffic goes. Each subnet must have a route table. To reach the internet, add a route: 0.0.0.0/0 โ†’ IGW.
๐Ÿšช
Internet Gateway (IGW)
The bridge between your VPC and the internet. Attach it to your VPC and reference it in the route table to enable inbound + outbound traffic for public subnets.
๐Ÿ”„
NAT Gateway
Allows private subnet resources to reach the internet (e.g. to download packages) WITHOUT exposing them. Outbound only โ€” internet can't initiate connections back in.
๐Ÿ›ก๏ธ
Security Group
Acts as a virtual firewall at the instance level. Stateful โ€” allow traffic in, and the response is automatically allowed out. ALLOW rules only.
๐Ÿ”
NACL (Network ACL)
Firewall at the subnet level. Stateless โ€” you must explicitly allow both inbound AND outbound. Supports both ALLOW and DENY rules. Evaluated by rule number (lowest first).

Security Group vs NACL โ€” Side by Side

Feature๐Ÿ›ก๏ธ Security Group๐Ÿ” NACL
Applied atInstance levelSubnet level
StateStateful โ€” auto-allow responsesStateless โ€” must define both directions
RulesALLOW onlyALLOW and DENY
Rule evaluationAll rules evaluated togetherRules evaluated by number (lowest first)
DefaultDeny all inbound, allow all outboundAllow all inbound and outbound
Use caseControl access to individual EC2sBlock IPs at subnet boundary

IP Addressing in AWS

๐Ÿ”ข IPv4 Address Classes

Class A: 0.0.0.0 โ€“ 126.x.x.x (large networks)
Class B: 128.0.0.0 โ€“ 191.x.x.x (medium)
Class C: 192.0.0.0 โ€“ 223.x.x.x (small)
Class D: 224โ€“239.x.x.x (multicast)
Class E: 240โ€“255.x.x.x (experimental)

๐Ÿ“ CIDR Notation

CIDR (Classless Inter-Domain Routing) defines a network using IP + prefix.

10.0.0.0/16 = 65,536 IPs
10.0.1.0/24 = 256 IPs
10.0.1.0/28 = 16 IPs

Formula: 2^(32 - prefix) = total IPs

๐Ÿ”’ Private IP Ranges

These ranges are for private/internal use only โ€” not routable on the public internet:

10.0.0.0/8
172.16.0.0/12
192.168.0.0/16

AWS uses these for your VPC.

โšก Elastic IP (Static Public IP)

By default, EC2 public IPs change every restart. An Elastic IP is a static public IP you reserve โ€” it stays the same even after stop/start. Charged if not attached to a running instance.

Hybrid Cloud: VPN vs Direct Connect

Feature๐Ÿ”’ AWS VPNโšก AWS Direct Connect
ConnectionOver public internet (encrypted)Private dedicated line
SpeedVariable (depends on internet)Consistent, high speed
LatencyHigherLower
CostLowerHigher (physical line)
Setup timeMinutesWeeks
Best forSmall/dev workloads, quick setupProduction, high throughput, compliance
๐Ÿš€ Mini Project โ€” Build a 2-Tier VPC

Create a VPC with CIDR 10.0.0.0/16 โ†’ Add a public subnet 10.0.1.0/24 and private subnet 10.0.2.0/24 โ†’ Attach an Internet Gateway โ†’ Create a route table for the public subnet โ†’ Launch an EC2 in the public subnet โ†’ Launch an RDS in the private subnet โ†’ Verify the EC2 can reach the internet but the RDS cannot be accessed directly from outside.

Next โ†’
๐Ÿชฃ S3 Storage Classes
Learn when to use Standard, IA, Glacier, and Intelligent-Tiering to save costs and meet your data access needs.
โ†’
๐Ÿชฃ
Module 13 โ€” AWS Deep Dive

S3 Storage Classes & Features

S3 Recap + Key Features

Amazon S3 (Simple Storage Service) is object storage โ€” think of it as an infinite hard drive in the cloud. It stores buckets (containers) and objects (files). Bucket names must be globally unique, and a single object can be up to 5 TB.

๐Ÿ’Ž
11 Nines Durability
99.999999999% durability โ€” all S3 classes offer this. AWS replicates your data across multiple devices and facilities automatically.
๐Ÿ“ˆ
Unlimited Scalability
S3 automatically scales with your usage. No capacity planning needed โ€” store 1 file or 1 billion files with no changes to your setup.
๐Ÿ”„
Lifecycle Policies
Automatically transition data between storage classes (e.g. Standard โ†’ IA โ†’ Glacier) after N days. Saves money without manual effort.
๐Ÿ”’
Encryption & ACLs
Encrypt data at rest (SSE-S3, SSE-KMS) and in transit (HTTPS). ACLs control who can access your bucket โ€” disable to keep ownership to bucket owner only.

S3 Storage Classes โ€” Visual Guide

โ† COST ACCESS FREQUENCY: Frequent โ†โ†’ Rare โ†’ STANDARD Highest cost No retrieval fee 99.99% avail ๐ŸŒ Websites Apps Analytics STANDARD-IA Lower storage Retrieval fee โš ๏ธ 99.9% avail ๐Ÿ’พ Backups DR files ONE ZONE-IA 20% cheaper than Std-IA โš ๏ธ 1 AZ only! ๐Ÿ“ Re-creatable data INTELLIGENT TIERING Auto-moves data Small monitor fee ๐Ÿค– Unknown patterns Data Lakes, ML GLACIER INSTANT ms retrieval ๐Ÿ”๏ธ Medical archives GLACIER FLEXIBLE 1โ€“5min to 12hr Long archives DEEP ARCHIVE 12โ€“48hr
S3 storage classes by cost vs access frequency โ€” choose based on how often you need your data

S3 Storage Classes โ€” Quick Reference

ClassAccessRetrievalCostBest For
StandardFrequentInstant, no feeHighestWebsites, active data
Standard-IAInfrequentInstant, fee appliesLower storageBackups, DR
One Zone-IAInfrequentInstant, fee applies20% < Std-IARe-creatable data
Intelligent-TieringUnknownInstantAuto-optimizedData lakes, ML
Glacier InstantRareMillisecondsLowMedical archives
Glacier FlexibleRare1 min โ€“ 12 hrsLowerLong-term backups
Deep ArchiveVery rare12 โ€“ 48 hrsLowestLegal/financial 7+ yrs
โœ… Cost-Saving Tip

Use S3 Lifecycle Policies to automatically move data: keep new files in Standard for 30 days โ†’ move to Standard-IA for 60 days โ†’ archive to Glacier Flexible after 90 days. This can cut storage costs by 60โ€“90% for older data!

Next โ†’
โŒจ๏ธ AWS CLI
Stop clicking through the console โ€” learn to manage all your AWS resources from the command line.
โ†’
โŒจ๏ธ
Module 14 โ€” AWS Deep Dive

AWS CLI โ€” Command the Cloud

What is the AWS CLI?

The AWS Command Line Interface (CLI) lets you interact with every AWS service by typing commands instead of clicking through the web console. It helps you automate AWS tasks, manage resources, and run operations in scripts โ€” essential for any DevOps workflow.

๐ŸŽฎ Analogy

The AWS Console is like using a touchscreen menu at a restaurant โ€” intuitive but slow. The AWS CLI is like calling the kitchen directly โ€” faster, scriptable, and you can automate the same order 1000 times with a loop.

Setup & Configuration

Terminal โ€” AWS CLI Setup
# Install AWS CLI (Ubuntu/Debian) curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip && sudo ./aws/install aws --version aws-cli/2.x.x Python/3.x Linux/x86_64 # Configure with your IAM credentials aws configure AWS Access Key ID: AKIAIOSFODNN7EXAMPLE AWS Secret Access Key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Default region name: ap-south-1 Default output format: json # Test your connection aws sts get-caller-identity

EC2 Commands

Terminal โ€” EC2 via CLI
# List all EC2 instances in region aws ec2 describe-instances # Start / Stop / Terminate aws ec2 start-instances --instance-ids i-1234567890abcdef0 aws ec2 stop-instances --instance-ids i-1234567890abcdef0 aws ec2 terminate-instances --instance-ids i-1234567890abcdef0 # Launch a new EC2 instance aws ec2 run-instances \ --image-id ami-0abcdef1234567890 \ --count 1 \ --instance-type t2.micro \ --key-name my-keypair \ --security-group-ids sg-12345678 # List key pairs and security groups aws ec2 describe-key-pairs aws ec2 describe-security-groups

S3 Commands

Terminal โ€” S3 via CLI
# List all S3 buckets aws s3 ls # List contents of a bucket aws s3 ls s3://my-bucket-name # Upload a file to S3 aws s3 cp myfile.txt s3://my-bucket-name/myfile.txt # Download a file from S3 aws s3 cp s3://my-bucket-name/myfile.txt ./myfile.txt # Sync entire folder to S3 (like rsync) aws s3 sync ./my-website s3://my-bucket-name # Delete a file from S3 aws s3 rm s3://my-bucket-name/myfile.txt # Create and delete buckets aws s3 mb s3://my-new-bucket aws s3 rb s3://my-empty-bucket aws s3 rb s3://my-bucket --force # force-delete with contents

VPC Commands

Terminal โ€” VPC via CLI
# Create a VPC aws ec2 create-vpc --cidr-block 10.0.0.0/16 # Create subnets aws ec2 create-subnet --vpc-id vpc-xxx --cidr-block 10.0.1.0/24 # Create and attach Internet Gateway aws ec2 create-internet-gateway aws ec2 attach-internet-gateway --vpc-id vpc-xxx --internet-gateway-id igw-xxx # Route table: create โ†’ add route โ†’ associate with subnet aws ec2 create-route-table --vpc-id vpc-xxx aws ec2 create-route --route-table-id rtb-xxx --destination-cidr-block 0.0.0.0/0 --gateway-id igw-xxx aws ec2 associate-route-table --route-table-id rtb-xxx --subnet-id subnet-xxx # Create security group with a rule aws ec2 create-security-group --group-name web-sg --description "Web SG" --vpc-id vpc-xxx aws ec2 authorize-security-group-ingress --group-id sg-xxx --protocol tcp --port 80 --cidr 0.0.0.0/0 # Cleanup (order matters!) aws ec2 terminate-instances --instance-ids i-xxx aws ec2 delete-subnet --subnet-id subnet-xxx aws ec2 detach-internet-gateway --internet-gateway-id igw-xxx --vpc-id vpc-xxx aws ec2 delete-internet-gateway --internet-gateway-id igw-xxx aws ec2 delete-route-table --route-table-id rtb-xxx aws ec2 delete-security-group --group-id sg-xxx aws ec2 delete-vpc --vpc-id vpc-xxx
๐Ÿš€ Mini Project โ€” Full CLI Workflow

Without touching the AWS Console: create a VPC + subnet + IGW โ†’ launch an EC2 inside it โ†’ upload a file to S3 โ†’ SSH into the EC2 โ†’ download the file from S3 โ†’ clean up everything. This is exactly the kind of automation you'd put in a bash script or CI/CD pipeline.

Next โ†’
โšก Lambda, RDS & More
Explore AWS services every DevOps engineer uses: serverless functions, managed databases, notifications, and monitoring.
โ†’
โšก
Module 15 โ€” AWS Deep Dive

Lambda, RDS, DynamoDB & More

AWS Lambda โ€” Serverless Computing

AWS Lambda lets you run code without provisioning or managing servers. You upload your function, define when it triggers, and AWS handles everything else. You pay only for the compute time you use โ€” down to the millisecond.

๐Ÿ’ก Analogy โ€” Electricity

Running a traditional server is like buying a generator and running it 24/7. Lambda is like using the electrical grid โ€” you only pay for the watts you actually use. When no one's using your function, it costs nothing.

๐Ÿ””
Push-Based (Sync)
Event source triggers Lambda and waits for a response. Used when the caller needs an instant result. Example: API Gateway calling a Lambda function to return a response to a user.
๐Ÿ“ค
Push-Based (Async)
Event source fires and doesn't wait. Events are queued and retried on failure. Useful for background processing. Example: S3 upload triggers a Lambda to resize an image.
๐Ÿ”„
Pull-Based (Streams)
Lambda polls the event source for new data. Processes in batches. AWS manages the polling and scaling. Example: Lambda reading from a DynamoDB stream or SQS queue.
๐Ÿ•
Canary Functions
A scheduled Lambda that monitors a website by visiting it โ€” like a synthetic health check. Can alert you if a page is down or returns unexpected content.
TRIGGERS ๐ŸŒ API GW ๐Ÿชฃ S3 Event โฐ Schedule ฮป LAMBDA Your code runs here OUTPUTS ๐Ÿ—„๏ธ DynamoDB ๐Ÿ”” SNS Alert ๐Ÿชฃ S3 Write ๐Ÿ’ฐ Pay Per Use Only charged when function runs
Lambda: event sources trigger your function โ†’ your code runs โ†’ results are sent to outputs

Amazon SNS โ€” Simple Notification Service

SNS is a messaging service under the Application Integration category. It's used to send notifications to many subscribers at once. The key components are topics (a channel) and subscriptions (who receives from that channel).

๐Ÿ“ข Topics

A topic is a communication channel. Publishers send messages to the topic. Think of it like a broadcast announcement system โ€” one message sent to the topic reaches all subscribers.

๐Ÿ“ฌ Subscriptions

Subscribers choose how to receive notifications: via email, SMS, HTTP endpoint, Lambda, SQS, or mobile push. One topic can have millions of subscribers.

CloudWatch โ€” AWS Monitoring

Amazon CloudWatch is used to monitor AWS resources and applications. It falls under the Management & Governance category.

๐Ÿ“Š
Metrics
Every AWS resource publishes metrics automatically. EC2 gives you CPU usage, network I/O, disk I/O. You can also create custom metrics from your application code.
๐Ÿ“ˆ
Dashboards
View multiple metrics in one place. AWS provides automated dashboards for common services, and you can build your own custom dashboards combining any metrics.
๐Ÿ””
Alarms
Set thresholds and get notified. Three states: OK, ALARM, and INSUFFICIENT_DATA. An alarm triggers actions: send SNS notification, scale EC2, or stop an instance.
โšก
Events / EventBridge
Captures changes in your AWS environment (e.g., EC2 state changes) and triggers targets like Lambda, SNS, or SQS based on rules. Great for automated responses to events.

RDS vs DynamoDB โ€” Which Database to Use?

Feature๐Ÿ—„๏ธ Amazon RDSโšก Amazon DynamoDB
TypeRelational (SQL) โ€” tables with rows and columnsNoSQL โ€” key-value and document-based
EnginesMySQL, PostgreSQL, Oracle, MariaDB, SQL Server, AuroraDynamoDB only (proprietary)
SchemaFixed schema โ€” define columns upfrontSchema-less โ€” each item can have different attributes
ScalingVertical (bigger instance) + read replicasAutomatic, horizontal, to millions of req/sec
LatencyLow (milliseconds)Ultra-low (single-digit milliseconds)
Best forComplex queries, relationships, financial dataReal-time apps, gaming, IoT, mobile backends
Multi-regionMulti-AZ for HAGlobal Tables โ€” multi-region replication built-in
โœ… Rule of Thumb

If your data has complex relationships and you need SQL queries (JOINs, transactions) โ†’ use RDS. If you need massive scale, flexible schema, and single-digit ms latency with simple access patterns โ†’ use DynamoDB.

Next โ†’
๐Ÿ” DevSecOps Basics
Learn how to bake security into every stage of your DevOps pipeline.
โ†’
๐ŸŽฏ
Module 17 โ€” Career Prep

Interview Prep โ€” DevOps & Cloud

How to Approach DevOps Interviews

DevOps interviews test three things: conceptual understanding (can you explain it simply?), practical knowledge (have you actually done it?), and problem-solving (can you debug a broken pipeline?). Always answer with real examples โ€” even if they're from personal projects.

๐Ÿ”ถ AWS Interview Questions

Q: What is the difference between EC2 and Lambda?

EC2 is a virtual machine that you provision and manage โ€” you pay per hour whether the server is doing work or sitting idle. Lambda is serverless โ€” you write a function, AWS runs it when triggered, and you pay only for the milliseconds it actually runs. Use EC2 for long-running workloads, Lambda for event-driven short-lived tasks.

Q: What is the difference between Security Group and NACL?

Security Groups are stateful firewalls at the instance level โ€” allow inbound, and the return traffic is automatically allowed. They support ALLOW rules only. NACLs are stateless firewalls at the subnet level โ€” you must explicitly define both inbound and outbound rules. They support both ALLOW and DENY. Use Security Groups for instance-level control and NACLs for blocking specific IPs at the subnet boundary.

Q: What is the difference between Public and Private Subnet?

A public subnet has a route to the Internet Gateway, so resources inside can be accessed from the internet (and can access it). A private subnet has no direct route to the internet โ€” resources inside are not directly reachable from outside. Private resources use a NAT Gateway if they need to make outbound internet calls (e.g. to download packages).

Q: What is IAM and why is it important?

IAM (Identity Access Management) controls who can do what in your AWS account. It's the foundation of AWS security. You create users (individuals), groups (collections of users), roles (temporary identities for services to assume), and policies (JSON documents defining permissions). The golden rule is Principle of Least Privilege โ€” give only the minimum permissions needed.

Q: What is S3 and what are its storage classes?

S3 is object storage for any type of data. Key classes: Standard (frequent access, highest cost), Standard-IA (infrequent access, lower cost but retrieval fee), Glacier (archival, very low cost, retrieval takes time), and Intelligent-Tiering (auto-moves data between tiers based on access patterns โ€” good when you don't know your access patterns). All classes offer 11 nines (99.999999999%) durability.

๐Ÿง Linux Interview Questions

Q: What is the difference between a process and a daemon?

A process is any running program โ€” it has a PID, uses CPU and memory, and exits when done. A daemon is a background process that runs continuously without user interaction, usually started at boot. Examples: nginx (web server daemon), sshd (SSH daemon). Daemons typically end in 'd' by convention.

Q: What does chmod 755 mean?

chmod 755 script.sh sets permissions using the octal system: 7 (owner) = read+write+execute (4+2+1), 5 (group) = read+execute (4+1), 5 (others) = read+execute. So the owner can do everything, group and others can read and run but not modify. Always use 755 for scripts you want to be executable.

Q: What is the difference between > and >> in shell?

> redirects output and overwrites the file โ€” use it carefully, it deletes the existing content. >> redirects output and appends to the file, preserving existing content. Example: echo "line1" > file.txt creates/overwrites; echo "line2" >> file.txt adds to the file.

๐ŸŒฟ Git Interview Questions

Q: What is the difference between git merge and git rebase?

git merge creates a new "merge commit" that combines two branches โ€” it preserves the full history of both branches. git rebase rewrites the history by replaying your commits on top of another branch โ€” it creates a cleaner, linear history but rewrites commit hashes. Rule: use merge for public/shared branches, rebase for local cleanup before pushing.

Q: What is git stash?

git stash temporarily saves your uncommitted changes (both staged and unstaged) so you can switch branches or work on something else without committing half-done work. Run git stash pop to restore your saved changes later. Think of it as a clipboard for your work-in-progress.

Q: What is the difference between git fetch and git pull?

git fetch downloads changes from the remote repository but does NOT merge them into your local branch โ€” it just updates your local copy of the remote branches. git pull = git fetch + git merge โ€” it downloads AND merges. Use fetch when you want to see what changed before merging.

๐Ÿณ Docker Interview Questions

Q: What is the difference between a Docker image and a container?

A Docker image is a read-only template โ€” like a recipe or a blueprint. It contains the OS, dependencies, and your application code. A container is a running instance of an image โ€” like a dish cooked from the recipe. You can run many containers from the same image simultaneously. Images are stored in registries (Docker Hub); containers run on your host.

Q: What is the difference between Docker and a VM?

A VM virtualizes an entire computer including its own OS โ€” heavy, slow to start (minutes), uses gigabytes of RAM. Docker containers share the host OS kernel โ€” lightweight, start in seconds, use megabytes. The trade-off: VMs provide stronger isolation (each has its own kernel); containers are faster and more efficient but share the kernel.

Scenario-Based Questions

ScenarioWhat They're TestingKey Points to Cover
"Your deployment just failed in production at 2 AM โ€” what do you do?"Incident response, communicationCheck logs first โ†’ rollback quickly โ†’ alert team โ†’ root cause analysis after service is restored
"Your EC2 instance is running out of disk space โ€” how do you fix it?"Linux, AWS troubleshootingdf -h โ†’ find large files with du โ†’ extend EBS volume or clean logs โ†’ add lifecycle policy
"Your Jenkins pipeline keeps failing โ€” where do you look first?"CI/CD debuggingCheck the console output โ†’ check SCM connection โ†’ verify environment variables and credentials โ†’ check agent status
"How would you set up a completely new AWS environment from scratch?"Architecture, IaCVPC โ†’ subnets โ†’ IGW โ†’ route tables โ†’ security groups โ†’ EC2/ECS โ†’ RDS โ†’ CloudWatch alarms โ†’ Terraform for everything
๐ŸŽฏ Interview Preparation Checklist
  • Can you explain every module in this course to a non-technical person?
  • Have you deployed a real project end-to-end with a CI/CD pipeline?
  • Can you write a Dockerfile and Docker Compose file from scratch?
  • Can you create a VPC with public/private subnets in the AWS Console AND via CLI?
  • Do you have a GitHub repo with your projects to show interviewers?
  • Have you set up Prometheus + Grafana monitoring on at least one app?
  • Can you explain what happens when you type a URL in the browser?
Final Module โ†’
๐Ÿš€ What's Next
Map out your career path and the next tools to learn.
โ†’
๐Ÿ”
Module 12 โ€” Security & Next Steps

DevSecOps Basics

What is DevSecOps?

DevSecOps = Development + Security + Operations. It's the practice of baking security into every stage of the DevOps pipeline โ€” not bolting it on at the end as an afterthought.

The old approach: developers build the app, security team scans it at the end, finds 500 vulnerabilities, everyone panics. The DevSecOps approach: security checks run automatically at every commit, every build, every deployment. Problems are caught when they're cheap to fix โ€” not after you're in production.

๐Ÿ—๏ธ Analogy โ€” Building Safety

Imagine building a skyscraper and only checking if it's structurally sound after it's finished. That would be insane โ€” you'd build safety into every floor as you go. DevSecOps does the same for software: safety at every layer, from the start.

Security at Every Stage

๐Ÿ’ป CODE ๐Ÿ” SAST SCAN ๐Ÿ“ฆ BUILD + SCAN ๐Ÿณ IMAGE SCAN ๐Ÿš€ DEPLOY + POLICY ๐Ÿ“Š MONITOR Secret scanning SonarQube / Semgrep Dependency check Trivy / Snyk OPA / Kyverno Falco / SIEM Security Integrated at Every Stage (Shift Left)
"Shift Left" โ€” move security checks earlier in the pipeline where they're cheaper to fix

Essential Security Practices

๐Ÿ”‘
Never Hardcode Secrets
Never put passwords, API keys, or tokens directly in your code or YAML files. Use environment variables or secret managers (AWS Secrets Manager, Vault).
๐Ÿท๏ธ
Least Privilege (IAM)
Give every user, service, and app only the permissions they need โ€” nothing more. A compromised app with minimal permissions does minimal damage.
๐Ÿ”
Scan Dependencies
Your code uses 100s of open-source libraries. Tools like Snyk or Trivy check them for known vulnerabilities automatically on every build.
๐Ÿ”
HTTPS Everywhere
All traffic to and from your app must be encrypted. Use SSL/TLS certificates. Let's Encrypt provides free certificates. Never serve production over plain HTTP.
๐Ÿ“‹
Audit Logs
Keep logs of who did what and when. AWS CloudTrail records every API call. You need this for compliance, debugging, and catching attackers.
๐Ÿ›ก๏ธ
Network Segmentation
Don't put your database on the public internet. Use private subnets (VPC). Only your app servers should be able to reach the database โ€” nothing else.

Secrets Management โ€” The Right Way

BAD vs GOOD โ€” Secrets Handling
# โŒ NEVER DO THIS โ€” hardcoded secrets in code DB_PASSWORD="mypassword123" # visible to everyone with repo access! API_KEY="sk-abc123xyz" # gets committed to Git history forever # โœ… Use environment variables export DB_PASSWORD="$(cat /run/secrets/db_pass)" # โœ… In Docker Compose โ€” use env files env_file: - .env # .env is in .gitignore โ€” never committed # โœ… In Kubernetes โ€” use Secrets kubectl create secret generic db-secret \ --from-literal=password=mypassword # โœ… In AWS โ€” use Secrets Manager aws secretsmanager get-secret-value --secret-id prod/db/password
โš ๏ธ Real-World Warning

Every week, developers accidentally commit API keys to public GitHub repos. Attackers have bots that scan GitHub 24/7 for leaked credentials. A leaked AWS key can result in a โ‚น10 lakh bill within hours from crypto miners. Always add .env to your .gitignore!

Next Module โ†’
๐ŸŽฏ Interview Prep
Practice real interview questions on AWS, Linux, Git, Docker and scenario-based problems to get job-ready.
โ†’
๐Ÿš€
Module 18 โ€” Final

What's Next After This Course

You've Completed DevOps Zero to Hero! ๐ŸŽ‰

You've gone from zero knowledge to understanding the complete DevOps lifecycle. Now it's time to think about where to take this next. The DevOps field is massive โ€” here's a map of the paths ahead.

Your DevOps Career Roadmap

๐Ÿง‘โ€๐Ÿ’ป YOU DevOps Engineer โ˜๏ธ Cloud Architect AWS/GCP/Azure Expert ๐Ÿ”ง SRE Engineer Site Reliability, Uptime ๐Ÿ—๏ธ Platform Engineer Internal Dev Platform ๐Ÿค– MLOps Engineer AI/ML Pipelines ๐Ÿ” DevSecOps Lead Security Specialist ๐Ÿ’ฐ FinOps Engineer Cloud Cost Optimization
Six career paths you can take from your DevOps foundation

Certifications to Aim For

๐Ÿ”ถ
AWS Solutions Architect Associate
The most in-demand cloud cert globally. Validates your ability to design and deploy scalable AWS architectures. Start here if you're cloud-focused.
โ˜ธ๏ธ
CKA โ€” Certified Kubernetes Admin
The gold standard for Kubernetes. Hands-on exam where you solve real cluster problems in a live terminal. Highly respected by employers.
๐Ÿ—๏ธ
HashiCorp Terraform Associate
Proves you can write production-grade Infrastructure as Code with Terraform. Great complement to any cloud cert.
๐Ÿณ
Docker Certified Associate
Validates containerization expertise. Good stepping stone before the CKA Kubernetes certification.

Tools to Learn Next

CategoryToolWhy Learn It
GitOps / CDArgoCDSync Kubernetes deployments automatically from Git โ€” the modern CD approach
Service MeshIstioAdvanced networking, traffic management, and security between microservices
Config ManagementAnsibleAutomate server setup and configuration at scale without writing code
Log ManagementELK StackElasticsearch + Logstash + Kibana โ€” centralized logging for distributed apps
Secret ManagementHashiCorp VaultIndustry standard for secrets, tokens, certificates management
PlatformGitHub ActionsCI/CD built right into GitHub โ€” simpler alternative to Jenkins for many teams
โœ… The Most Important Advice

Build things. Break things. Fix things. No certification or tutorial replaces the learning you get from deploying a real app, watching it fail, and figuring out why. Pick a personal project โ€” even a simple website โ€” and take it all the way through the pipeline you've learned here. That's how DevOps engineers are made.

๐Ÿš€ Ultimate Capstone Project

Build a complete DevOps pipeline from scratch: Create a simple Node.js or Python app โ†’ Push to GitHub โ†’ Set up a Jenkins CI/CD pipeline โ†’ Build a Docker image โ†’ Deploy to Kubernetes on AWS (EKS) โ†’ Set up Terraform to provision the infrastructure โ†’ Monitor with Prometheus + Grafana โ†’ Add security scanning with Trivy. This single project will demonstrate everything in this course to any employer.

โ† Go Back
๐Ÿ  Return to Home
Review the roadmap and revisit any module you want to practice more.
โ†