ข้ามไปที่เนื้อหา

DevOps คืออะไร? คู่มือฉบับสมบูรณ์

ถาม engineer สิบคนว่า DevOps คืออะไร ได้คำตอบสิบแบบแน่นอน

"ก็ CI/CD ไง" "automation" "developer มาทำงาน ops" "เป็นวัฒนธรรม" "เป็นชื่อตำแหน่ง" "เป็น toolchain" "เป็นกระแส movement"

ทุกคำตอบมีส่วนถูก แต่ไม่มีคำตอบไหนครบ DevOps เกี่ยวทั้งวัฒนธรรม process และเทคโนโลยีในคราวเดียว เลยหานิยามสั้น ๆ ให้ครบได้ยาก


Part 1: DevOps เกิดมาเพื่อแก้ปัญหาอะไร

จะเข้าใจ DevOps ต้องย้อนไปดูก่อนว่าโลกก่อนมี DevOps หน้าตาเป็นยังไง

Wall of Confusion: กำแพงระหว่าง Dev กับ Ops

ต้นยุค 2000 บริษัท software ส่วนใหญ่แบ่งทีมกันแบบนี้

  ┌────────────────────────────────────────────────────────────┐
  │               DEVELOPMENT TEAM                             │
  │                                                            │
  │  "Our job is to build features. Ship fast, move fast."     │
  │  Incentivised on: features shipped, velocity               │
  └─────────────────────────────┬──────────────────────────────┘
                                 │
                    "THROW IT OVER THE WALL"
                                 │
                                 ▼
  ┌────────────────────────────────────────────────────────────┐
  │               OPERATIONS TEAM                              │
  │                                                            │
  │  "Our job is to keep the system stable. Change is risk."   │
  │  Incentivised on: uptime, stability, zero incidents        │
  └────────────────────────────────────────────────────────────┘

ฝั่ง Development อยากเปลี่ยน ฝั่ง Operations อยากให้นิ่ง โครงสร้างองค์กรตั้งเป้าให้สองทีมสวนทางกันตั้งแต่ต้น

Deploy พังตอนตีสอง Ops ก็โทษ Dev ว่าส่งโค้ดห่วย ๆ มา Dev ก็โทษ Ops ว่า environment เปราะ ไม่มีใครดูแล pipeline ตลอดเส้น และไม่มีใครรับผิดชอบผลลัพธ์จริง ๆ

ผลก็คือ deploy กันทีละหลายเดือน ทุกรอบที่ deploy คือฝันร้าย กว่าโค้ดที่เขียนเสร็จจะไปสร้างคุณค่าให้ลูกค้าได้ ต้องนับกันเป็นไตรมาส

Agile แก้ปัญหา แต่กลับทำให้กำแพงสูงขึ้น

Agile (2001) มาแก้ปัญหาฝั่ง development ทีมเริ่มส่ง software ที่ใช้งานได้ทุกสองสัปดาห์ จากเดิมหกเดือนครั้ง แต่ติดอยู่อย่างหนึ่ง Agile ไม่ได้ทำให้กำแพงนี้ดีขึ้นเลย กลับทำให้แย่ลง

Developer ส่งโค้ดทุกสองสัปดาห์ก็จริง แต่ส่งไปกองไว้หน้ากำแพง ทีม Ops ยังใช้ change management แบบไตรมาสละรอบ รับจังหวะนี้ไม่ไหว โค้ดค้างเป็นกอง feature พร้อมแต่ยังไม่ได้ deploy คุณค่าที่ทำมาก็ไปไม่ถึงลูกค้า

Agile ที่ไม่มี DevOps ก็เหมือนรถแรง ๆ ที่ไม่มีถนนให้วิ่ง

จุดเริ่มต้น: deploy วันละ 10 ครั้งขึ้นไป

จุดเปลี่ยนมาถึงในเดือนมิถุนายน 2009 ที่งาน O'Reilly Velocity Conference John Allspaw กับ Paul Hammond จาก Flickr ขึ้นพูดหัวข้อ "10+ Deploys Per Day: Dev and Ops Cooperation at Flickr."

ใจความคือ Dev กับ Ops ไม่จำเป็นต้องเป็นศัตรูกัน ถ้ามีเป้าหมายเดียวกัน ใช้เครื่องมือชุดเดียวกัน และรับผิดชอบร่วมกัน ก็ deploy ขึ้น production ได้วันละสิบกว่าครั้ง แถมปลอดภัยด้วย

Talk นี้ดังไปทั่ววงการ engineering เพราะพูดตรงกับที่หลายคนคิดอยู่แล้ว กำแพงนี้ไม่ได้เป็นเรื่องหลีกเลี่ยงไม่ได้ องค์กรเลือกสร้างขึ้นมาเองต่างหาก

ปีเดียวกัน Patrick Debois IT consultant ชาวเบลเยียมที่อึดอัดกับการแบ่งฝั่ง Dev/Ops มาหลายปี ได้แรงบันดาลใจจาก talk นี้ เลยจัดงาน DevOpsDays ครั้งแรกที่เมือง Ghent ประเทศเบลเยียม พอจะตั้ง hashtag บน Twitter #DevOpsDays ก็ยาวไป เขาเลยตัดเหลือ #DevOps

กระแสนี้ก็ได้ชื่อเรียกตั้งแต่ตอนนั้น

The Phoenix Project (2013)

The Phoenix Project นิยายของ Gene Kim, Kevin Behr และ George Spafford ทำให้คนฝั่ง business ทั่วไปรู้จัก DevOps เนื้อเรื่องเป็นเรื่องแต่งของ IT manager ในบริษัทที่กำลังจะไปไม่รอด แต่ปัญหาในเรื่องคือของจริงทั้งนั้น ทีมแยกเป็น silo ดับไฟกันไม่จบ deploy พัง โดน business กดดัน ใครทำงานสายเทคอ่านแล้วก็คุ้นทันที

หนังสือเล่มนี้เปิดตัวแนวคิด the Three Ways หลักการพื้นฐานที่ DevOps practice ทุกข้อต่อยอดมา เดี๋ยวจะลงรายละเอียดกันใน Part 3


Part 2: DevOps คืออะไร และไม่ใช่อะไร

เข้าใจผิดกันบ่อยแค่ไหน

ที่คนส่วนใหญ่คิด ความจริง
มีทีมชื่อ "DevOps team" วิธีคิดและวัฒนธรรมที่ทุกทีมต้องทำ
ชุดเครื่องมือ automation เครื่องมือมีไว้ช่วยวัฒนธรรมและ process
Developer มาทำงาน ops ทุกฝ่ายเป็นเจ้าของ delivery cycle ร่วมกันตั้งแต่ต้นจนจบ
CI/CD เท่านั้น CI/CD เป็น practice หนึ่ง ส่วน DevOps คือปรัชญาเบื้องหลัง
โปรเจกต์ที่ "implement" จบใน 3 เดือน การปรับปรุงที่ทำไปเรื่อย ๆ ไม่มีวันจบ
ยุบตำแหน่ง Ops ทิ้ง บทบาท Ops เปลี่ยนไป (กลายเป็น SRE/Platform)

