DevOps

Content Overview

  1. Learn DevOps Made Easy
    1. Introduction
  2. Chapter 1: What is DevOps?
    1. 1.1 Definition and Simple Explanation
    2. 1.2 History and Evolution of DevOps
    3. 1.3 Why DevOps Matters
    4. 1.4 Where DevOps is Used
    5. 1.5 DevOps Lifecycle
    6. 1.6 DevOps Culture and Principles
    7. 1.7 Agile and DevOps Relationship
    8. 1.8 SDLC: Waterfall vs Agile vs DevOps
  3. Chapter 2: Prerequisites for DevOps
    1. 2.1 Basic Computer Science Concepts
    2. 2.2 Networking Fundamentals
    3. 2.3 Operating System Fundamentals
    4. 2.4 Linux Fundamentals
    5. 2.5 Command Line Interface (CLI)
    6. 2.6 Environment Setup
  4. Chapter 3: Version Control Systems
    1. 3.1 Git Fundamentals
    2. 3.2 Git Workflows
    3. 3.3 Branching Strategies (Git Flow)
    4. 3.4 Pull Requests and Code Reviews
  5. Chapter 4: Programming and Scripting for DevOps
    1. 4.1 Bash Scripting
    2. 4.2 Python for DevOps
    3. 4.3 Package Management
    4. 4.4 Cron Jobs and Task Automation
  6. Chapter 5: Server Administration
    1. 5.1 VPS and Dedicated Servers
    2. 5.2 Web Servers: Apache and Nginx
    3. 5.3 Domain and DNS Management
    4. 5.4 SSL/TLS Configuration
    5. 5.5 CDN: Cloudflare and Fastly
  7. Chapter 6: Containerization with Docker
    1. 6.1 What are Containers?
    2. 6.2 Docker Images and Containers
    3. 6.3 Docker Volumes and Networks
    4. 6.4 Docker Compose for Multi-Container Apps
    5. 6.5 Docker Best Practices
  8. Chapter 7: Cloud Platforms
    1. 7.1 Cloud Service Models (IaaS, PaaS, SaaS)
    2. 7.2 AWS (EC2, S3, IAM, RDS, VPC)
    3. 7.3 Google Cloud Platform (GCP)
    4. 7.4 Deployment and Scaling Strategies
  9. Chapter 8: CI/CD – Continuous Integration and Continuous Delivery
    1. 8.1 What is CI/CD?
    2. 8.2 Build Tools and Artifact Management
    3. 8.3 CI/CD Tools (GitHub Actions, Jenkins, Bitbucket Pipelines)
    4. 8.4 Pipeline Design and Pipeline as Code
    5. 8.5 Automated Deployments
  10. Chapter 9: Infrastructure as Code (IaC)
    1. 9.1 What is IaC?
    2. 9.2 Declarative vs Imperative Infrastructure
    3. 9.3 Terraform
    4. 9.4 AWS CloudFormation
  11. Chapter 10: Orchestration with Kubernetes
    1. 10.1 Kubernetes Architecture
    2. 10.2 Pods, Services, Deployments
    3. 10.3 Helm Package Manager
    4. 10.4 Service Mesh
  12. Chapter 11: Configuration Management
    1. 11.1 Ansible
    2. 11.2 Declarative vs Imperative in Config Management
  13. Chapter 12: Monitoring, Logging, and Observability
    1. 12.1 Prometheus and Grafana
    2. 12.2 ELK Stack (Elasticsearch, Logstash, Kibana)
    3. 12.3 Distributed Tracing
    4. 12.4 Centralized Logging
  14. Chapter 13: Security in DevOps (DevSecOps)
    1. 13.1 SSH Hardening and Firewalls
    2. 13.2 Secrets Management
    3. 13.3 Identity and Access Management (IAM)
    4. 13.4 Container Security
  15. Chapter 14: Advanced DevOps Practices
    1. 14.1 Microservices Architecture
    2. 14.2 High Availability and Load Balancing
    3. 14.3 Auto Scaling
    4. 14.4 Disaster Recovery
    5. 14.5 Blue-Green and Canary Deployments
    6. 14.6 GitOps
    7. 14.7 Chaos Engineering and SRE
  16. Chapter 15: The 12-Month Structured Path
    1. 15.1 Phase 1 (Months 1–2): Operating Systems, Networking & Version Control
    2. 15.2 Phase 2 (Months 3–4): Server Administration & Scripting
    3. 15.3 Phase 3 (Months 5–6): Containerization
    4. 15.4 Phase 4 (Months 7–8): Cloud Platforms
    5. 15.5 Phase 5 (Months 9–10): CI/CD Pipelines
    6. 15.6 Phase 6 (Month 11): Infrastructure as Code
    7. 15.7 Phase 7 (Month 12): Orchestration, Monitoring & Security
    8. 15.8 Phase 8: Advanced Practices (Ongoing)
  17. Chapter 16: Internal Working of DevOps
    1. 16.1 Full Execution Flow
    2. 16.2 DevOps Pipeline Flow
    3. 16.3 Runtime and System Interaction
    4. 16.4 Memory and Execution Flow
    5. 16.5 Module System in DevOps
  18. Chapter 17: Final Skill Stack and Conclusion
    1. 17.1 Final Skill Stack
    2. 17.2 Final Thoughts

