← Back to DevOps

DevOps — Quick Summary

Quick revision: every topic, key terms, and mnemonics for DevOps.


This is a quick revision doc covering all 43 topics in the DevOps collection. Open the linked notes if you want depth — this is meant to re-cement what we already learned.

Linux Fundamentals

Linux Filesystem and Navigation

What it is. Linux follows the FHS (Filesystem Hierarchy Standard). Every distro lays out files in the same predictable directories — once we learn the layout, any Linux box feels familiar.

Key terms.

Commands.

pwd; ls -la; cd ~; cd -
cat / head -20 / tail -f file.log
grep -i "error" app.log; grep -rn "TODO" src/
find . -name "*.log" -mtime -1
ps aux | grep nginx | wc -l
echo "x" >> file; sort data > sorted; cmd 2> err.log
awk '{print $1, $3}' access.log

Remember. Config in /etc, logs in /var/log, our stuff in /home. Pipes are an assembly line. > overwrites, >> appends.

File Permissions and Ownership

What it is. Every file has owner/group/others, each with read/write/execute toggles. A 3x3 grid is the entire system.

Key terms.

Commands.

chmod 755 deploy.sh; chmod +x file
chmod u=rwx,g=rx,o= dir/
chown manish:developers file.txt
chown -R user:group /var/www
umask 0022   # files=644, dirs=755

Remember. rwx → 421, add them per group. 755/644/600 covers 95% of real-world cases.

Process Management

What it is. Every running program is a process. We view them, signal them, and let systemd babysit them.

Key terms.

Commands.

ps aux | grep nginx
top / htop
kill 1234        # SIGTERM
kill -9 1234     # SIGKILL (last resort)
nohup ./job.sh > out.log 2>&1 &
systemctl start|stop|restart|reload|status|enable nginx
journalctl -u nginx -f --since "1 hour ago"

Remember. Always try SIGTERM first, SIGKILL only when stuck. systemctl enable survives reboot, start runs now.

Shell Scripting Essentials

What it is. Shell scripts automate sequences of commands. Every DevOps engineer writes them daily.

Key terms.

Code.

#!/bin/bash
set -euo pipefail
log() { echo "[$(date '+%H:%M')] $1"; }
for svc in nginx postgresql; do
  if systemctl is-active --quiet "$svc"; then
    log "OK $svc"
  else
    log "DOWN $svc"; systemctl restart "$svc"
  fi
done

Remember. No spaces around =. Always quote "$var". set -euo pipefail saves us from silent bugs.

Package Management and System Services

What it is. apt/yum install software, systemctl manages services, cron schedules tasks.

Key terms.

Commands.

sudo apt update && sudo apt install nginx
sudo systemctl enable --now nginx
crontab -e   # */5 * * * * /opt/cron.sh >> /var/log/cron.log 2>&1
journalctl -u nginx --since "30 min ago" -f

Remember. Always apt update before install. After install: enable then start. Use crontab.guru to write cron expressions.

Networking Essentials

OSI Model and TCP/IP

What it is. Networking organized as layers, each with one job. OSI = 7 (theoretical), TCP/IP = 4 (practical).

Key terms.

Mnemonic. OSI top-down: “All People Seem To Need Data Processing” (Application, Presentation, Session, Transport, Network, Data Link, Physical).

Remember. Layer 3 = routing/IP issues. Layer 4 = TCP/firewall/ports. Layer 7 = application/proxy errors. Pick the layer to debug.

DNS and Domain Resolution

What it is. DNS is the phone book of the internet — translates google.com to 142.250.80.46.

Key terms.

Resolution flow. Browser cache → OS cache → recursive resolver → root → TLD (.com) → authoritative → answer.

Commands.

dig pman47.cc +short
dig @8.8.8.8 pman47.cc MX
dig pman47.cc +trace
nslookup -type=MX example.com

Remember. Lower TTL before migration. CNAMEs can’t sit at the root domain. /etc/hosts overrides DNS locally.

HTTP, HTTPS, and TLS

What it is. HTTP = how browsers and servers talk. HTTPS = HTTP wrapped in TLS encryption.

Key terms.

Status code cheatsheet.

CodeMeaning
200OK
201Created
204No Content
301Moved Permanently
302Found (temporary)
304Not Modified
400Bad Request
401Unauthorized (not logged in)
403Forbidden (not allowed)
404Not Found
429Too Many Requests
500Internal Server Error
502Bad Gateway
503Service Unavailable
504Gateway Timeout