ความเข้าใจผิดที่อันตรายที่สุด

ตั้ง "DevOps team" ขึ้นมา คือวิธียอดฮิตที่องค์กรเลียนแบบ DevOps แค่เปลือก (cargo-cult) แต่ไม่ได้ผลจริง สุดท้าย DevOps team ก็เป็นแค่ silo อีกก้อน คอยดูแล pipeline อยู่ทีมเดียว ส่วน dev กับ ops ก็ยังแยกกันอยู่เหมือนเดิม วัฒนธรรมเป็นเรื่องที่โยนให้ทีมใดทีมหนึ่งรับไปทำแทนไม่ได้

แล้ว DevOps จริง ๆ คืออะไร

DevOps คือ การเอาคน process และเทคโนโลยีมาทำงานด้วยกัน เพื่อส่งคุณค่าให้ลูกค้าได้ต่อเนื่อง

ถ้าให้ชัดกว่านั้น DevOps คือชุด practice วัฒนธรรมการทำงาน และเทคโนโลยี ที่ทำให้องค์กร

  1. ส่ง software ได้เร็วขึ้น จากโค้ดถึง production ใช้เวลาเป็นชั่วโมง ไม่ใช่เป็นเดือน
  2. ส่ง software ได้เสถียรขึ้น พังน้อยลง และกู้กลับมาได้เร็วขึ้น
  3. ปรับตาม feedback เรียนรู้จากการใช้งานจริง ไม่ได้เดาเอา
  4. ลด toil ให้เครื่อง automate งานซ้ำซาก คนจะได้ไปทำงานที่ต้องใช้คนจริง ๆ
  THE DEVOPS INFINITY LOOP

         PLAN ──────── CODE
        ╱                  ╲
      MONITOR               BUILD
        │                     │
      OPERATE               TEST
        ╲                  ╱
         DEPLOY ──── RELEASE

  ← Continuous everything →
    Planning, Integration, Testing,
    Delivery, Monitoring, Feedback

แต่ละ phase ส่งต่อให้ phase ถัดไป ข้อมูลจาก monitoring ป้อนกลับไปที่ planning test เป็นด่านก่อน release พอ deploy เสร็จ monitoring ก็เริ่มทำงาน Loop นี้วนไม่มีวันหยุด และนั่นแหละคือหัวใจ


Part 3: The Three Ways หลักการพื้นฐานของ DevOps

Three Ways ของ Gene Kim คือฐานคิดที่ DevOps practice ทุกข้อแตกออกมา เข้าใจสามข้อนี้แล้ว practice ไหนก็จะเห็นเหตุผลเองว่าทำไปทำไม

The First Way: Flow

"Maximise the flow of work from Development through Operations to the customer."

The First Way คือเรื่อง flow จากซ้ายไปขวา ไอเดียหนึ่งตั้งแต่เริ่มคิดจนไปถึงมือลูกค้า ใช้เวลาเท่าไร

อะไรก็ตามที่ขวาง flow นี้ นับเป็น waste ทั้งหมด

  THE DEVOPS VALUE STREAM

  Idea → Code → Review → Build → Test → Stage → Deploy → Customer

  FLOW BLOCKERS (measure and eliminate these):
  ✗ Manual approval gates that sit for days
  ✗ Handoffs between teams (with queues)
  ✗ Environments that don't match production
  ✗ Large batch deployments (big bang releases)
  ✗ Long-running branches that cause merge conflicts
  ✗ Tests that take 2 hours to run

Practice ของ First Way: - Batch เล็ก ๆ: commit บ่อย deploy บ่อย - จำกัด work in progress: เลิกเปิดงานใหม่ ปิดงานที่ค้างให้จบก่อน - ทำให้ทุก deploy เล็ก เป็นเรื่องปกติ และเสี่ยงน้อย - Continuous Integration: integrate อย่างน้อยวันละครั้ง - Continuous Delivery: มี artifact พร้อม deploy อยู่ตลอด

The Second Way: Feedback

"Create fast feedback loops from Operations back to Development."

The Second Way คือเรื่อง feedback จากขวาไปซ้าย เกิดอะไรขึ้นใน production แล้วข่าวไปถึงคนที่แก้ได้เร็วแค่ไหน

  FEEDBACK LOOPS (shorter = better)

  Production incident → Development team
  Deployment failure → Developer who caused it
  Performance degradation → Team responsible for the service
  Security vulnerability → Developer who introduced it
  User behaviour → Product team and developers

  FAST FEEDBACK:
  Alert fires → developer sees it → fixes it → ships fix (minutes to hours)

  SLOW FEEDBACK:
  Customer complains → support ticket → triage meeting → sprint planning →
  development → testing → deployment (weeks to months)

Practice ของ Second Way: - ทุก service ต้องมี monitoring และ alerting - ทุก application ต้องมี telemetry ครบ ทั้ง log, metric, trace - Peer review (code review ก็เป็น feedback loop แบบหนึ่ง) - Automated testing (feedback ที่เร็วที่สุด test เจอ bug ก่อนคนจะเจอ) - Blameless post-mortem (ดูที่ process ไม่ได้จ้องเอาผิดตัวคน)

The Third Way: เรียนรู้และทดลองไม่หยุด

"Create a culture of high trust, risk-taking, and continual improvement."

The Third Way บอกว่า DevOps ไม่มีเส้นชัย สิ่งที่ต้องทำคือ ปรับปรุงต่อไปเรื่อย ๆ ไม่มีวันหยุด ทีมเก่ง ๆ ไม่ได้แค่ดูแลให้ระบบรันได้ แต่หาทางทำให้ระบบดีขึ้นอยู่ตลอด

  THE IMPROVEMENT KATA (from Toyota)

  Current State → Target State
       │                │
       └── Experiment ──┘
             │
           Learn
             │
       New Current State → New Target State → ...

Practice ของ Third Way: - Retrospective: นั่งทบทวนกันเป็นประจำ มีรูปแบบชัดเจนว่าจะปรับอะไรต่อ - Blameless post-mortem: เรียนจาก incident โดยไม่หาคนผิด - Chaos engineering: ตั้งใจทำให้ระบบพังเอง ระบบจะได้ทนขึ้น - Innovation time: กันเวลาไว้ให้ทีมได้ลองของใหม่ - Game day: ซ้อมรับมือ incident


Part 4: CALMS ห้าเสาหลักของวัฒนธรรม DevOps