Learn DevOps Made Easy

Introduction

Every modern application, cloud platform, microservice architecture, and enterprise system depends on DevOps. When a developer writes code, they need a way to build, test, deploy, and monitor that code efficiently. Without DevOps, software delivery is slow, error-prone, and frustrating.

Whether you are deploying a simple web application, managing a cloud-native platform, or operating a global e-commerce system, DevOps is involved somewhere in the process.

For beginners, one of the most confusing topics is understanding the difference between development and operations, and how they work together. Many tutorials start with programming languages and ignore the infrastructure layer that makes software delivery possible.

This guide focuses entirely on practical DevOps practices, tools, and workflows. By the end of this guide, you will understand:

  • What DevOps is and why it matters
  • The DevOps lifecycle and culture
  • Version control with Git
  • Linux server administration
  • Scripting and automation (Bash, Python)
  • Containerization with Docker
  • Cloud platforms (AWS, GCP)
  • CI/CD pipelines
  • Infrastructure as Code (Terraform)
  • Orchestration with Kubernetes
  • Configuration management (Ansible)
  • Monitoring, logging, and observability
  • Security in DevOps (DevSecOps)
  • Advanced practices (microservices, high availability, GitOps)

The goal is not merely to learn tools but to understand how development and operations work together to deliver software faster, safer, and more reliably.

Chapter 1: What is DevOps?

1.1 Definition and Simple Explanation

DevOps is a combination of two words: Dev (Development) and Ops (Operations). It is a way of working where the people who write code (developers) and the people who run the servers (operations) work together as one team.

A simple analogy for a child:

Imagine you are building a Lego castle. The “developer” is the person who designs the castle and puts the bricks together. The “operations” person is the one who makes sure the castle stands firmly on the table, doesn’t fall, and is protected from a little brother who might knock it over.

In the old days, the designer would throw the castle over the wall to the operator, and they would never talk. The operator would say, “This castle is wobbly!” and the designer would say, “Not my problem!” DevOps says: Work together from the start.

Formal definition:

DevOps is a methodology and engineering practice that combines software development (Dev) and IT operations (Ops) to shorten the development lifecycle while delivering high-quality software continuously. It focuses on automation, collaboration, monitoring, and rapid iteration.

1.2 History and Evolution of DevOps

Before DevOps (Waterfall Era – 1980s–1990s):

  • Developers wrote code for months or years
  • Then they handed it to operations to deploy
  • Deployments were painful, slow, and often failed
  • Teams blamed each other

Agile Era (2000s):

  • Development became faster with Agile methodologies (Scrum, Kanban)
  • But operations still worked the old way
  • The “wall” between Dev and Ops remained

Birth of DevOps (2009):

  • At a conference in Belgium, Patrick Debois and others started talking about breaking down the wall
  • The first “DevOps Days” conference was held
  • The term “DevOps” was born

Growth (2010–2015):

  • Tools like Docker (2013) and Kubernetes (2014) made DevOps practical
  • Cloud platforms (AWS, GCP, Azure) became popular
  • CI/CD pipelines became standard

Present Day (2016–Now):

  • DevOps is the standard for modern software companies
  • Concepts like DevSecOps (adding security), GitOps (using Git for deployments), and Platform Engineering have emerged

1.3 Why DevOps Matters

Problem Before DevOpsSolution with DevOps
Deployments took monthsDeployments take minutes or hours
Teams blamed each otherTeams collaborate
Manual steps caused errorsAutomation reduces errors
Slow feedbackContinuous monitoring and feedback
Hard to scaleEasy to scale with cloud and containers

Benefits summarized:

  • Faster software delivery – Release new features quickly
  • Improved collaboration – Dev and Ops work as one team
  • Higher system reliability – Fewer crashes and bugs
  • Continuous feedback and improvement – Learn from problems fast
  • Scalable and automated infrastructure – Handle millions of users

1.4 Where DevOps is Used

DevOps is used everywhere software runs:

IndustryExample
Web applicationsAmazon, Netflix, eBay
Cloud-native systemsUber, Airbnb, Spotify
Enterprise softwareBanks, insurance companies
Microservices architecturesLarge-scale systems
AI/ML pipelinesTraining and deploying AI models
Mobile backend systemsInstagram, TikTok, Snapchat
GamingOnline multiplayer games (Fortnite, Roblox)

1.5 DevOps Lifecycle

The DevOps lifecycle has 8 stages that continuously loop:

Plan → Code → Build → Test → Release → Deploy → Operate → Monitor → (back to Plan)
StageWhat happensTools
PlanDecide what to buildJira, Trello, Asana
CodeWrite the softwareGit, VS Code, IntelliJ
BuildCompile and packageJenkins, GitHub Actions
TestCheck for bugsSelenium, JUnit, PyTest
ReleasePrepare for deploymentArtifactory, Nexus
DeployPut software on serversKubernetes, Ansible, Terraform
OperateRun and manageDocker, Kubernetes
MonitorWatch for problemsPrometheus, Grafana, ELK

1.6 DevOps Culture and Principles

DevOps is not just about tools – it is about culture (how people think and act).

Core principles:

  • Collaboration – Dev and Ops sit together, share goals, and help each other
  • Automation – Computers should do repetitive work, not humans
  • Continuous Improvement – Always try to get better, little by little
  • Customer Focus – Everything we do is to help the user
  • Blame-Free Post-Mortems – When something breaks, we ask “How can we prevent this?” not “Who did this?”
  • Small Batches – Make small changes often, not big changes rarely

1.7 Agile and DevOps Relationship

Agile is a way to develop software in small, fast cycles (called sprints). DevOps extends Agile by including operations.

Agile does…DevOps adds…
Fast codingFast deployment
User storiesInfrastructure as Code
SprintsContinuous delivery
RetrospectivesMonitoring and feedback

Simple analogy:
Agile is the recipe for cooking faster. DevOps is making sure the kitchen, oven, and waiters all work together to get the food to the customer.

1.8 SDLC: Waterfall vs Agile vs DevOps

Waterfall (Old way):

Plan → Design → Code → Test → Deploy → Maintain

(Each stage finishes before the next starts. Takes months.)

Agile:

Plan → Code → Test → Deploy → Repeat every 2 weeks

DevOps:

Plan → Code → Build → Test → Release → Deploy → Operate → Monitor → (Loop continuously, many times per day)
FeatureWaterfallAgileDevOps
Deployment frequencyEvery 6–12 monthsEvery 2–4 weeksMany times per day
Team structureSeparate Dev and OpsDev onlyDev + Ops together
AutomationLowMediumHigh
Feedback speedMonthsWeeksMinutes

Chapter 2: Prerequisites for DevOps

Before you start DevOps, you need some basic knowledge.

2.1 Basic Computer Science Concepts

  • What is an operating system? (Windows, Linux, macOS)
  • What is a process? (A running program)
  • What is memory? (RAM, storage)
  • What is a file system? (How files are organized)

2.2 Networking Fundamentals

You need to understand how computers talk to each other.

ConceptSimple Explanation
IP AddressA computer’s phone number (like 192.168.1.1)
PortA door number on a computer (web uses port 80 or 443)
DNSPhonebook that turns google.com into an IP address
HTTP/HTTPSThe language web browsers use to talk to servers
TCP/IPThe set of rules for sending data across the internet

2.3 Operating System Fundamentals

  • What is a kernel? (The core of the OS)
  • What are processes and threads?
  • What are users and permissions?
  • What is a file system?

2.4 Linux Fundamentals

Linux is the most important operating system for DevOps. Most servers run Linux.

Why Linux?

  • Free and open source
  • Stable and secure
  • Runs on anything (from tiny devices to supercomputers)
  • Most cloud servers are Linux

Popular Linux distributions for DevOps:

  • Ubuntu – Beginner-friendly, great for learning
  • Debian – Very stable
  • CentOS / Rocky Linux – Used in many companies (RHEL family)

2.5 Command Line Interface (CLI)

The command line is a text-based way to control a computer. Instead of clicking icons, you type commands.

Basic commands to learn:

ls          # List files in current folder
cd          # Change directory (move to another folder)
pwd         # Print working directory (show where you are)
mkdir       # Make a new directory
rm          # Remove a file
cp          # Copy a file
mv          # Move a file
cat         # Show contents of a file
grep        # Search inside files
chmod       # Change permissions
ps          # Show running processes
kill        # Stop a process

2.6 Environment Setup

What you need to install on your computer:

  • Virtual Machine software (VirtualBox or VMware) – to run Linux on your Windows/Mac
  • Linux distribution – Download Ubuntu Server or Desktop
  • Terminal emulator – On Windows: WSL2 or Git Bash. On Mac: built-in Terminal
  • Code editor – VS Code (free and excellent)

Chapter 3: Version Control Systems

3.1 Git Fundamentals

What is version control?

Imagine you are writing a story. You save “story_v1.txt”, then “story_v2.txt”, then “story_v3.txt”. That is manual version control. Git does this automatically and lets you go back to any version.

Git is a tool that tracks changes to files. It is the most important tool for DevOps.

Basic Git commands:

git init                    # Start a new Git repository
git add filename.txt        # Tell Git to track this file
git commit -m "message"     # Save a snapshot
git status                  # See what changed
git log                     # See history of commits
git diff                    # See differences between versions

3.2 Git Workflows

