⏳
Loading cheatsheet...
DevOps certification tracks, tooling matrix, practical roadmap, and exam-day quick revision.
| Domain | Weight | Key Topics |
|---|---|---|
| Cluster Architecture, Installation & Configuration | 25% | kubeadm, control plane components, etcd backup/restore, certificates, kubeconfig |
| Workloads & Scheduling | 15% | Pods, Deployments, DaemonSets, Jobs/CronJobs, affinity/anti-affinity, taints/tolerations, limits/requests |
| Services & Networking | 20% | Services (ClusterIP, NodePort, LoadBalancer), Ingress, NetworkPolicies, CoreDNS, CNI plugins |
| Storage | 10% | Volumes, PersistentVolumes, PersistentVolumeClaims, StorageClasses, volume expansion, ephemeral storage |
| Troubleshooting | 30% | Debug pods, nodes, network, audit logs, node/pod conditions, resource usage analysis, etcd health |
#!/bin/bash
# ── CKA Essential Commands (Memorize These) ──
# ── Cluster Management ──
kubeadm init --pod-network-cidr=10.244.0.0/16 # Initialize control plane
kubeadm token create --print-join-command # Generate join command
kubeadm join <control-plane-ip>:6443 --token <token> --discovery-token-ca-cert-hash <hash>
# ── etcd Backup & Restore ──
ETCDCTL_API=3 etcdctl snapshot save snapshot.db --endpoints=https://127.0.0.1:2379 --cacert=/etc/kubernetes/pki/etcd/ca.crt --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key
ETCDCTL_API=3 etcdctl snapshot restore snapshot.db --data-dir /var/lib/etcd-restore
# ── Networking ──
kubectl expose deployment my-deploy --port=80 --type=NodePort
kubectl create ingress my-ingress --rule="host/path=service:port"
# ── Taints & Tolerations ──
kubectl taint nodes node1 key=value:NoSchedule
kubectl taint nodes node1 key:NoSchedule- # Remove taint
# ── Maintenance (drain/cordon) ──
kubectl cordon node1 # Mark unschedulable
kubectl drain node1 --ignore-daemonsets --delete-emptydir-data
kubectl uncordon node1
# ── Resources & Limits ──
kubectl top nodes
kubectl top pods --all-namespaces
kubectl describe node node1 | grep -A5 "Allocated"# ── Pod with Resource Limits & Liveness Probe ──
apiVersion: v1
kind: Pod
metadata:
name: resource-pod
spec:
containers:
- name: app
image: nginx
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"
livenessProbe:
httpGet:
path: /healthz
port: 80
initialDelaySeconds: 15
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 80
initialDelaySeconds: 5
periodSeconds: 5
---
# ── NetworkPolicy (deny all ingress) ──
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-all-ingress
namespace: default
spec:
podSelector: {}
policyTypes:
- Ingress
---
# ── PersistentVolumeClaim ──
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
storageClassName: standardkubectl explain for reference.| Domain | Weight | Key Topics |
|---|---|---|
| Application Design & Build (13%) | 13% | Container image design, multi-container pods, Helm charts, Operators |
| Application Deployment (20%) | 20% | Deployments, StatefulSets, DaemonSets, Jobs, rollouts, rollbacks, scaling |
| Application Observability & Maintenance (18%) | 18% | Probes (liveness, readiness, startup), logging, sidecar patterns, debugging |
| Application Environment, Configuration & Security (18%) | 18% | ConfigMaps, Secrets, SecurityContexts, RBAC, resource limits, ServiceAccounts |
| Services & Networking (13%) | 13% | ClusterIP, NodePort, LoadBalancer, Ingress, NetworkPolicies, DNS troubleshooting |
| Application Troubleshooting (18%) | 18% | Debug failing pods, CrashLoopBackOff, log collection, events analysis |
#!/bin/bash
# ── CKAD Imperative Shortcuts (Saves Time) ──
# Create deployment (imperative)
kubectl create deployment my-app --image=nginx --replicas=3 --port=80
kubectl create deployment my-app --image=nginx --dry-run=client -o yaml > deploy.yaml
# Expose as service
kubectl expose deployment my-app --port=80 --target-port=8080 --type=ClusterIP
kubectl expose deployment my-app --port=80 --type=NodePort
# Create ConfigMap & Secret
kubectl create configmap my-cm --from-literal=key1=val1 --from-literal=key2=val2
kubectl create configmap my-cm --from-file=config.properties
kubectl create secret generic my-secret --from-literal=password=secret123
# Create Job / CronJob
kubectl create job my-job --image=busybox -- echo "hello"
kubectl create cronjob my-cron --image=busybox --schedule="*/5 * * * *" -- echo "hi"
# Rollout management
kubectl rollout status deployment/my-app
kubectl rollout history deployment/my-app
kubectl rollout undo deployment/my-app
kubectl set image deployment/my-app nginx=nginx:1.25
# Debugging
kubectl logs my-pod -c container-name
kubectl exec -it my-pod -- /bin/sh
kubectl describe pod my-pod
kubectl get events --sort-by=.metadata.creationTimestamp| Domain | Weight | Key Topics |
|---|---|---|
| Orchestration | 25% | Swarm mode, services, stacks, UCP (Universal Control Plane), DTR (Docker Trusted Registry) |
| Image Creation, Management & Registry | 20% | Dockerfile best practices, multi-stage builds, tagging, registry management |
| Installation & Configuration | 15% | Docker Engine, storage drivers, logging drivers, networking configuration |
| Networking | 15% | Bridge, overlay, macvlan networks, Docker DNS, embedded DNS, service discovery |
| Security | 15% | Docker Content Trust, secrets, TLS, AppArmor/SELinux, user namespaces, rootless mode |
| Storage & Volumes | 10% | Volumes, bind mounts, tmpfs, storage drivers (overlay2), volume plugins |
#!/bin/bash
# ── Docker Certified Associate — Essential Commands ──
# ── Multi-stage Build (Dockerfile) ──
# Stage 1: Build
# FROM node:18-alpine AS builder
# WORKDIR /app
# COPY package*.json ./
# RUN npm ci
# COPY . .
# RUN npm run build
# Stage 2: Runtime
# FROM node:18-alpine
# WORKDIR /app
# COPY --from=builder /app/dist ./dist
# COPY --from=builder /app/node_modules ./node_modules
# EXPOSE 3000
# CMD ["node", "dist/server.js"]
# ── Docker Networking ──
docker network create -d overlay my-overlay-net # Swarm overlay
docker network create -d bridge app-net # Bridge network
docker network connect app-net my-container # Connect container to network
docker network inspect app-net # Inspect network
# ── Docker Swarm ──
docker swarm init --advertise-addr <node-ip>
docker swarm join --token <token> <manager-ip>:2377
docker service create --name web --replicas 3 -p 80:80 nginx
docker service scale web=5
docker service update --image nginx:1.25 web
docker stack deploy -c docker-compose.yml my-stack
# ── Docker Security ──
docker pull --disable-content-trust alpine # Skip content trust (danger!)
export DOCKER_CONTENT_TRUST=1 # Enable content trust
docker secret create my-secret secret.txt # Create secret
docker secret ls
docker service create --secret my-secret my-app
# ── Resource Limits ──
docker run -d --cpus=2 --memory=512m --memory-swap=1g nginx
docker update --cpus=4 --memory=1g my-container| Domain | Weight | Key Topics |
|---|---|---|
| Understand IaC concepts | 7% | IaC benefits vs traditional, declarative vs imperative, mutable vs immutable |
| Understand Terraform purpose | 5% | Multi-cloud, provider ecosystem, state management, open source vs TFC |
| Understand Terraform basics | 14% | CLI workflow (init, plan, apply, destroy), configuration syntax, state |
| Interact with Terraform modules | 19% | Module structure, registry, versioning, module sources, input/output variables |
| Use Terraform CLI | 11% | plan output, formatting (terraform fmt), validation, workspace, import |
| Interact with Terraform state | 15% | State file, remote state, state locking, state manipulation, sensitive data |
| Read & write Terraform configs | 23% | HCL syntax, resource/data/provider/variable/locals/output blocks, expressions, for/splat |
| Understand Terraform Cloud / Enterprise | 6% | TFC workspaces, Sentinel policies, remote execution, cost estimation |
# ── Terraform Associate — Key Patterns ──
# Provider configuration
provider "aws" {
region = var.aws_region
}
# Variable with validation
variable "aws_region" {
description = "AWS region for deployment"
type = string
default = "us-east-1"
validation {
condition = contains(["us-east-1", "us-west-2", "eu-west-1"], var.aws_region)
error_message = "Region must be us-east-1, us-west-2, or eu-west-1."
}
}
# Resource with for_each
resource "aws_s3_bucket" "logs" {
for_each = toset(["app-logs", "audit-logs", "access-logs"])
bucket = "${each.value}-${var.project_name}"
}
# Data source
data "aws_ami" "ubuntu" {
most_recent = true
owners = ["099720109477"] # Canonical
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"]
}
}
# Module usage
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.1.0"
cidr = "10.0.0.0/16"
azs = ["us-east-1a", "us-east-1b"]
public_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
private_subnets = ["10.0.10.0/24", "10.0.11.0/24"]
}
# Output
output "vpc_id" {
value = module.vpc.vpc_id
description = "ID of the created VPC"
}
# Terraform block
terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "my-terraform-state"
key = "prod/terraform.tfstate"
region = "us-east-1"
encrypt = true
dynamodb_table = "terraform-locks"
}
}| Concept | Description | Best Practice |
|---|---|---|
| Local state | terraform.tfstate file (default) | OK for learning, not for teams |
| Remote state | S3, GCS, Azure Blob, TFC | Always use for production/teams |
| State locking | DynamoDB, GCS native, TFC | Prevents concurrent modifications |
| state mv | Move resource between states | Useful during refactoring |
| state rm | Remove resource from state (not infra) | Use when resource deleted manually |
| state pull/push | View or modify state manually | Dangerous — use with caution |
| sensitive variables | Marked as sensitive in state | Hidden in plan output, encrypted at rest |
| terraform import | Import existing infra into state | Does not generate config — manual |
| Command | Purpose |
|---|---|
| terraform init | Initialize working directory, download providers/modules |
| terraform plan | Preview changes (dry run) |
| terraform apply | Apply changes to infrastructure |
| terraform destroy | Remove all tracked resources |
| terraform fmt | Format HCL files to canonical style |
| terraform validate | Validate configuration syntax |
| terraform show | Display current state or plan |
| terraform workspace | Manage multiple environments (dev/stage/prod) |
| terraform import | Import existing resource into state |
| terraform taint | Mark resource for recreation (deprecated — use -replace) |
| terraform apply -replace=aws_instance.web | Force recreation of specific resource |
| Domain | Weight | Key Topics |
|---|---|---|
| Jenkins Fundamentals | 20% | Architecture (controller/agent), master/slave, Jenkinsfile, declarative vs scripted pipeline |
| Pipeline Creation | 25% | Declarative pipeline syntax, stages, steps, post blocks, parallel, matrix, shared libraries |
| Source Code Management | 15% | Git integration, GitHub, GitLab, Bitbucket, webhooks, multibranch pipelines |
| Build Tools | 15% | Maven, Gradle, npm, Ant, Docker integration, build triggers |
| Testing & Quality | 10% | JUnit integration, test reports, SonarQube, code coverage, parallel test execution |
| Deployment & Operations | 15% | Kubernetes agent, Blue Ocean, credentials management, security, backup/restore |
// ── Declarative Jenkinsfile with Best Practices ──
pipeline {
agent {
kubernetes {
yaml '''
apiVersion: v1
kind: Pod
spec:
containers:
- name: maven
image: maven:3.9-eclipse-temurin-17
command: ['cat']
tty: true
- name: docker
image: docker:24
command: ['cat']
tty: true
volumeMounts:
- name: docker-sock
mountPath: /var/run/docker.sock
volumes:
- name: docker-sock
hostPath:
path: /var/run/docker.sock
'''
}
}
environment {
REGISTRY = 'registry.example.com'
IMAGE = "${REGISTRY}/my-app:${BUILD_NUMBER}"
}
stages {
stage('Build') {
steps {
container('maven') {
sh 'mvn clean package -DskipTests'
}
}
}
stage('Test') {
steps {
container('maven') {
sh 'mvn test'
}
}
post {
always {
junit '**/target/surefire-reports/*.xml'
}
}
}
stage('Docker Build & Push') {
steps {
container('docker') {
sh "docker build -t ${IMAGE} ."
sh "docker push ${IMAGE}"
}
}
}
stage('Deploy') {
steps {
container('kubectl') {
sh "kubectl set image deployment/my-app app=${IMAGE} -n production"
}
}
}
}
post {
success { echo 'Pipeline succeeded!' }
failure { echo 'Pipeline failed!' }
always { cleanWs() }
}
}| Certification | Level | Focus | Cost | Duration |
|---|---|---|---|---|
| LFCS | Essential | Linux system administration, CLI, storage, networking | $395 | 2 hours |
| LFCE | Professional | Advanced Linux, services, security, performance | $395 | 2 hours |
| LFS258 (CKA Prep) | Foundational | Kubernetes administration prep course | Included w/CKA | N/A |
| LPIC-1 | Essential | Linux admin (LPI vendor-neutral) | $188 | 90 min × 2 |
| LPIC-2 | Professional | Advanced Linux admin (LPI) | $188 | 90 min × 2 |
| RHCSA | Associate | Red Hat Enterprise Linux admin | $495 | 2.5 hours |
| RHCE | Engineer | Red Hat automation with Ansible | $495 | 3.5 hours |
| Domain | Topics |
|---|---|
| Essential Commands | ls, cd, cp, mv, rm, find, grep, sed, awk, pipes, redirection |
| Filesystem Management | mkfs, mount/umount, fdisk/parted, LVM (pv, vg, lv), fstab, ext4/xfs |
| User & Group Management | useradd, usermod, groupadd, chmod, chown, /etc/passwd, /etc/shadow |
| Networking | ip, ss, ping, traceroute, nmcli, iptables/nftables, /etc/resolv.conf, SSH |
| Package Management | apt (Debian/Ubuntu), yum/dnf (RHEL/CentOS), tar, make |
| Process & Service Management | systemctl, journalctl, top, ps, kill, cron, systemd units |
| Security | SELinux, AppArmor, SSH hardening, firewalld, fail2ban |
| Shell Scripting | Bash scripting, variables, conditionals, loops, functions, cron jobs |
#!/bin/bash
# ── Linux Foundation Certified Sysadmin — Essential Commands ──
# ── User Management ──
useradd -m -s /bin/bash developer # Create user with home dir
usermod -aG docker,sudo developer # Add to groups
passwd developer # Set password
id developer # Show user/group IDs
chmod 755 /opt/app # rwxr-xr-x
chown developer:developers /opt/app # Change owner & group
# ── Filesystem & LVM ──
fdisk /dev/sdb # Partition disk
pvcreate /dev/sdb1 # Create physical volume
vgcreate app-vg /dev/sdb1 # Create volume group
lvcreate -L 50G -n app-lv app-vg # Create logical volume
mkfs.ext4 /dev/app-vg/app-lv # Format filesystem
mount /dev/app-vg/app-lv /mnt/app # Mount
echo '/dev/app-vg/app-lv /mnt/app ext4 defaults 0 2' >> /etc/fstab
# ── Systemd Services ──
systemctl enable nginx # Enable on boot
systemctl start nginx # Start now
systemctl status nginx # Check status
journalctl -u nginx -f # Follow logs
systemctl list-units --type=service # List all services
# ── Networking ──
ip addr show # Show interfaces
ip route show # Show routing table
ss -tlnp # Show listening TCP ports
nmcli con show # NetworkManager connections
ping -c 4 google.com # Test connectivity
traceroute google.com # Trace route
curl -I https://example.com # HTTP headers
# ── Firewalld ──
firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
firewall-cmd --list-all| Resource | Cert Target | Cost | Best For |
|---|---|---|---|
| killer.sh | CKA/CKAD | ~$40-60 (2 attempts) | Most realistic mock exam environment |
| KodeKloud | CKA/CKAD/LFCS | ~$15/mo | Browser-based labs + practice exams |
| Linux Foundation Training (LFS258) | CKA prep | $299 (discounted) | Official CKA prep course |
| A Cloud Guru (CKA/CKAD) | CKA/CKAD | ~$15 (Udemy sale) | Video courses + practice |
| Mumshad Mannambeth (KodeKloud) | CKA/CKAD | ~$15 (Udemy sale) | Best CKA/CKAD instructor |
| HashiCorp Learn | Terraform | Free | Official tutorials and guides |
| Zeal Vora (Udemy) | Terraform | ~$15 (sale) | Comprehensive Terraform course |
| Bret Fisher (Docker Mastery) | DCA prep | ~$15 (Udemy sale) | Best Docker course available |
| Jenkins官方文档 | Jenkins | Free | Pipeline syntax reference, shared libraries |
| Step | Certification | Time | Why This Order |
|---|---|---|---|
| 1 | LFCS or LPIC-1 | 4-6 weeks | Linux foundations for everything else |
| 2 | Docker DCA | 4 weeks | Container fundamentals before Kubernetes |
| 3 | Kubernetes CKA | 6-8 weeks | Cluster admin — highest ROI DevOps cert |
| 4 | Kubernetes CKAD | 3-4 weeks | App dev on K8s (easier after CKA) |
| 5 | Terraform Associate | 3-4 weeks | IaC — pairs perfectly with cloud certs |
| 6 | AWS SAA + DOP | 8-12 weeks | Cloud platform + DevOps engineer pro |
| 7 | CKS (Security) | 4-6 weeks | Kubernetes security (after CKA + CKAD) |
╔═══════════════════════════════════════════════════════════════╗
║ DEVOPS CERTIFICATION COST SUMMARY ║
╠═══════════════════════════════════════════════════════════════╣
║ Linux Foundation LFCS $395 ║
║ Linux Foundation LFCE $395 ║
║ Docker Certified Associate $195 ║
║ Kubernetes CKA $395 ║
║ Kubernetes CKAD $395 ║
║ Kubernetes CKS (Security) $395 ║
║ HashiCorp Terraform Associate $70.50 ║
║ Jenkins Cloud Engineer $250 ║
║ Red Hat RHCSA $495 ║
║ Red Hat RHCE $495 ║
║ ║
║ Full DevOps path (LFCS+DCA+CKA+CKAD+TF) ≈ $1,450 ║
║ Study materials (Udemy sales, labs) ≈ $100-300 ║
║ Total investment ≈ $1,550-1,750 ║
╚═══════════════════════════════════════════════════════════════╝| Tip | Details |
|---|---|
| Use aliases | Create kubectl aliases: alias k=kubectl, alias kg="kubectl get", etc. |
| Use --dry-run -o yaml | Generate YAML templates without creating resources, then edit |
| Use kubectl explain | kubectl explain pod.spec.containers — shows available fields |
| Bookmark docs | CKA/CKAD allow kubernetes.io/docs — bookmark key pages before exam |
| Skip hard questions | Complete easy questions first, return to hard ones (time is tight) |
| Practice typing speed | 2 hours for CKA/CKAD is barely enough — every minute counts |
| Use imperative commands | kubectl create, expose, run — faster than writing YAML from scratch |
| vim shortcuts | Set nocp, set nu, :syntax on in ~/.vimrc — save time editing YAML |
| Tip | Details |
|---|---|
| Understand, don't memorize | Terraform questions test understanding of concepts, not rote memorization |
| Read carefully | Watch for "NOT", "MOST appropriate", "LEAST likely" qualifiers |
| Process of elimination | Eliminate 2 wrong answers, compare remaining carefully |
| Know the defaults | Terraform has important defaults (backend type, state location, etc.) |
| State management | Understand drift detection, state locking, and state file security |
| Module patterns | Know input/output variable conventions, versioning, source types |
| Lifecycle rules | create_before_destroy, prevent_destroy, ignore_changes are frequently tested |
| Expression functions | Know: lookup, merge, for, for_each, count, length, concat, compact |
count and for_each, understand dependency graphs, and be very clear on state management (local vs remote, locking, sensitive variables).