CALMS คือ framework ด้านวัฒนธรรมของ DevOps Jez Humble กับ John Willis เป็นคนทำให้แพร่หลาย ถ้าอยากรู้ว่า "วัฒนธรรม DevOps หน้าตาเป็นยังไงกันแน่" CALMS ตอบได้ครบที่สุด

C — Culture: คนกับ process ต้องมาก่อนเครื่องมือ

Culture เป็นเสาที่ยากที่สุดและสำคัญที่สุด วัฒนธรรมพังเมื่อไร เครื่องมือหรือ automation ดีแค่ไหนก็ช่วยไม่ได้

วัฒนธรรม DevOps มีสัญญาณที่จับต้องได้ชัด ๆ แบบนี้

  DEVOPS CULTURE INDICATORS

  ✓ Shared goals: Dev and Ops measured on the same outcomes
                 (deployment frequency, MTTR) — not siloed metrics

  ✓ Psychological safety: engineers can raise concerns and admit
                         mistakes without fear of punishment

  ✓ Blameless mindset: incidents are system failures, not person failures

  ✓ You build it, you run it: teams own their services in production
                              (no "throw it over the wall")

  ✓ Empathy across roles: developers understand operational constraints;
                         operators understand development pressures

ลองวัดวัฒนธรรมทีมดู: เกิด production incident แล้ว ทีมทำยังไงต่อ ถ้าปิดเงียบ ทำเป็นเรื่องเล็ก หรือชี้นิ้วหาคนผิด แปลว่าทีมอยู่กับความกลัว แต่ถ้าเขียน post-mortem แบบเปิดเผย แชร์ว่าได้บทเรียนอะไร แล้วแก้ที่ระบบ แบบนี้คือวัฒนธรรม DevOps

Etsy เปลี่ยนที่วัฒนธรรมก่อน

Etsy (e-commerce marketplace) เป็นหนึ่งใน DevOps success story รุ่นแรก ๆ ปี 2009 Etsy deploy ขึ้น production สัปดาห์ละครั้ง ใช้ engineer แปดคน กินเวลาสามชั่วโมง และเครียดกันทั้งทีม พอถึงปี 2011 Etsy deploy วันละ 25 ครั้งขึ้นไป และ engineer คนไหนก็ deploy เองได้

จุดเริ่มคือวัฒนธรรม ทั้ง blameless post-mortem การรับผิดชอบร่วมกัน และ psychological safety เครื่องมือค่อยตามมาทีหลัง ไม่ได้เริ่มจากเครื่องมือ

A — Automation: กำจัด toil

Toil คืองานที่ต้องทำมือ ทำซ้ำไปซ้ำมา ให้เครื่องทำแทนได้ เป็นงานแก้เฉพาะหน้า และทำเสร็จแล้วไม่เหลือคุณค่าระยะยาว Toil คือตัวถ่วงของทีม engineering ที่อยากเก่ง

  THE TOIL TEST

  Is this work:
  ✓ Manual (a human does it every time)?
  ✓ Repetitive (done over and over)?
  ✓ Automatable (a computer could do it)?
  ✓ Tactical (not improving anything)?
  ✓ Without enduring value (no lasting outcome)?

  If yes to all five → this is toil. Automate it.

ใน DevOps ควร automate อะไรบ้าง:

หมวด สิ่งที่ควร automate
Code quality Linting, formatting, type checking (รันตอน save หรือ commit)
Testing Test suite ทุกชุด (unit, integration, E2E)
Security SAST, dependency scanning, secret detection
Build Compilation, packaging, Docker image build
Deployment Deploy ทุกครั้ง ห้าม kubectl apply ด้วยมือเด็ดขาด
Infrastructure Provisioning ด้วย Terraform, Pulumi
Monitoring สร้าง alert และ provision dashboard
Incident response รัน runbook ให้อัตโนมัติสำหรับ failure mode ที่รู้อยู่แล้ว

หนังสือ SRE ของ Google แนะนำไว้ว่า ทีม SRE ไม่ควรเสียเวลากับ toil เกิน 50% เวลาที่เหลือต้องเอาไปทำงาน engineering ที่ช่วยลด toil ในวันข้างหน้า

L — Lean: batch เล็ก ตัด waste

Lean ใน DevOps มาจาก Toyota Production System โดยตรง ปรัชญาเดียวกันนี้ก็เป็นรากของ Agile ด้วย

บทเรียนหลักของ lean ในงาน software คือ batch ใหญ่คือศัตรู แก้โค้ดทีละเยอะ ๆ release ก้อนใหญ่ deploy ก้อนใหญ่ ทั้งหมดนี้เพิ่มความเสี่ยง และทำให้ได้ feedback ช้าลง

  LARGE BATCH vs SMALL BATCH

  LARGE BATCH (traditional):
  2 months of work → 1 giant release → 50 bugs → 2-week hotfix → repeat

  SMALL BATCH (DevOps):
  2 hours of work → deploy → 0-1 bugs → fix in minutes → deploy again

  The math: 10 small releases have LESS total risk than 1 large release.
  Risk grows super-linearly with batch size.

Lean practice ใน DevOps: - จำกัด Work In Progress (WIP): เลิกเปิดงานใหม่ ปิดงานที่ค้างให้จบก่อน - Value Stream Mapping: วาดให้เห็นว่า waste อยู่ตรงไหนใน pipeline แล้วตัดทิ้ง - Single-piece flow: แต่ละ change วิ่งผ่าน pipeline ของตัวเอง ไม่ต้องรอกัน - ไม่เก็บ inventory: โค้ดที่ยังไม่ได้ deploy ก็คือของค้างสต็อกที่ไม่สร้างคุณค่าอะไรเลย

M — Measurement: ตัดสินใจด้วยข้อมูล

ใน DevOps ไม่เถียงกันด้วยความเห็น แต่ดูตัวเลข อะไรที่ไม่ได้วัด ก็ไม่มีทางรู้ว่าดีขึ้นหรือเปล่า

ควรวัดอะไรบ้าง:

✦ Revenue per deploy
✦ Customer satisfaction (NPS, CSAT)
✦ Feature adoption rate
✦ Time from idea to customer value
✦ Deployment Frequency — how often you deploy
✦ Lead Time for Changes — commit to production time
✦ Change Failure Rate — % of deploys causing incidents
✦ Mean Time to Restore — how fast you recover
✦ Request Rate — requests per second
✦ Error Rate — % of requests returning errors
✦ Duration — response time (p50, p95, p99)
✦ Utilisation — % resource used (CPU, memory)
✦ Saturation — work queued or waiting
✦ Errors — error events (disk errors, network drops)

Anti-pattern ที่เจอบ่อยคือ vanity metric จำนวนบรรทัดโค้ด story point ที่ปิดได้ จำนวน ticket ที่ปิด ตัวเลขพวกนี้พุ่งขึ้นได้ทั้งที่ระบบแย่ลง ให้วัด outcome อย่าวัดแค่ output