Basic workflow (single developer):

  1. Make changes to files
  2. git add . (stage all changes)
  3. git commit -m "description" (save snapshot)
  4. Repeat

Remote workflow (with GitHub/Bitbucket):

git clone https://github.com/user/repo.git   # Download a repository
git pull                                      # Get latest changes from remote
git push                                      # Send your commits to remote

3.3 Branching Strategies (Git Flow)

A branch is a separate line of development. Think of it as a parallel universe where you can make changes without affecting the main universe.

Git Flow (popular branching model):

Branch namePurpose
main (or master)Production-ready code
developIntegration branch for new features
feature/*New features (branched from develop)
release/*Preparing for a new release
hotfix/*Emergency fix for production

Simple workflow:

git checkout -b feature/add-login   # Create and switch to new branch
# ... make changes ...
git add .
git commit -m "Added login feature"
git checkout main
git merge feature/add-login          # Merge the feature into main

3.4 Pull Requests and Code Reviews

A pull request (PR) is a way to ask others to review your code before merging it.

Process:

  1. You push your feature branch to GitHub/Bitbucket
  2. You open a pull request
  3. Your teammates review the code and leave comments
  4. You fix any issues
  5. Someone approves and merges

Why this matters:

  • Catches bugs before they reach production
  • Shares knowledge across the team
  • Improves code quality

Chapter 4: Programming and Scripting for DevOps


4.1 Bash Scripting

Bash is the language of the Linux command line. You can write scripts (lists of commands) to automate tasks.

Basic Bash script (myscript.sh):

#!/bin/bash
echo "Starting deployment..."
cd /var/www/myapp
git pull
sudo systemctl restart nginx
echo "Deployment complete!"

Run the script:

chmod +x myscript.sh   # Make it executable
./myscript.sh          # Run it

Common Bash concepts:

# Variables
name="John"
echo "Hello $name"

# If statements
if [ -f "config.txt" ]; then
    echo "Config file exists"
else
    echo "Config file missing"
fi

# Loops
for i in {1..5}; do
    echo "Number $i"
done

# Functions
deploy() {
    echo "Deploying..."
}
deploy

4.2 Python for DevOps

Python is great for more complex automation. Most DevOps tools have Python APIs.

Example: Automating a server health check

#!/usr/bin/env python3
import subprocess
import requests

# Check disk space
result = subprocess.run(["df", "-h"], capture_output=True, text=True)
print("Disk usage:")
print(result.stdout)

# Check if website is up
try:
    response = requests.get("https://mywebsite.com")
    print(f"Website status: {response.status_code}")
except:
    print("Website is down!")

Why Python for DevOps?

  • Easy to learn and read
  • Huge library ecosystem (boto3 for AWS, kubernetes for K8s)
  • Cross-platform (works on Linux, Windows, Mac)

4.3 Package Management

Package managers install software automatically.

Linux distributionPackage managerCommand
Ubuntu/DebianAPTapt install nginx
CentOS/RHELYUM or DNFyum install nginx

Example: Installing Docker on Ubuntu

sudo apt update                     # Update package list
sudo apt install docker.io          # Install Docker
sudo systemctl start docker         # Start Docker service
sudo systemctl enable docker        # Start Docker on boot

4.4 Cron Jobs and Task Automation

Cron is a Linux tool that runs tasks on a schedule.

Crontab format:

* * * * * command_to_run
│ │ │ │ │
│ │ │ │ └─── Day of week (0-7, 0=Sunday)
│ │ │ └───── Month (1-12)
│ │ └─────── Day of month (1-31)
│ └───────── Hour (0-23)
└─────────── Minute (0-59)

Examples:

# Run every day at 2:30 AM
30 2 * * * /home/user/backup.sh

# Run every Monday at 9 AM
0 9 * * 1 /home/user/weekly_report.sh

# Run every 15 minutes
*/15 * * * * /home/user/health_check.sh

Edit your crontab:

crontab -e   # Edit
crontab -l   # List current jobs

Chapter 5: Server Administration

5.1 VPS and Dedicated Servers

  • VPS (Virtual Private Server) – A virtual computer inside a physical server. It acts like a real server. Examples: DigitalOcean, Linode, Vultr.
  • Dedicated Server – A physical computer just for you. More expensive but more powerful.

For learning: Use a cheap VPS ($5–$10/month) or free tier on AWS/GCP.

5.2 Web Servers: Apache and Nginx

Web servers handle HTTP requests from browsers.

  • Apache – Older, very flexible, uses .htaccess files.
  • Nginx – Newer, faster, great for high traffic. Most popular for DevOps.

Installing Nginx on Ubuntu:

sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx

Basic Nginx configuration (/etc/nginx/sites-available/myapp):

server {
    listen 80;
    server_name mydomain.com;

    root /var/www/myapp;
    index index.php index.html;

    location / {
        try_files $uri $uri/ /index.php?$args;
    }
}

