1. Vì sao DevOps?
Trước 2010, mô hình phổ biến: Dev viết code → quăng cho Ops deploy. Hai team khác lương, khác mục tiêu, khác văn hóa:
Dev (Developer)
- Mục tiêu: ship feature mới càng nhanh càng tốt
- KPI: số story point, số PR merge
- "Code chạy local là xong"
- Không hiểu vận hành: log, scaling, security
Ops (Operations)
- Mục tiêu: system stable, không downtime
- KPI: uptime, MTBF, ticket resolved
- "Đừng đụng vào prod"
- Không hiểu code: nghiệp vụ, dependency
Khi mâu thuẫn xảy ra (deploy lỗi, prod down), 2 team đổ lỗi cho nhau. Hậu quả thường thấy:
- Deploy hiếm (mỗi quý 1 lần) — release cuối tuần, đêm thâu, ai cũng sợ.
- Deploy lỗi cao — 50% deploy phải rollback.
- MTTR cao — gặp incident, mất nửa ngày-vài ngày để fix.
- Burnout — Ops on-call cháy mỗi đêm; Dev không có "skin in the game".
- Mất ưu thế cạnh tranh — competitor (Netflix, Amazon) ship feature mỗi ngày.
DevOps ra đời để xóa ranh giới. Phá tường ngăn — gộp 2 team thành 1 team có cả 2 kỹ năng và cùng chịu trách nhiệm. Đó là văn hóa, không phải tool.
"DevOps is not a tool, it is a culture, a mindset, and a set of practices that bring development and operations together."
2. Mindset trước Tooling — bài học quan trọng nhất
Nhiều người nhầm tưởng DevOps = Docker + Kubernetes + Terraform. Sai. DevOps là cách làm việc, tool là phương tiện.
5 nguyên lý DevOps gói gọn trong từ CALMS (Jez Humble):
3. Bản đồ tư duy — Cấu trúc 14 chương
14 chương được chia thành 5 cụm, mỗi cụm là một bước trên thang DevOps maturity:
Cách đọc bản đồ: Cụm 1-2 là điều kiện cần. Không nắm Linux + Git + Docker thì học Kubernetes vô nghĩa. Cụm 3-4 là vận hành thật. Cụm 5 chuyên sâu, học sau khi có ít nhất 1-2 năm kinh nghiệm thật.
4. Tiến hóa DevOps — Lịch sử 50 năm gọn lại
| Thời kỳ | Mô hình deploy | Tốc độ | Đặc điểm |
|---|---|---|---|
| 1970-1990 | Manual / FTP upload | Vài tháng/release | Sysadmin chạy script bằng tay, "configuration drift" khắp nơi |
| 1990-2005 | Waterfall + manual deploy | Quý/release | Big bang release, dev throw over wall, blame culture |
| 2001-2010 | Agile + CI (Hudson/Jenkins) | Tuần/release | Agile manifesto 2001, Hudson 2004, "Continuous Integration" Fowler 2006 |
| 2009 | "DevOps" được đặt tên | Vài lần/tuần | Patrick Debois tổ chức "DevOpsDays" Ghent 2009; Velocity Conf "10+ deploys/day at Flickr" của John Allspaw |
| 2013-2015 | Containers + IaC | Hàng ngày | Docker 2013, Terraform 2014, Kubernetes 2014; "Phoenix Project" 2013 |
| 2016-2020 | GitOps + Cloud-native | Mỗi commit | ArgoCD 2018, Flux, service mesh, observability nổi lên |
| 2020-nay | Platform Engineering | Self-service | Internal Developer Platform (IDP), Backstage 2020, FinOps, AI-Ops |
Bài học từ lịch sử: mỗi 5-10 năm có một wave công nghệ mới. Đừng học chỉ riêng tool — học nguyên lý để adapt được wave tiếp theo.
5. Phân biệt vai trò trong "DevOps world"
Năm 2026, các title liên quan đến DevOps đã phân hóa rõ:
| Title | Trọng tâm | Câu hỏi điển hình |
|---|---|---|
| DevOps Engineer | CI/CD pipeline, automation, infrastructure | "Làm sao deploy nhanh hơn, ít lỗi hơn?" |
| SRE (Site Reliability Engineer) | Reliability, SLO, incident, capacity | "Hệ thống có meet 99.9% không? Error budget còn bao nhiêu?" |
| Platform Engineer | Internal Developer Platform (IDP), self-service tools | "Làm sao dev tự deploy mà không cần ticket?" |
| Cloud Engineer | Cloud-specific architecture (AWS/GCP/Azure) | "Setup VPC + EKS + RDS multi-AZ thế nào tối ưu chi phí?" |
| Security Engineer (DevSecOps) | Shift-left security, supply chain, compliance | "Quét vuln container ở giai đoạn nào của pipeline?" |
| Sysadmin | Quản lý OS, network, on-prem (cũ hơn) | "Server bị cao CPU, kiểm tra thế nào?" |
Khác biệt: SRE và DevOps thường giải quyết cùng vấn đề bằng cách tiếp cận khác. "SRE is what happens when you ask a software engineer to design an operations team." — Ben Treynor (Google).
6. Stack công cụ DevOps 2026
Để tránh lạc trong rừng tool, đây là stack tham khảo cho từng layer (chọn 1 trong mỗi nhóm):
| Layer | Tool phổ biến | Trong giáo trình |
|---|---|---|
| VCS | Git (mọi nơi), GitHub / GitLab / Bitbucket | Git + GitHub |
| CI/CD | GitHub Actions, GitLab CI, Jenkins, CircleCI, ArgoCD (CD) | GitHub Actions chính + GitLab CI tham khảo |
| Container | Docker, Podman, containerd, BuildKit | Docker |
| Orchestration | Kubernetes, Nomad, ECS | Kubernetes (vanilla + EKS/GKE) |
| IaC | Terraform, Pulumi, CloudFormation, Bicep | Terraform chính + Pulumi tham khảo |
| Config Mgmt | Ansible, Chef, Puppet, Salt | Ansible |
| Cloud | AWS, GCP, Azure, OCI, Alibaba | AWS / GCP / Azure cân bằng |
| Secrets | Vault, AWS Secrets Manager, GCP Secret Manager, sealed-secrets | Vault + AWS Secrets Manager |
| Monitoring | Prometheus + Grafana, Datadog, New Relic, CloudWatch | Prometheus + Grafana |
| Logging | ELK (Elasticsearch+Logstash+Kibana), Loki, Splunk | ELK + Loki |
| Tracing | Jaeger, Zipkin, Tempo, AWS X-Ray | OpenTelemetry + Jaeger |
| Service Mesh | Istio, Linkerd, Consul Connect | Istio (giới thiệu) |
| Security | Trivy, Snyk, Falco, OPA, gitleaks | Tất cả |
| Platform | Backstage, Port, Crossplane | Backstage (giới thiệu) |
7. Lộ trình 14 chương — chi tiết
Cụm 1: Foundations (chương 1-4) — 2-3 tuần
Mục tiêu: hiểu DevOps là gì, làm chủ Linux + Git + CI/CD basic. Sau cụm này, bạn có thể setup pipeline GitHub Actions cho 1 project Node.js.
- Ch 01 — Văn hóa, lifecycle, DORA, CALMS. Đọc lý thuyết, không cần code.
- Ch 02 — Linux/Shell. Chỉ cần điểm xuyết những gì DevOps thực sự dùng (systemd, journalctl, ip, ss, cron). Bổ sung CLI pillar.
- Ch 03 — Git workflows. Học pull request flow, conflict resolution, rebase vs merge.
- Ch 04 — CI/CD đầu tiên. Tự setup pipeline build → test → deploy.
Cụm 2: Containers (chương 5-6) — 2-3 tuần
Mục tiêu: container hóa app, deploy lên Kubernetes. Sau cụm này, bạn có thể container hóa 1 app full-stack và deploy lên minikube.
Cụm 3: Infrastructure (chương 7-8) — 2-3 tuần
Mục tiêu: tự build hạ tầng từ code. Sau cụm này, bạn có thể spin up VPC + DB + K8s cluster trên AWS/GCP bằng Terraform.
Cụm 4: Operate (chương 9-11) — 3-4 tuần
Mục tiêu: chạy hệ thống ổn định. Sau cụm này, bạn có thể setup Prometheus monitoring, viết SLO, làm postmortem.
Cụm 5: Master (chương 12-14) — 3-4 tuần
Mục tiêu: chuyên sâu security, performance, production. Đây là kiến thức Senior/Staff level.
8. Lab thực hành — Setup ngay hôm nay
Phần cứng tối thiểu
- Máy với 16GB RAM (8GB đủ nhưng chật khi chạy minikube + Docker Desktop).
- 50GB ổ cứng còn trống.
- macOS / Linux ưu tiên. Windows OK với WSL2.
Tools cài local
# macOS — dùng Homebrew
brew install git docker minikube kubectl helm terraform ansible
brew install --cask docker
# Verify
docker --version # Docker version 24+
kubectl version --client
minikube version # v1.30+
terraform --version # v1.6+
ansible --version
# Linux (Ubuntu/Debian)
sudo apt update
sudo apt install -y git docker.io
# kubectl, minikube, terraform: tải từ trang chủ tương ứng
Cloud account miễn phí
- AWS Free Tier — 12 tháng miễn phí EC2 t2.micro, S3 5GB, RDS 750h/tháng.
- GCP $300 credit — 90 ngày, dùng được Compute Engine, GKE, Cloud SQL.
- Azure — $200 credit 30 ngày + 12 tháng free tier.
terraform destroy hoặc tắt cluster khi xong lab. Set billing alert < $5/tháng.
Repo lab gợi ý
- Tạo GitHub repo
devops-learning. - Cấu trúc:
devops-learning/ ├── ch04-cicd/ # GitHub Actions playground ├── ch05-docker/ # Dockerfile + Compose ├── ch06-k8s/ # K8s manifests + Helm chart ├── ch07-terraform/ # IaC for AWS VPC + EKS ├── ch09-ansible/ # Playbook configure server ├── ch10-prometheus/ # Monitoring stack └── README.md - Mỗi chương push code vào folder tương ứng.
9. Từ điển thuật ngữ DevOps
| Thuật ngữ | Định nghĩa ngắn |
|---|---|
| Artifact | Sản phẩm build (jar, .deb, container image, binary) |
| Blue-Green Deploy | Có 2 environment giống hệt; switch traffic instant, rollback dễ |
| Canary Deploy | Roll out version mới cho 1-5% user trước, monitor metric, mở rộng dần |
| CI / CD | Continuous Integration / Continuous Delivery / Deployment |
| Configuration Drift | Trạng thái thực của hệ thống lệch khỏi config khai báo |
| Container | Process isolated qua namespaces + cgroups, share kernel với host |
| DORA Metrics | 4 chỉ số: Deploy Frequency, Lead Time, MTTR, Change Failure Rate |
| Error Budget | Phần (1 - SLO) — quota downtime cho phép trước khi freeze deploy |
| GitOps | Git là single source of truth cho infra/app — agent (ArgoCD/Flux) sync |
| Golden Path | Cách "đi đúng" được khuyến nghị mặc định cho dev (Platform Eng) |
| HPA / VPA / CA | K8s autoscaler: Horizontal Pod / Vertical Pod / Cluster Autoscaler |
| IaC | Infrastructure as Code — khai báo hạ tầng bằng code (Terraform, Pulumi) |
| Idempotent | Thao tác lặp nhiều lần cho ra cùng kết quả (Ansible task, PUT REST) |
| Immutable Infra | Không sửa server đang chạy — replace hoàn toàn bằng instance mới |
| Mean Time to ___ | MTTR (Recover), MTTF (Failure), MTBF (Between Failures) |
| Observability | Khả năng suy ra trạng thái nội bộ từ output (logs/metrics/traces) |
| Postmortem | Báo cáo blameless sau incident, focus vào quy trình không đổ lỗi cá nhân |
| Runbook | Tài liệu hướng dẫn xử lý incident (step-by-step) |
| SLI/SLO/SLA | Indicator (đo) / Objective (target nội bộ) / Agreement (cam kết khách) |
| Toil | Việc thủ công, lặp lại, không tạo giá trị lâu dài (target SRE: < 50%) |
| 12-Factor App | 12 nguyên lý xây cloud-native app (Heroku 2011) |
10. Tài liệu mở rộng
Sách bắt buộc
- The Phoenix Project (Gene Kim, 2013) — tiểu thuyết về DevOps transformation. Đọc trước nếu chưa biết DevOps.
- The DevOps Handbook (Gene Kim, Jez Humble, 2016) — bản hệ thống của Phoenix Project.
- Site Reliability Engineering (Google, 2016, free online) — bible của SRE.
- Accelerate (Nicole Forsgren, 2018) — nghiên cứu DORA, có data thực.
- Continuous Delivery (Jez Humble, David Farley, 2010) — gốc của CD.
Tham khảo theo chủ đề
- Docker — Docker Deep Dive (Nigel Poulton)
- Kubernetes — Kubernetes Up & Running (Kelsey Hightower)
- Terraform — Terraform: Up and Running (Yevgeniy Brikman)
- Observability — Observability Engineering (Charity Majors, Honeycomb)
- Platform Engineering — Team Topologies (Matthew Skelton)
Engineering blog đáng theo dõi
- Netflix Tech Blog — chaos engineering, Spinnaker, microservices
- Stripe Engineering — observability, payment infra
- Uber Engineering — Cadence, M3, monorepo
- Google Cloud Blog — SRE practices, GKE
- AWS Architecture Blog — Well-Architected Framework
Cộng đồng
- r/devops, r/sre — Reddit
- CNCF (Cloud Native Computing Foundation) — Slack, conference KubeCon
- DevOpsDays — local conference khắp thế giới
"Hire for attitude, train for skill. Trong DevOps: văn hóa > kỹ năng tool. Tool học vài tuần xong, văn hóa cần năm tháng."