S — Sharing: ความรู้เป็นของทั้งทีม

ทีม DevOps เก่ง ๆ ดูแลความรู้แบบเดียวกับ infrastructure ต้องคอยอัปเดต มี version และทุกคนเปิดดูได้

การแชร์ความรู้ในทางปฏิบัติ:

  • เผยแพร่ blameless post-mortem ให้ทั้งบริษัทอ่าน ทุก incident จะได้เป็นบทเรียนของทุกคน
  • ทุก service มี runbook on-call คนไหนก็รับมือได้ ไม่ต้องรอคนเขียนคนเดียว
  • Architecture Decision Record เหตุผลเบื้องหลัง design จะได้ไม่อยู่ในหัวใครคนเดียว
  • Community of Practice กลุ่มข้ามทีมที่แลกความรู้กันเรื่องใดเรื่องหนึ่ง
  • InnerSource ดูแล repository ภายในแบบ open source (ใครก็ contribute ได้ ใครก็เปิดดูได้)
  • Game day ซ้อม scenario incident ให้ทั้งทีมรับมือเป็น ไม่ใช่แค่ senior engineer

Part 5: เจาะลึก DevOps Lifecycle

DevOps infinity loop มีแปด phase มาดูกันว่าในงานจริงแต่ละ phase ทำอะไร

Plan

  TOOLS: Jira, Linear, GitHub Issues, Confluence, Miro

  PRACTICES:
  ✦ OKRs define the quarter's objectives and measurable outcomes
  ✦ Sprint planning breaks OKRs into deliverable stories
  ✦ Architecture Decision Records (ADRs) document key design choices
  ✦ Definition of Ready — stories must meet criteria before sprint entry

  THE DEVOPS DIFFERENCE:
  Operations joins planning. If a feature will require new infrastructure,
  on-call rotation changes, or monitoring additions, Ops knows before coding starts.

Code

  TOOLS: VS Code, JetBrains, GitHub Copilot, Git

  PRACTICES:
  ✦ Trunk-Based Development — short-lived branches, daily merges
  ✦ Pair programming / mob programming for complex work
  ✦ Pre-commit hooks — lint, format, secret scan before commit
  ✦ Conventional Commits — structured commit messages for automation

  THE DEVOPS DIFFERENCE:
  Developers write infrastructure code (Terraform, Helm charts) alongside
  application code. "Works on my machine" is eliminated by shared
  Docker Compose environments that mirror production exactly.

Build

  TOOLS: GitHub Actions, GitLab CI, Jenkins, CircleCI, Buildkite

  WHAT HAPPENS ON EVERY COMMIT:
  ✦ Dependency installation (from lock file)
  ✦ Compilation / bundling
  ✦ Static analysis (linting, type checking)
  ✦ Unit tests (< 5 minutes total)
  ✦ SAST security scan
  ✦ Docker image build

  THE DEVOPS DIFFERENCE:
  Build artifacts are immutable. The same Docker image SHA that passed
  tests is the exact image that goes to production — not rebuilt, not modified.
  "It works in staging" is guaranteed because the artifact is identical.

Test

  THE TESTING PORTFOLIO

  Unit Tests          → ms, run every commit, developer feedback loop
  Integration Tests   → seconds, run every commit, service boundary validation
  Contract Tests      → minutes, validate API contracts between services
  E2E Tests           → minutes, validate critical user journeys
  Performance Tests   → minutes, catch regressions before production
  Security Tests      → minutes, DAST against staging environment
  Chaos Tests         → ongoing, verify resilience to failures

  GOAL: < 10 minute total pipeline. If tests take longer, team stops
  running them. Fast feedback > comprehensive coverage.

Release

  THE THREE DEPLOYMENT STRATEGIES

  ┌─────────────────────────────────────────────────────────────┐
  │ BLUE-GREEN DEPLOYMENT                                        │
  │                                                             │
  │ Blue (v1) ←── 100% traffic    Green (v2) ←── 0% traffic   │
  │                                                             │
  │ Deploy v2 to Green → Run smoke tests → Switch traffic →    │
  │ Green now gets 100%. Blue kept as rollback.                 │
  │                                                             │
  │ Rollback: switch traffic back to Blue (< 1 minute)          │
  └─────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ CANARY DEPLOYMENT                                            │
  │                                                             │
  │ v1: 100% → v2: 5% of traffic → monitor → v2: 25% →        │
  │ monitor → v2: 50% → monitor → v2: 100%                     │
  │                                                             │
  │ Real users validate. Errors above threshold = auto-rollback │
  └─────────────────────────────────────────────────────────────┘

  ┌─────────────────────────────────────────────────────────────┐
  │ FEATURE FLAGS                                                │
  │                                                             │
  │ Code is deployed but feature is disabled.                   │
  │ Enable for: internal users → beta users → % of users → all │
  │                                                             │
  │ Decouple deployment (technical) from release (business)     │
  └─────────────────────────────────────────────────────────────┘

Deploy

  TOOLS: Kubernetes, Argo CD, Helm, Terraform

  GITOPS PRINCIPLE:
  ✦ All deployments are triggered by git commits — no manual kubectl
  ✦ The git repository is the single source of truth for cluster state
  ✦ Argo CD watches the repo and reconciles the cluster to match
  ✦ Every deployment is auditable: who changed what, when, why

  ZERO-DOWNTIME DEPLOYMENT REQUIREMENTS:
  ✦ Rolling updates with maxUnavailable=0
  ✦ SIGTERM handling — app finishes in-flight requests before shutdown
  ✦ Health checks — Kubernetes waits for readiness before routing traffic
  ✦ Graceful shutdown period — 30 seconds to drain connections

Operate

  THE SRE (SITE RELIABILITY ENGINEERING) APPROACH:

  ✦ SLOs (Service Level Objectives) define "good enough" uptime
  ✦ Error budgets quantify acceptable unreliability
  ✦ On-call rotations distribute the operational burden
  ✦ Runbooks document response procedures for known failure modes
  ✦ Capacity planning ensures resources ahead of demand

  "YOU BUILD IT, YOU RUN IT":
  Development teams are on-call for their own services. This creates
  powerful feedback: if your service pages you at 3am, you fix the root
  cause — you don't just restart the pod and go back to sleep.

Monitor

  THE THREE PILLARS OF OBSERVABILITY:

  LOGS   → What happened? (events, errors, state changes)
  METRICS → How is it performing? (rates, counts, latencies)
  TRACES → Why is it slow? (distributed call paths)

  ALERTING PHILOSOPHY:
  ✦ Alert on symptoms, not causes (alert on high error rate, not "CPU high")
  ✦ Every alert must be actionable — if you can't do anything, don't alert
  ✦ Alert fatigue kills on-call culture — fewer, better alerts
  ✦ SLO-based alerting: alert when error budget is burning too fast