5.3 Domain and DNS Management

  • Domain name – The human-readable address (google.com)
  • DNS (Domain Name System) – Translates domain names to IP addresses

DNS record types:

RecordPurposeExample
APoints domain to IPv4 addressexample.com → 192.168.1.1
AAAAPoints domain to IPv6 addressexample.com → 2001:db8::1
CNAMEPoints domain to another domainwww.example.com → example.com
MXEmail servermail.example.com
TXTText information (verification)google-site-verification=…

5.4 SSL/TLS Configuration

SSL/TLS encrypts traffic between browser and server. HTTPS uses SSL.

Let’s Encrypt provides free SSL certificates. Certbot automates installation.

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d mydomain.com

Now your site works with https://mydomain.com.

5.5 CDN: Cloudflare and Fastly

CDN (Content Delivery Network) – A network of servers around the world that cache your website. Users get files from the nearest server.

Benefits:

  • Faster loading times
  • Protects against DDoS attacks
  • Reduces load on your main server

Cloudflare setup:

  1. Sign up at cloudflare.com
  2. Add your domain
  3. Change your domain’s nameservers to Cloudflare’s
  4. Enable features (SSL, caching, firewall)

Chapter 6: Containerization with Docker

6.1 What are Containers?

Containers are like lightweight virtual machines. They package an application and everything it needs (code, libraries, settings) into a single unit.

Analogy:
A shipping container can hold a car, clothes, or electronics. The same container can go on a ship, a train, or a truck. It doesn’t matter what’s inside – the container works the same way everywhere.

Containers vs Virtual Machines:

FeatureVirtual MachineContainer
SizeGBsMBs
Startup timeMinutesSeconds
IncludesFull OS + appOnly app + dependencies
IsolationStrongLighter

6.2 Docker Images and Containers

  • Image – A blueprint (like a recipe)
  • Container – A running instance of an image (like a baked cake)

Basic Docker commands:

docker pull nginx              # Download an image from Docker Hub
docker images                  # List downloaded images
docker run nginx               # Run a container from an image
docker ps                      # List running containers
docker ps -a                   # List all containers (including stopped)
docker stop container_id       # Stop a container
docker rm container_id         # Delete a container
docker rmi image_id            # Delete an image

Creating your own image with Dockerfile:

FROM ubuntu:22.04
RUN apt update && apt install -y nginx
COPY ./mywebsite /var/www/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Build and run:

docker build -t mywebsite .
docker run -d -p 80:80 mywebsite

6.3 Docker Volumes and Networks

Volumes – Persistent storage for containers. When a container is deleted, data in volumes remains.

docker volume create mydata
docker run -v mydata:/app/data myimage

Networks – Allow containers to talk to each other.

docker network create mynetwork
docker run --network mynetwork --name app1 myimage
docker run --network mynetwork --name app2 myimage
# Now app1 can reach app2 by hostname "app2"

6.4 Docker Compose for Multi-Container Apps

Docker Compose lets you define multiple containers in one file.

docker-compose.yml for a web application:

version: '3.8'
services:
  web:
    image: nginx:latest
    ports:
      - "80:80"
    volumes:
      - ./code:/var/www/html
    depends_on:
      - php
      - mysql

  php:
    image: php:8.1-fpm
    volumes:
      - ./code:/var/www/html

  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_DATABASE: app
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data:

Commands:

docker-compose up -d      # Start all services
docker-compose down       # Stop all services
docker-compose logs       # View logs

6.5 Docker Best Practices

  • Use small base images (Alpine Linux is tiny)
  • One process per container (don’t run both Nginx and MySQL in one container)
  • Use .dockerignore (exclude unnecessary files)
  • Don’t run as root (create a non-root user)
  • Tag your images (use versions, not just latest)

Chapter 7: Cloud Platforms

7.1 Cloud Service Models (IaaS, PaaS, SaaS)

ModelWhat you getExample
IaaS (Infrastructure as a Service)Virtual servers, storage, networkingAWS EC2, Google Compute Engine
PaaS (Platform as a Service)Platform to run apps (no server management)Google App Engine, Heroku
SaaS (Software as a Service)Complete applicationGmail, Google Docs

7.2 AWS (EC2, S3, IAM, RDS, VPC)

AWS (Amazon Web Services) is the most popular cloud platform.

ServiceWhat it does
EC2Virtual servers in the cloud
S3Object storage (files, images, backups)
IAMUsers, permissions, security
RDSManaged databases (MySQL, PostgreSQL)
VPCVirtual private network (your own cloud network)

Basic EC2 setup:

# Connect to EC2 instance via SSH
ssh -i mykey.pem ubuntu@ec2-123-45-67-89.compute-1.amazonaws.com

# Install nginx
sudo apt update
sudo apt install nginx

7.3 Google Cloud Platform (GCP)

GCP offers similar services:

  • Compute Engine (like EC2)
  • Cloud Storage (like S3)
  • Cloud Run (serverless containers)
  • GKE (Kubernetes)