Remember. Methods that change state (POST, PATCH) aren’t idempotent. Let’s Encrypt + Caddy = free auto HTTPS.

TCP vs UDP

What it is. Two transport protocols. TCP is reliable, UDP is fast.

Key terms.

Common ports. 22 SSH, 53 DNS, 80 HTTP, 443 HTTPS, 3306 MySQL, 5432 Postgres, 6379 Redis.

Remember. Web/email/SSH/DB → TCP. Video/gaming/DNS/VoIP → UDP. HTTP/3 runs UDP via QUIC (UDP getting reliability layered on top).

Load Balancing

What it is. Distributes traffic across multiple servers for scalability + HA.

Key terms.

Tools. Nginx, HAProxy, Caddy, AWS ALB (L7) / NLB (L4), Traefik.

Remember. Most web traffic uses L7. Avoid sticky sessions — push state to Redis.

Networking Tools and Troubleshooting

What it is. The toolbox for “the site is down” diagnosis.

Key terms.

Commands.

curl -v -I https://example.com
ping -c 4 google.com; traceroute -n google.com
ss -tlnp | grep :80
sudo tcpdump -i any port 443 -A -tttt
sudo ufw allow 22/tcp; sudo ufw enable

Debugging workflow. ping → dig → ss/curl → service logs (journalctl -u, docker logs) → resources (top, df -h, free -h).

Remember. Always curl -v first. Full disk = silent death (df -h early in any debug).

Docker & Containers

Containers vs Virtual Machines

What it is. VMs run a full OS on a hypervisor. Containers share the host kernel via namespaces + cgroups.

Key terms.

Remember. VM = whole apartment. Container = room in a co-living space. Modern stacks run containers inside VMs.

Docker Images and Layers

What it is. An image is a stack of read-only layers. Container = image + thin writable layer.

Key terms.

Commands.

docker history nginx:alpine
docker pull ghcr.io/pman47/gyaan:latest
docker tag my-app:latest ghcr.io/me/my-app:v1
docker push ghcr.io/me/my-app:v1
docker images --digests

Remember. Image = class. Container = object. Layers cache by hash; same base layer is stored once on disk.

Dockerfile Best Practices

What it is. Writing efficient, secure, cache-friendly image builds.

Key terms.

Code.

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM nginx:1.27-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
USER node
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Remember. Copy package.json BEFORE source code so deps cache survives code changes. Never bake secrets into images. Run as non-root.

Docker Networking

What it is. How containers talk to each other and the outside.

Key terms.

Commands.

docker network create my-net
docker run -d --name db --network my-net postgres:16
docker run -d --name app --network my-net -p 8080:3000 my-app
# app reaches db via hostname "db:5432"
docker network ls; docker network inspect my-net

Remember. Use custom bridge networks 90% of the time — they give DNS for free. Containers on the same network reach each other by name.

Docker Volumes and Storage

What it is. Containers are ephemeral. Volumes persist data.

Key terms.

Commands.

docker volume create pg-data
docker run -d -v pg-data:/var/lib/postgresql/data postgres:16
docker run -d -v $(pwd):/app node:20  # bind mount

Remember. Database data → named volumes (always). Source code in dev → bind mounts. tmpfs for secrets you don’t want on disk.

Docker Compose

What it is. Define multi-container apps in one YAML file. One command to start/stop everything.

Key terms.

Code.

services:
  api:
    build: .
    ports: ["3000:3000"]
    environment:
      DATABASE_URL: postgresql://app:secret@db:5432/myapp
    depends_on: [db]
    restart: unless-stopped
  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: app
      POSTGRES_PASSWORD: secret
    volumes:
      - pg-data:/var/lib/postgresql/data
volumes:
  pg-data:

Commands. docker compose up -d, down, logs -f, exec, ps, restart.

Remember. Service name IS the hostname. depends_on doesn’t wait for the app inside — use healthchecks for that.

Container Debugging and Commands

What it is. When containers crash or misbehave, here’s the toolbox.

Key terms.

Crash workflow. docker ps -adocker logsdocker inspect --format='{{.State.ExitCode}}'docker run -it --entrypoint sh image:tag.

Cleanup. docker system prune -a --volumes (nuclear). docker system df (usage).

Remember. 137 = OOM. Run docker run -m 512m to up the limit. Always check logs before guessing.

Docker cheatsheet

CommandPurpose
docker run -d -p 8080:80 nginxrun detached, port-mapped
docker exec -it <c> shshell into running container
docker logs -f --tail 100 <c>follow logs
docker inspect <c>full state JSON
docker statslive CPU/mem
docker system prune -aclean unused stuff
docker compose up -d --buildstart + rebuild