Part 6: CI/CD — เครื่องยนต์ของ DevOps

ถ้าอยากเห็น DevOps practice ที่จับต้องได้ที่สุด ก็ดูที่ Continuous Integration กับ Continuous Delivery/Deployment

Continuous Integration (CI)

CI คือ developer ทุกคน merge โค้ดเข้า main branch อย่างน้อยวันละครั้ง และทุกครั้งที่ merge ระบบจะ build และรัน test ให้อัตโนมัติ

  WITHOUT CI:                       WITH CI:

  Developer A works for 2 weeks    Developer A integrates daily
  Developer B works for 2 weeks    Developer B integrates daily
  Merge day → 3 days of conflicts  Merge day → 30 minutes, if any

  "Integration hell" → common      Conflicts caught within hours
  and expensive                    of introduction → cheap to fix

กติกาของ CI:

  CI RULES (non-negotiable):

  1. The build must not be broken. Ever.
     If you break it, you fix it immediately — before doing anything else.

  2. If the build fails, everyone stops.
     A broken build is the team's highest priority. Nobody starts new work
     while the build is red.

  3. Commit at least daily.
     Long-lived branches undermine CI. If you haven't integrated today,
     you haven't integrated.

  4. The build must be fast.
     > 10 minutes = developers stop running it. Target < 5 minutes.

Continuous Delivery vs Continuous Deployment

สองคำนี้คนสับสนกันบ่อย แต่ความหมายไม่เหมือนกัน

  CONTINUOUS DELIVERY:
  Every change is always in a deployable state.
  Deployment to production is a BUSINESS decision — triggered by humans
  when the business is ready.

  CONTINUOUS DEPLOYMENT:
  Every change that passes automated tests is AUTOMATICALLY deployed
  to production. No human approval step.

         CI        CD (Delivery)    CD (Deployment)
  Code → Build → Test → Staging → [Human approves] → Production
                                OR
  Code → Build → Test → Staging → [Automated] ──────→ Production

ควรใช้แบบไหน?

Continuous Deployment คือเป้าหมายสูงสุด เพราะบังคับให้ทีมแก้ทีละนิด ได้ feedback เร็ว และต้องไว้ใจ automation จริง ๆ แต่มีของที่ต้องพร้อมก่อน

  • Automated test coverage สูงมาก
  • Feature flag ไว้คุมว่าใครจะเห็น feature ใหม่
  • Monitoring และ alerting ที่ดีจริง
  • ขั้นตอน rollback ที่ใช้งานจนคล่องแล้ว

ทีมส่วนใหญ่เริ่มจาก Continuous Delivery (ให้คน approve ก่อนขึ้น production) พอมั่นใจมากขึ้นค่อยขยับไปเป็น Continuous Deployment


Part 7: DORA Metrics วัดผล DevOps ด้วยตัวเลข

งานวิจัยของ DORA (DevOps Research and Assessment) เจอว่ามี metric อยู่สี่ตัว ที่บอกได้แม่นที่สุดว่าทีมส่ง software ได้ดีแค่ไหน และองค์กรจะได้ผลลัพธ์ยังไง

  THE FOUR DORA METRICS

  ┌─────────────────────────────────────────────────────────────────────┐
  │ METRIC              │ WHAT IT MEASURES          │ TARGET (Elite)     │
  ├─────────────────────┼───────────────────────────┼────────────────────┤
  │ Deployment          │ How often you deploy to   │ Multiple times     │
  │ Frequency           │ production                │ per day            │
  ├─────────────────────┼───────────────────────────┼────────────────────┤
  │ Lead Time for       │ Commit → running in        │ Less than          │
  │ Changes             │ production                │ one hour           │
  ├─────────────────────┼───────────────────────────┼────────────────────┤
  │ Change Failure      │ % of deploys that cause   │ 0-5%               │
  │ Rate                │ a production incident     │                    │
  ├─────────────────────┼───────────────────────────┼────────────────────┤
  │ Mean Time to        │ How fast you recover from │ Less than          │
  │ Restore (MTTR)      │ a production incident     │ one hour           │
  └─────────────────────┴───────────────────────────┴────────────────────┘

ทำไมต้องสี่ตัวนี้ delivery performance วัดกันที่สองเรื่องที่ดูเหมือนดึงกันไปมา คือความเร็วกับความเสถียร สี่ตัวนี้ครอบคลุมทั้งสองฝั่ง

  • Deployment Frequency + Lead Time = ความเร็ว (throughput)
  • Change Failure Rate + MTTR = ความเสถียร (คุณภาพและ resilience)

ประเด็นสำคัญจากงานวิจัยของ DORA คือ ความเร็วกับความเสถียรไม่ต้องแลกกัน ทีมระดับ Elite ทั้งเร็วกว่าและเสถียรกว่าทีมระดับ Low แถม practice ที่ทำให้ระบบนิ่งขึ้น (automated testing, batch เล็ก, monitoring ดี ๆ) ก็ทำให้เร็วขึ้นไปด้วย เพราะเสียเวลาไปกับการแก้งานซ้ำ incident และการดับไฟน้อยลง

  DORA PERFORMANCE BANDS (2023):

  ┌──────────────────────┬────────────┬────────────┬────────────┬──────────┐
  │ Metric               │ Elite      │ High       │ Medium     │ Low      │
  ├──────────────────────┼────────────┼────────────┼────────────┼──────────┤
  │ Deployment Frequency │ Multiple/  │ Daily–     │ Weekly–    │ < Monthly│
  │                      │ day        │ weekly     │ monthly    │          │
  ├──────────────────────┼────────────┼────────────┼────────────┼──────────┤
  │ Lead Time            │ < 1 hour   │ 1 day–     │ 1 week–    │ > 6 mos  │
  │                      │            │ 1 week     │ 1 month    │          │
  ├──────────────────────┼────────────┼────────────┼────────────┼──────────┤
  │ Change Failure Rate  │ 0–5%       │ 0–15%      │ 16–30%     │ 16–30%   │
  ├──────────────────────┼────────────┼────────────┼────────────┼──────────┤
  │ MTTR                 │ < 1 hour   │ < 1 day    │ 1 day–     │ > 6 mos  │
  │                      │            │            │ 1 week     │          │
  └──────────────────────┴────────────┴────────────┴────────────┴──────────┘

Part 8: DevOps Toolchain