7.4 Deployment and Scaling Strategies

  • Vertical scaling – Make the server bigger (more RAM, more CPU)
  • Horizontal scaling – Add more servers

Load balancer – Distributes traffic across multiple servers.

User → Load Balancer → Server 1
                    → Server 2
                    → Server 3

Chapter 8: CI/CD – Continuous Integration and Continuous Delivery

8.1 What is CI/CD?

Continuous Integration (CI) – Every time a developer pushes code, it is automatically built and tested.

Continuous Delivery (CD) – After testing, the code is automatically deployed to a staging or production environment.

Continuous Deployment – Every change that passes tests goes automatically to production (no manual button).

8.2 Build Tools and Artifact Management

  • Artifact – The result of a build (a .jar file, a Docker image, a zip file)
  • Artifact repositories – Nexus, Artifactory, Docker Hub

8.3 CI/CD Tools (GitHub Actions, Jenkins, Bitbucket Pipelines)

GitHub Actions (most beginner-friendly):

# .github/workflows/deploy.yml
name: Deploy to Server

on:
  push:
    branches: [ main ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Build Docker image
        run: docker build -t myapp .
      - name: Push to Docker Hub
        run: |
          echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
          docker push myapp:latest

Jenkins – More powerful, more complex. Great for large organizations.

8.4 Pipeline Design and Pipeline as Code

Pipeline stages:

  1. Checkout – Get code from Git
  2. Build – Compile, create Docker image
  3. Test – Run unit tests, integration tests
  4. Deploy – Put on staging server
  5. Smoke test – Quick test to ensure it works
  6. Deploy to production

Pipeline as Code – Define the pipeline in a file (like GitHub Actions YAML or Jenkinsfile) that lives in your repository.

8.5 Automated Deployments

Example flow:

  1. Developer pushes code to GitHub
  2. GitHub Actions triggers
  3. Tests run
  4. Docker image is built
  5. Image is pushed to Docker Hub
  6. SSH into server runs docker pull and docker restart

Chapter 9: Infrastructure as Code (IaC)

9.1 What is IaC?

Infrastructure as Code means managing servers, networks, and databases using code (not clicking in a web console).

Benefits:

  • Repeatable (run the same code, get the same infrastructure)
  • Version controlled (Git history of your infrastructure)
  • Automated (no manual clicking)

9.2 Declarative vs Imperative Infrastructure

ApproachWhat you doExample
ImperativeWrite steps (do this, then that)Bash script
DeclarativeDescribe the end stateTerraform, Kubernetes YAML

Declarative example (Terraform):
“I want 3 web servers” – Terraform figures out how.

9.3 Terraform

Terraform is the most popular IaC tool. It works with AWS, GCP, Azure, and hundreds of other providers.

Example: Create an AWS EC2 instance with Terraform

# main.tf
provider "aws" {
  region = "us-east-1"
}

resource "aws_instance" "web_server" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t2.micro"

  tags = {
    Name = "MyWebServer"
  }
}

Commands:

terraform init      # Initialize (download providers)
terraform plan      # See what will change
terraform apply     # Create the resources
terraform destroy   # Delete everything

9.4 AWS CloudFormation

CloudFormation is AWS’s native IaC tool. It uses JSON or YAML.

CloudFormation example (YAML):

Resources:
  MyEC2Instance:
    Type: AWS::EC2::Instance
    Properties:
      ImageId: ami-0c55b159cbfafe1f0
      InstanceType: t2.micro

Chapter 10: Orchestration with Kubernetes

10.1 Kubernetes Architecture

Kubernetes (K8s) is a system for running and managing containers across many servers.

Analogy:
Docker is like having a single taxi. Kubernetes is like Uber – it manages a fleet of taxis, assigns them to passengers, and handles breakdowns.

Components:

ComponentRole
Master NodeControls the cluster
Worker NodeRuns containers
PodSmallest unit (one or more containers)
ServiceStable network address for pods
DeploymentDesired state of pods (how many, which image)

10.2 Pods, Services, Deployments

Pod definition (pod.yaml):

apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
spec:
  containers:
  - name: myapp
    image: nginx:latest
    ports:
    - containerPort: 80

Deployment (deployment.yaml):

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: myapp
        image: nginx:latest

Service (service.yaml):

apiVersion: v1
kind: Service
metadata:
  name: myapp-service
spec:
  selector:
    app: myapp
  ports:
  - port: 80
    targetPort: 80
  type: LoadBalancer

Commands:

kubectl apply -f pod.yaml
kubectl get pods
kubectl logs myapp-pod
kubectl delete -f pod.yaml

10.3 Helm Package Manager

Helm is the package manager for Kubernetes. A Helm chart is a packaged application (all YAML files bundled together).

helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-mysql bitnami/mysql
helm list
helm uninstall my-mysql

10.4 Service Mesh

A service mesh (like Istio) manages communication between microservices. It adds features like traffic splitting, retries, and security without changing application code.