Kubernetes

Kubernetes Architecture

What it is. Container orchestrator. We declare desired state, K8s makes it happen.

Key terms.

Remember. Control plane = brain, workers = hands. Everything goes through the API server. Components watch and react rather than calling each other directly.

Pods and Workloads

What it is. Pod = smallest deployable unit (1+ containers sharing network/storage). We use higher-level workloads.

Key terms.

Code.

apiVersion: apps/v1
kind: Deployment
metadata: { name: my-app }
spec:
  replicas: 3
  selector: { matchLabels: { app: my-app } }
  template:
    metadata: { labels: { app: my-app } }
    spec:
      containers:
        - name: app
          image: my-app:v2

Remember. Almost never create Pods directly. Deployment for stateless, StatefulSet for databases, DaemonSet for per-node, Job for batch.

Services and Networking

What it is. Pods are ephemeral with changing IPs. Services give stable endpoints.

Key terms.

Remember. ClusterIP = internal default. Ingress = one cheap entry point routing to many services. LoadBalancer = expensive per-service cloud LB.

ConfigMaps and Secrets

What it is. Separate config from container images.

Key terms.

Code.

envFrom:
  - configMapRef: { name: app-config }
  - secretRef: { name: db-credentials }

Remember. Secrets are encoded, not encrypted. Real security needs encryption at rest in etcd or external (Vault, Sealed Secrets).

Persistent Volumes and Storage

What it is. Storage that survives Pod restarts.

Key terms.

Remember. Block storage (EBS, PD) is usually RWO only. RWX needs NFS-style. StatefulSet + volumeClaimTemplate = standard DB pattern.

Resource Management and Scaling

What it is. Tell K8s how much CPU/memory we need so nothing starves.

Key terms.

Code.

resources:
  requests: { cpu: "250m", memory: "128Mi" }
  limits:   { cpu: "500m", memory: "256Mi" }

Remember. CPU throttle, memory kill. Always set requests + limits in prod. 1 CPU = 1 core, 1000m = 1 core.

RBAC and Security

What it is. Lock down who/what can do what.

Key terms.

Remember. Principle of least privilege. Default-deny NetworkPolicy + drop ALL capabilities + non-root + read-only FS = serious hardening. RBAC denies trump allows.

kubectl cheatsheet

CommandPurpose
kubectl get pods -n nslist pods
kubectl describe pod <p>full pod state
kubectl logs -f <p> -c <ctnr>follow logs
kubectl exec -it <p> -- shshell in pod
kubectl apply -f file.yamldeclarative apply
kubectl rollout status deploy/xwatch rollout
kubectl rollout undo deploy/xrollback
kubectl autoscale deploy x --min=2 --max=10 --cpu-percent=70quick HPA
kubectl auth can-i list pods --as=...check RBAC

CI/CD & GitOps

CI/CD Fundamentals

What it is. Automate build/test/deploy. CI = catches bugs early. CD = ship safely + often.

Key terms.

Remember. Delivery = “we can deploy anytime.” Deployment = “we do deploy every time.” Smaller diffs are easier to debug.

Pipeline Design

What it is. Structuring fast, reliable pipelines.

Key terms.

Code.

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: 20, cache: npm }
      - run: npm ci && npm run lint
  test:
    needs: lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm test
  deploy:
    needs: test
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    steps:
      - run: ./deploy.sh

Remember. Fastest checks first. Keep total under 10 min — beyond that nobody waits. Cache aggressively.

Deployment Strategies

What it is. Safe ways to ship code with rollback paths.

Key terms.

Strategy comparison.

StrategyDowntimeRollbackCostWhen
RecreateYesSlow1xDev/staging
RollingNoneSlow1xDefault for K8s
Blue-GreenNoneInstant2xNeed fast rollback
CanaryNoneFast~1.1xHigh-traffic, good monitoring

Remember. Default to rolling. Use canary when stakes are high and metrics are good.

GitOps and ArgoCD

What it is. Git is the source of truth. Cluster pulls desired state from Git.

Key terms.

Remember. “If it’s not in Git, it doesn’t exist.” Every change = PR. Audit log = git log.

Artifact Management and Registries

What it is. Store and version build outputs.

Key terms.

Code.

docker build -t ghcr.io/me/app:v1.2.3 -t ghcr.io/me/app:$(git rev-parse --short HEAD) .
docker push ghcr.io/me/app:v1.2.3
trivy image --exit-code 1 --severity CRITICAL ghcr.io/me/app:v1.2.3
cosign sign ghcr.io/me/app:v1.2.3