DevOps เริ่มที่วัฒนธรรมก็จริง แต่จะทำให้วัฒนธรรมเกิดขึ้นได้จริงก็ต้องมีเครื่องมือ นี่คือ toolchain มาตรฐานแยกตามหมวด

  DEVOPS TOOLCHAIN MAP

  PLAN          CODE           BUILD          TEST
  ─────────     ────────       ──────         ──────
  Jira          Git            GitHub Actions  pytest
  Linear        GitHub         GitLab CI       Jest
  Confluence    GitLab         Jenkins         Selenium
  Miro          VS Code        CircleCI        k6 (perf)
  Notion        JetBrains      Buildkite       OWASP ZAP

  RELEASE        DEPLOY         OPERATE        MONITOR
  ──────────     ──────         ──────────     ────────
  Argo CD        Kubernetes     PagerDuty      Prometheus
  Spinnaker      Helm           Opsgenie       Grafana
  LaunchDarkly   Terraform      VictorOps      Loki
  (feature flags)Pulumi         Runbooks       Jaeger
                 Crossplane                    OpenTelemetry
                                               Datadog

กฎทองของ DevOps tooling คือเครื่องมือมีไว้ช่วยวัฒนธรรม เลือกเครื่องมือที่บังคับให้ทีมทำ practice ที่อยากได้ เช่น automated testing, infrastructure as code, observability อย่าซื้อเครื่องมือมาแค่เพื่อให้ process ห่วย ๆ วิ่งเร็วขึ้น


Part 9: SRE คำตอบของ Google ว่า "ใครดูแลระบบ"

Site Reliability Engineering (SRE) คือวิธีที่ Google เอาหลักการ DevOps มาใช้จริง Ben Treynor Sloss เริ่มวางแนวทางไว้ตั้งแต่ปี 2003 และ Google เขียนรวบรวมไว้ใน SRE Book (2016)

DevOps เป็นปรัชญา ส่วน SRE คือวิธีลงมือที่ Google กำหนดไว้ชัดว่าต้องทำ practice อะไร และใครรับบทบาทไหน

แนวคิดหลักของ SRE

SLI — Service Level Indicator ตัวเลขที่บอกว่า service ทำงานได้ดีแค่ไหน

  SLI examples:
  ✦ Availability: % of requests returning 2xx in the last 30 days
  ✦ Latency: % of requests completing in < 200ms
  ✦ Throughput: requests processed per second
  ✦ Durability: % of stored data successfully retrieved

SLO — Service Level Objective ค่าเป้าหมายที่ตั้งไว้ให้ SLI

  SLO examples:
  ✦ 99.9% of requests return 2xx over a 30-day window
  ✦ 95% of requests complete in < 200ms
  ✦ 99.999% data durability

SLA — Service Level Agreement สิ่งที่สัญญากับลูกค้าไว้ในสัญญา (ปกติจะตั้งหลวมกว่า SLO)

  SLA: "We guarantee 99.5% uptime"
  SLO: "We target 99.9% uptime internally"
  SLI: "Current measured uptime: 99.97%"

  The gap between SLO and SLA is your safety buffer.

Error Budget ระบบพังได้อีกเท่าไรก่อนจะหลุด SLO

  SLO: 99.9% availability over 30 days
  Error Budget: 0.1% of 30 days = 43.8 minutes of allowable downtime

  Error Budget Policy:
  ✦ Budget is plentiful → deploy freely, take risks, experiment
  ✦ Budget is running low → slow deployments, focus on reliability
  ✦ Budget is exhausted → feature freeze until reliability improves

Error budget ทำให้ product กับ engineering มีเป้าร่วมกัน product อยากได้ feature เร็ว ๆ (ซึ่งกิน error budget) engineering อยากได้ reliability (ซึ่งต้องเหลือ error budget ไว้) สองฝ่ายต้องตกลงกัน โดยดูจากตัวเลข ไม่ใช่ใช้การเมือง

ลด toil คือภารกิจของ SRE

SRE Book ของ Google ตั้งเป้าไว้ชัด ทีม SRE ไม่ควรเสียเวลากับ toil เกิน 50% อีก 50% ต้องเอาไปทำ engineering project ที่ลด toil ในวันข้างหน้า

  THE TOIL → AUTOMATION CYCLE

  Identify toil (manual, repetitive work)
       ↓
  Estimate time cost per week
       ↓
  Engineer automation solution
       ↓
  Toil is eliminated
       ↓
  Time freed up for more automation
       ↓ (and repeat)

ทีม SRE ใช้วิธีนี้ทำให้ระบบ reliable ขึ้นเรื่อย ๆ ทั้งที่ใช้คนน้อยลง ไม่ได้พึ่งฮีโร่คนไหน แต่ไล่ตัด toil ทิ้งอย่างเป็นระบบ


Part 10: DevOps แตกสาขา ครอบครัวใหญ่ขึ้นเรื่อย ๆ

พอเอาหลักการ DevOps ไปใช้กับงานด้านอื่นที่อยู่ใกล้ ๆ ก็เกิดสาขาใหม่ตามมาหลายสาย

DevSecOps: ขยับ security มาไว้ต้นทาง

  TRADITIONAL SECURITY:
  Design → Code → Build → Test → Stage → Deploy → SECURITY REVIEW → Production
                                                         ↑
                                          Security is the last gate.
                                          Vulnerabilities found here
                                          cost 100× more to fix.

  DEVSECOPS:
  [Security from day 1]
  Design → Code → Build → Test → Stage → Deploy → Production
    ↑        ↑      ↑       ↑      ↑       ↑
  Threat  Secret  SAST   DAST  Pen    Runtime
  model   scan   scan   scan  test   protection

DevSecOps ใส่ security practice ลงไปในทุก stage ของ DevOps lifecycle

Stage Security practice
Plan Threat modelling, security requirement
Code SAST (Semgrep, SonarQube), secret detection (detect-secrets)
Build Dependency scanning (OWASP, Snyk), container scanning (Trivy)
Test DAST (OWASP ZAP), penetration testing
Deploy Policy as code (OPA, Kyverno), image signing
Operate Runtime security (Falco), WAF
Monitor Security information and event management (SIEM)

FinOps: ดูแลค่า cloud แบบงาน engineering

  THE FINOPS PROBLEM:

  Cloud enables any engineer to provision any resource, instantly.
  Without visibility and accountability, cloud bills spiral.

  "We're not sure what's costing so much" → $500K surprise bill

Cloud คิดเงินตามที่ใช้จริง ยอดเลยขึ้นลงได้ตลอด FinOps คือ practice ที่ทำให้มีคนรับผิดชอบค่าใช้จ่ายตรงนี้

  FINOPS LIFECYCLE

  INFORM              OPTIMISE            OPERATE
  ─────────           ────────            ───────
  Visibility:         Right-sizing:       Tagging policy:
  Know what you       Match resource      Every resource tagged
  spend and why       to actual need      by team, service, env

  Cost allocation:    Reserved capacity:  Budgets and alerts:
  Costs attributed    Commit for          Alert before
  to teams/services   discounts           overspend, not after

  Anomaly detection:  Auto-scaling:       Chargebacks:
  Spot unusual        Scale down when     Teams see their
  cost spikes fast    load drops          cloud bill