Chapter 11: Configuration Management

11.1 Ansible

Ansible automates server configuration. It is agentless (no software to install on target servers – uses SSH).

Example: Install and configure Nginx on multiple servers

# playbook.yml
---
- name: Setup web servers
  hosts: webservers
  become: yes
  tasks:
    - name: Install nginx
      apt:
        name: nginx
        state: present

    - name: Start nginx
      service:
        name: nginx
        state: started
        enabled: yes

    - name: Copy website files
      copy:
        src: ./website/
        dest: /var/www/html/

Run:

ansible-playbook -i inventory.ini playbook.yml

11.2 Declarative vs Imperative in Config Management

ToolApproach
AnsibleMostly imperative (steps) but can be declarative with modules
PuppetDeclarative
ChefImperative
SaltStackBoth

Chapter 12: Monitoring, Logging, and Observability

12.1 Prometheus and Grafana

  • Prometheus collects metrics (CPU usage, memory, request count)
  • Grafana displays those metrics in dashboards

Install Prometheus and Grafana on Kubernetes:

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/kube-prometheus-stack

12.2 ELK Stack (Elasticsearch, Logstash, Kibana)

ComponentRole
ElasticsearchStores and indexes logs
LogstashProcesses and transforms logs
KibanaDashboard for searching logs

Use case: Search all application logs from one place.

12.3 Distributed Tracing

When a request goes through many microservices, distributed tracing follows it across all services.

Tools: Jaeger, Zipkin.

12.4 Centralized Logging

Instead of SSH into each server to see logs, send all logs to one place.

Tools: ELK, Loki, Splunk.

Chapter 13: Security in DevOps (DevSecOps)

13.1 SSH Hardening and Firewalls

SSH hardening tips:

# Disable root login
sudo sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config

# Disable password authentication (use keys only)
sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config

# Change default SSH port (22 to something else)
sudo systemctl restart sshd

Firewall with UFW (Ubuntu):

sudo ufw allow 22/tcp      # SSH
sudo ufw allow 80/tcp      # HTTP
sudo ufw allow 443/tcp     # HTTPS
sudo ufw enable

13.2 Secrets Management

Never put passwords in code! Use secrets management.

Tools:

  • HashiCorp Vault – Enterprise-grade
  • AWS Secrets Manager – On AWS
  • GitHub Secrets – For CI/CD

13.3 Identity and Access Management (IAM)

Principle of least privilege – Give users and services only the permissions they absolutely need.

AWS IAM example: A service that needs to read from S3 should not have permission to delete EC2 instances.

13.4 Container Security

Best practices:

  • Scan images for vulnerabilities (docker scan, trivy)
  • Run containers as non-root user
  • Use minimal base images (Alpine)
  • Keep base images updated

Chapter 14: Advanced DevOps Practices

14.1 Microservices Architecture

Instead of one big application (monolith), split into small services that communicate over APIs.

  • Monolith: One codebase, one database
  • Microservices: Many small services, each with its own database

14.2 High Availability and Load Balancing

High Availability (HA) – The system stays up even if some servers fail.

A load balancer distributes traffic. If one server fails, the load balancer stops sending traffic to it.

14.3 Auto Scaling

Automatically add more servers when traffic is high, remove them when traffic is low.

AWS Auto Scaling Group:

resource "aws_autoscaling_group" "web" {
  min_size = 2
  max_size = 10
  desired_capacity = 2
}

14.4 Disaster Recovery

  • Recovery Time Objective (RTO) – How quickly must the system be restored?
  • Recovery Point Objective (RPO) – How much data loss is acceptable?

Strategies:

  • Backups (daily to S3)
  • Multi-region deployment
  • Active-passive failover
  • Active-active (two regions both live)

14.5 Blue-Green and Canary Deployments

Blue-Green: Two identical environments (blue = old, green = new). Switch traffic from blue to green when ready. Easy rollback (switch back).

Canary: Roll out to 1% of users first. If no errors, increase to 10%, then 50%, then 100%.

14.6 GitOps

GitOps means using Git as the single source of truth for both code and infrastructure. When you merge a pull request, the cluster automatically updates.

Tools: ArgoCD, Flux.

14.7 Chaos Engineering and SRE

Chaos Engineering – Intentionally breaking things to test resilience.

Tool: Chaos Mesh, Gremlin.

Site Reliability Engineering (SRE) – Google’s discipline for running reliable systems. Uses Service Level Objectives (SLOs) and error budgets.

Chapter 15: The 12-Month Structured Path

15.1 Phase 1 (Months 1–2): Operating Systems, Networking & Version Control

Core Focus: System fundamentals

  • Linux: Ubuntu, Debian, CentOS – file system, permissions, users, processes, package managers (apt, yum)
  • Networking: HTTP/HTTPS, DNS, IP, Ports, TCP/IP
  • Git: init, clone, commit, push, pull, branching, pull requests