Remember. Tag with both semver AND git SHA. Never latest in prod manifests. Scan in CI; sign before deploy.

Cloud & Infrastructure

Cloud Computing Models

What it is. Spectrum from “we manage everything” (IaaS) to “we manage nothing” (SaaS).

Key terms.

Remember. Higher in the stack = less control, less ops. Real architectures mix all four.

VPC and Network Architecture

What it is. Our isolated private network in the cloud.

Key terms.

Remember. SG = stateful = apartment door. NACL = stateless = building gate. Public for LB+NAT, private for apps+DB.

IAM and Access Management

What it is. Who can do what on which resources.

Key terms.

Code.

{ "Effect": "Allow",
  "Action": ["s3:GetObject", "s3:ListBucket"],
  "Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/*"] }

Remember. Deny always wins. Never Action: "*" for app roles. Use roles, not access keys, in code. MFA on the root account, then lock it away.

Cloud Storage and Databases

What it is. Different storage types for different jobs.

Key terms.

Remember. S3 for files, EBS for disks, RDS for SQL, Redis for hot reads. Wrong choice = expensive and slow.

Serverless and Managed Services

What it is. Functions triggered by events. Pay per invocation. Scale to zero.

Key terms.

When YES. Sporadic workloads, event processing, cron jobs, variable traffic APIs.

When NO. Latency-critical APIs (cold starts), long jobs (>15 min), steady high throughput (containers cheaper).

Remember. Free when idle, expensive at huge scale. Watch out for cold starts and vendor lock-in.

Infrastructure as Code

IaC Concepts and Benefits

What it is. Infrastructure defined in code, stored in Git, applied by tools.

Key terms.

Remember. Declarative = ordering food. Imperative = giving cooking instructions. Most modern IaC is declarative.

Terraform Fundamentals

What it is. Declarative IaC tool by HashiCorp. Uses HCL.

Key terms.

Code.

provider "aws" { region = "ap-south-1" }
variable "bucket_name" { type = string }
resource "aws_s3_bucket" "assets" {
  bucket = var.bucket_name
  tags = { ManagedBy = "terraform" }
}
output "bucket_arn" { value = aws_s3_bucket.assets.arn }

Remember. ALWAYS read terraform plan before apply. resource creates, data reads.

Terraform State and Modules

What it is. State file maps config → real resources. Modules = reusable packages.

Key terms.

State commands. terraform state list / show / rm / mv.

Remember. Remote backend with locking = day-1 setup. Modules = stop copy-pasting. state rm forgets but doesn’t delete.

Ansible Basics

What it is. Agentless config management over SSH. Configures servers AFTER they exist.

Key terms.

Code.

- name: Setup web
  hosts: webservers
  become: true
  tasks:
    - apt: { name: nginx, state: present, update_cache: true }
    - copy: { src: nginx.conf, dest: /etc/nginx/nginx.conf }
      notify: restart nginx
    - service: { name: nginx, state: started, enabled: true }
  handlers:
    - name: restart nginx
      service: { name: nginx, state: restarted }

Remember. Terraform builds the house, Ansible furnishes it. No agents needed — just SSH.

Observability & Reliability

Monitoring and Alerting

What it is. Watch infra + apps, alert on real problems before users notice.

Key terms.

PromQL.

rate(http_requests_total[5m])
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))

Alert rules. Alert on symptoms not causes. Every alert actionable. Severities: critical/warning/info. Include runbook links.

Remember. USE for infra, RED for services. Alert fatigue is the real enemy — fewer good alerts > many noisy ones.

Logging and Log Aggregation

What it is. Centralize all logs, structured as JSON, searchable.

Key terms.

Remember. Always log structured JSON. Generate correlation ID at entry, pass it through every call. Hot logs in ES, cold in S3/Glacier.

Secrets Management and TLS

What it is. Keep passwords/tokens out of code; encrypt traffic.

Key terms.

Remember. Three rules: never in code, always encrypted, rotate regularly. Short-lived > rotation. Caddy/cert-manager remove cert-renewal headaches.

High Availability and Disaster Recovery

What it is. Stay running through failures. Recover from disasters.

Key terms.

RPO/RTO mnemonic. RPO is “how far back” (data loss tolerance). RTO is “how long down” (downtime tolerance). Lower = pricier.

Remember. Untested backup is not a backup. Test restore drills. Health checks + auto-failover = invisible recovery. Multi-region = serious HA.