Metric หลักของ FinOps:

  ✦ Cost per deploy      — is shipping getting cheaper or more expensive?
  ✦ Cost per customer    — unit economics at cloud scale
  ✦ Rightsizing score    — what % of resources are appropriately sized?
  ✦ Reserved coverage    — what % of baseline is on committed pricing?
  ✦ Waste ratio          — idle or unused resources as % of total spend

GitOps: ให้ Git เป็นตัวกำหนด infrastructure

  GITOPS PRINCIPLE:

  Git is the single source of truth for:
  ✦ Application code
  ✦ Infrastructure configuration (Terraform)
  ✦ Kubernetes manifests (Helm, Kustomize)
  ✦ CI/CD pipeline definitions

  All changes go through git (PR → review → merge).
  No manual console clicks in production. Ever.

  Argo CD / Flux watches git → applies changes to cluster automatically.
  If someone manually changes something in the cluster → auto-reverted.

MLOps: DevOps สำหรับงาน Machine Learning

  THE ML PROBLEM:
  Data science teams build models in Jupyter notebooks.
  Models stay in notebooks. Never reach production.
  When they do reach production, nobody can reproduce them.
  When data drifts, nobody knows the model is degrading.

  MLOPS PRACTICES:
  ✦ Experiment tracking (MLflow, Weights & Biases)
  ✦ Model versioning (DVC, Hugging Face)
  ✦ Automated retraining pipelines
  ✦ Model monitoring (data drift, performance decay)
  ✦ Feature stores (Feast, Tecton)
  ✦ A/B testing for model versions

Platform Engineering: DevOps เมื่อองค์กรใหญ่ขึ้น

พอต้องขยาย DevOps practice ไปให้ทีมมากกว่า 50 ทีม Platform Engineering ก็กลายเป็นสาขาเฉพาะขึ้นมา

  THE PLATFORM ENGINEERING MODEL

  Platform Team builds:
  ┌─────────────────────────────────────────────────────────────┐
  │         INTERNAL DEVELOPER PLATFORM (IDP)                   │
  │                                                             │
  │  Self-service deployment    Standardised observability       │
  │  Automated provisioning     Golden path CI/CD templates     │
  │  Internal service catalog   Secrets management              │
  └─────────────────────────────────────────────────────────────┘
              │                           │
              ▼                           ▼
  Product Team A                  Product Team B
  (consumes platform,             (consumes platform,
   focuses on product)             focuses on product)

  "Pave the golden path, don't mandate the only path."

Platform Engineering ตอบคำถามว่า "จะขยาย DevOps ให้เกิน 10 ทีมได้ยังไง" แทนที่ทุกทีมจะทำ CI/CD, observability และวิธี deploy ขึ้นมาเองซ้ำ ๆ ทีม Platform จะสร้าง shared infrastructure ให้ใช้ร่วมกัน ทางที่ถูกต้องจะได้เป็นทางที่ง่ายที่สุดด้วย


Part 11: DevOps ของจริง บริษัทใหญ่ทำกันยังไง

Amazon: "You Build It, You Run It"

Amazon เป็นเคสเปลี่ยนมาทำ DevOps ที่มีคนเขียนถึงมากที่สุดเคสหนึ่งในวงการ ปี 2001 Amazon ยังเป็น monolith ที่ deploy ทุก 11.6 วินาที ตัวเลขนี้เกิดขึ้นเองแบบไม่ได้ตั้งใจ ระหว่างที่กำลังรื้อ architecture ครั้งใหญ่

พอถึงปี 2011 Amazon - แตกออกเป็น microservice หลายร้อยตัว (แต่ละตัวมี two-pizza team เป็นเจ้าของ) - ทุกทีมดูแลเองครบ ทั้ง development, deployment และ operations - Deploy รวมทุก service วันละ 23,000 ครั้ง

นโยบายหลักคือ "You build it, you run it." service ของใครเด้ง page ตอนตีสาม คนนั้นก็ต้องลุกมาแก้เอง ทีมเลยมีแรงจูงใจเต็มที่ที่จะสร้าง service ที่ monitor ดี debug ง่าย และทนทาน

Netflix: Chaos Engineering

Netflix เอา DevOps ไปไกลถึงขั้นตั้งใจทำระบบตัวเองพัง Chaos Engineering คือการปล่อยให้ production เจอ failure จริง ๆ เพื่อพิสูจน์ว่าระบบทนได้ Netflix เป็นผู้บุกเบิกด้วย Chaos Monkey (2011)

  CHAOS MONKEY: randomly terminates production instances
  CHAOS GORILLA: terminates an entire AWS Availability Zone
  CHAOS KONG: simulates an entire AWS region failure

  The philosophy: if you don't test for failure, you'll be surprised by it.
  If you regularly test for failure, you build systems that survive it.

Netflix deploy วันละหลายร้อยครั้ง ทำได้เพราะ - Automated testing ครอบคลุม - ทุก service มี circuit breaker และ fallback ในตัว - ทำ chaos engineering จริงจัง เพื่อเช็กว่าที่คิดว่าระบบทนได้ ทนได้จริงไหม - วัฒนธรรม blameless ใครเจอปัญหาก่อนได้คำชม ไม่ได้โดนตำหนิ

ING Bank: DevOps ในองค์กรใหญ่

DevOps ไม่ได้จำกัดอยู่แค่บริษัท tech ING ธนาคารจากเนเธอร์แลนด์ เป็นเคส enterprise DevOps ที่คนยกมาอ้างบ่อยที่สุดเคสหนึ่ง

ปี 2015 ING รื้อโครงสร้างจาก silo แบ่งตามหน้าที่แบบเดิม มาเป็น "squad" ทีมเล็ก ๆ แบบ cross-functional (คล้ายโมเดลของ Spotify) แต่ละ squad ดูแล product area ของตัวเองแบบ end-to-end รวม operations ด้วย

ผ่านไป 3 ปี ผลที่ได้คือ - Deployment frequency จากเดือนละครั้ง กลายเป็นวันละหลายครั้ง - Time to market ของ feature ใหม่ลดลง 70% - Application availability ขยับจาก 98.5% เป็น 99.9% - คะแนน employee engagement สูงขึ้น (ทีมชอบโมเดลใหม่มากกว่า)

บทเรียนคือ DevOps ไม่ใช่ของเฉพาะ startup ใน Silicon Valley อุตสาหกรรมที่มี regulation เข้ม อย่างธนาคาร healthcare หรือประกันภัย ก็ทำ DevOps ได้ และหลายเจ้าก็ทำสำเร็จแล้ว


Part 12: เริ่มเปลี่ยนองค์กรมาทำ DevOps ยังไง

องค์กรส่วนใหญ่ที่พยายามเปลี่ยนมาทำ DevOps ล้มเหลว ไอเดียไม่ได้ผิด แต่ไปพลาดตอนลงมือ