Project: Setup Linux server and manually deploy a PHP/Magento app

15.2 Phase 2 (Months 3–4): Server Administration & Scripting

Core Focus: Real server handling + automation

  • Bash scripting: Task automation, cron jobs, deployment scripts
  • Server admin: VPS, web servers (Apache, Nginx), domain & DNS, SSL/TLS, CDN

Project: Deploy Magento on VPS with Nginx + SSL + CDN

15.3 Phase 3 (Months 5–6): Containerization

Core Focus: Modern app deployment

  • Docker: Images, containers, volumes, networks, best practices
  • Docker Compose: Multi-container applications

Project: Dockerize Magento (PHP + MySQL + Nginx)

15.4 Phase 4 (Months 7–8): Cloud Platforms

Core Focus: Production infrastructure

  • AWS: EC2, S3, IAM, RDS, VPC
  • GCP: Basic concepts
  • Deployment & scaling strategies

Project: Deploy Magento on AWS (EC2 + RDS + S3 + Domain + SSL)

15.5 Phase 5 (Months 9–10): CI/CD Pipelines

Core Focus: Zero manual deployment

  • GitHub Actions, Jenkins, Bitbucket Pipelines
  • Pipeline design: Build → Test → Deploy

Project: Auto deploy Magento (push code → live deployment)

15.6 Phase 6 (Month 11): Infrastructure as Code

Core Focus: Infrastructure automation

  • Terraform
  • AWS CloudFormation (optional)

Project: Provision AWS infrastructure using Terraform

15.7 Phase 7 (Month 12): Orchestration, Monitoring & Security

Core Focus: Industry-level DevOps

  • Kubernetes, Helm
  • Ansible
  • Prometheus, Grafana, ELK
  • Security: SSH hardening, firewalls, secrets management

Project: Deploy Dockerized Magento on Kubernetes + Monitoring dashboard

15.8 Phase 8: Advanced Practices (Ongoing)

Core Focus: Scalability & architecture

  • Microservices
  • High Availability
  • Load Balancing
  • Auto Scaling
  • Disaster Recovery

Chapter 16: Internal Working of DevOps

16.1 Full Execution Flow

DevOps is not a single tool – it is a pipeline of systems working together.

Step-by-step flow:

  1. Developer writes code
  2. Code is pushed to version control (Git)
  3. CI system detects changes
  4. Code is built and tested automatically
  5. Artifacts (Docker images, binaries) are generated
  6. Infrastructure is provisioned (Terraform)
  7. Application is deployed (Kubernetes, Ansible)
  8. Monitoring tools track system health (Prometheus)
  9. Logs and metrics provide feedback (ELK, Grafana)
  10. Continuous updates are pushed (start over)

16.2 DevOps Pipeline Flow

Code → Build → Test → Release → Deploy → Monitor → Feedback → Iterate

Each stage is automated using tools and scripts.

16.3 Runtime and System Interaction

  • Code runs inside environments (VMs or containers)
  • Infrastructure is managed using IaC tools
  • Applications communicate via APIs
  • Monitoring agents collect metrics
  • Logs are aggregated and analyzed

16.4 Memory and Execution Flow

  • Application loads into system memory
  • OS manages processes and threads
  • Containers isolate runtime environments
  • CPU executes instructions
  • Network stack handles communication

16.5 Module System in DevOps

DevOps systems are modular:

ModuleTool
Version ControlGit
Build SystemJenkins, GitHub Actions
Testing FrameworkJUnit, PyTest
Deployment EngineKubernetes, Ansible
Monitoring StackPrometheus, Grafana

Each module integrates into pipelines via APIs or plugins.

Chapter 17: Final Skill Stack and Conclusion

17.1 Final Skill Stack

After completing this roadmap, you will be able to:

  • Manage Linux servers professionally
  • Deploy applications at production scale
  • Build CI/CD pipelines
  • Work with AWS and cloud platforms
  • Use Docker and Kubernetes
  • Automate infrastructure (IaC)
  • Implement monitoring and security
  • Handle high availability and disaster recovery
  • Work in a professional DevOps team

17.2 Final Thoughts

DevOps is not just a role – it is the backbone of modern software delivery, where development, operations, automation, and scalability converge into one powerful discipline.

To a child starting out:
Imagine you are the captain of a spaceship. You need to fly it (operations), fix it when it breaks (maintenance), and tell your crew what to do (automation). That is DevOps – being the captain who makes everything work together smoothly.

Your journey:

  1. Start with Linux
  2. Learn Git
  3. Learn Docker
  4. Learn CI/CD
  5. Learn Kubernetes

Each step builds on the last. Do not rush – spend time on each phase. Build real projects. Break things and fix them. That is how you learn.

Remember: Every expert was once a beginner. The cloud engineers at Google and Amazon started exactly where you are now. With dedication and practice, you can become a professional DevOps engineer.

Keep learning. Keep automating. Keep shipping.

Scroll to Top