แบบที่ล้มเหลวบ่อย ๆ

  ❌ FAILURE: "We hired a DevOps team"
  Why it fails: Creates a new silo. Other teams still throw code over a wall.
  Fix: Embed DevOps practices in every team. Platform team enables, not executes.

  ❌ FAILURE: "We bought the tools (Jenkins, Docker, Kubernetes)"
  Why it fails: Tools without culture produce automated bad processes.
  Fix: Culture and process first. Tools should enforce the culture.

  ❌ FAILURE: "We told everyone they're doing DevOps now"
  Why it fails: Decree without support doesn't change behaviour.
  Fix: Start with a willing pilot team. Show results. Expand with proof.

  ❌ FAILURE: "We did a big-bang transformation"
  Why it fails: Big changes create resistance and backslide.
  Fix: Small, continuous improvements. One practice at a time.

  ❌ FAILURE: "We skipped the culture work"
  Why it fails: Without psychological safety, people won't risk new practices.
  Fix: Blameless post-mortems. Celebrate learning. Reward transparency.

เปลี่ยนให้สำเร็จใน 3 ขั้น

Step 1: Value Stream Mapping (สัปดาห์ที่ 1-4)

ก่อนจะเปลี่ยนอะไร ต้องรู้ก่อนว่าตอนนี้ทำงานกันยังไง ไล่ map ทุก step ตั้งแต่ "developer commit โค้ด" จนถึง "user ได้ใช้ของจริง"

  VALUE STREAM MAP EXERCISE:

  Ask for each step:
  ✦ How long does this step take?
  ✦ What's the wait time before this step starts?
  ✦ What's the error/rework rate at this step?
  ✦ Who does this? Can it be automated?

  Example findings:
  Code review: 2 days wait, 4 hours work
  QA testing:  3 days wait, 1 day work
  Change board: 5 days wait, 1 hour work
  Deployment:  1 week wait, 4 hours work (manual, error-prone)

  Total lead time: 3 weeks
  Total value-add time: 2 days
  Waste: 93%

Step 2: Pilot Team (เดือนที่ 1-3)

เลือกมาหนึ่งทีมที่อยากลอง และดูแล product ที่สำคัญจริง ให้ทีมนี้เริ่มทำ core practice - Trunk-based development - CI/CD pipeline (build, test และ deploy ขึ้น staging อัตโนมัติ) - Structured logging และ monitoring ขั้นพื้นฐาน - Retrospective ทุก sprint

วัด DORA metric ทั้งก่อนและหลัง แล้วจดผลไว้ให้ชัด

Step 3: ขยายผลด้วยหลักฐาน (เดือนที่ 3 เป็นต้นไป)

เอาผลจาก pilot ไปชวนทีมถัดไป แล้วก็ทีมต่อไปอีก ตั้งทีม Platform ขึ้นมา เปลี่ยนสิ่งที่ได้ผลให้เป็น shared infrastructure หน้าที่ของทีม Platform คือทำให้ practice ที่ถูกต้องเป็นทางที่ง่ายที่สุดสำหรับทุกทีม

  THE EXPANSION ROADMAP

  Month 1-3:   Pilot team + CI/CD + monitoring
  Month 3-6:   Platform team formed, golden path CI/CD template
  Month 6-9:   3-5 teams on platform
  Month 9-12:  GitOps, self-service deployment, SLOs
  Year 2:      All teams on platform, DORA metrics tracked org-wide
  Year 3:      DevSecOps, FinOps, Platform Engineering mature

สรุป mindset ที่ต้องเปลี่ยน

สุดท้ายแล้ว DevOps คือการเปลี่ยนวิธีคิดหลายเรื่อง เทียบก่อนกับหลังให้เห็นชัด ๆ

ก่อน DevOps หลัง DevOps
"ไม่ใช่เรื่องของฉัน" (silo) "ระบบของเรา ปัญหาของเรา" (เป็นเจ้าของร่วมกัน)
โทษคน แก้ที่ระบบ
เปลี่ยนอะไรก็เสี่ยง เปลี่ยนทีละนิด เสี่ยงน้อย
Deploy เดือนละครั้ง (คิดว่าปลอดภัย) Deploy ทุกวัน (ปลอดภัยกว่าจริง)
"เครื่องผมรันได้นะ" "รันได้ก็ได้ทุกที่ ไม่ได้ก็ไม่ได้ทุกที่" (environment เดียวกัน)
Ops คุมการ release ใครก็ release ได้ทุกเมื่อ
Security เป็นด่านสุดท้าย Security อยู่ในทุก stage
วัดจำนวน story ที่ ship วัดคุณค่าที่ไปถึงลูกค้า
Feedback loop ยาว Feedback เร็วทุกจุด
ความรู้อยู่ในหัวคน ความรู้อยู่ในเอกสารและระบบ

Summary

  WHAT: Culture + Practices + Tools that enable continuous value delivery

  WHY:  Eliminate the wall of confusion between Dev and Ops.
        Ship faster, recover faster, learn faster.

  THE THREE WAYS:
  1. Flow      — remove obstacles between code and customer
  2. Feedback  — fast loops from production back to development
  3. Learning  — continuous improvement, never stop experimenting

  CALMS PILLARS:
  Culture → Automation → Lean → Measurement → Sharing

  THE LOOP:
  Plan → Code → Build → Test → Release → Deploy → Operate → Monitor → (repeat)

  CI: Integrate daily, automated build + test on every commit
  CD: Always deployable; production deployment is a business decision
  CD: Every passing change auto-deploys (requires high automation maturity)

  DORA METRICS (measure these, improve these):
  ✦ Deployment Frequency    (elite: multiple/day)
  ✦ Lead Time for Changes   (elite: < 1 hour)
  ✦ Change Failure Rate     (elite: < 5%)
  ✦ Mean Time to Restore    (elite: < 1 hour)

  EXTENSIONS:
  DevSecOps  — security at every stage
  FinOps     — cloud cost as engineering discipline
  GitOps     — git as the single source of truth
  MLOps      — DevOps for machine learning
  Platform Engineering — DevOps at scale (50+ teams)

  HOW TO START:
  1. Map your value stream (find the waste)
  2. Run a pilot team (prove the practices)
  3. Build a platform (scale what works)

หนังสือที่ควรอ่าน: The Phoenix Project และ The DevOps Handbook ของ Gene Kim และคณะ, Accelerate ของ Nicole Forsgren, Jez Humble และ Gene Kim, Site Reliability Engineering ของ Google และ Team Topologies ของ Matthew Skelton & Manuel Pais อ่านครบห้าเล่มนี้ ก็ครอบคลุมแก่นของ DevOps ทั้งหมดแล้ว

มีคำถามหรืออยากคุยต่อ ทักมาได้ที่ LinkedIn, X หรือทาง email

Discussion

Have thoughts on this post? Share them below — questions, corrections, or your own experience are all welcome.