Skip to content

Chương 16: GKE Autopilot Mode — Managed Infrastructure

Tại sao chương này quan trọng

GKE Autopilot thay đổi căn bản cách bạn tư duy về infrastructure trên Kubernetes. Thay vì quản lý node pools, machine types, disk sizes, và cluster autoscaler — bạn chỉ khai báo workload, Autopilot tự lo phần còn lại.

Điều này nghe có vẻ đơn giản hóa mọi thứ. Nhưng trên thực tế, Autopilot áp đặt một tập constraint nghiêm ngặt lên workload của bạn: tỷ lệ CPU:memory phải hợp lệ, đặc quyền container bị giới hạn, một số tính năng Kubernetes tiêu chuẩn không được hỗ trợ. Nếu không hiểu các constraint này, bạn sẽ gặp Pods bị từ chối, requests bị điều chỉnh ngầm, và hành vi hệ thống khó đoán.

Chương này không phải là giới thiệu về Autopilot — nó là bản đồ đầy đủ cho senior engineers cần hiểu tại sao Autopilot hoạt động như vậy, khi nào nó phù hợp với production, và như thế nào để vận hành hiệu quả.

Điều kiện tiên quyết

  • Chương 5: GKE Control Plane Internals (hiểu managed vs unmanaged control plane)
  • Chương 8: GKE Scheduler (resource model, requests/limits, node affinity)
  • Chương 9: GKE Autoscaling (Cluster Autoscaler, Node Auto-Provisioning)

Cấu trúc chương

FileChủ đề
01. Autopilot vs StandardSo sánh sâu: managed node model, billing, feature gaps
02. Resource EnforcementMin/max requests, CPU:memory ratio rules, tự động điều chỉnh Pod spec
03. Compute ClassesBalanced, Scale-Out, Performance, Accelerator, ML; custom ComputeClasses
04. Security HardeningPod security mặc định, privileged workloads, org policy constraints
05. Spot Pods & Extended DurationPreemption behavior, extended duration Pods, trade-offs
06. Cluster UpgradesZero-control-plane-downtime, surge upgrades, maintenance windows
07. NetworkingIP allocation, VPC-native, hostPort, limitations
08. ObservabilityMetrics, logs, monitoring Autopilot workloads
09. Migration từ StandardPreparation, incompatibility checklist, migration strategy

Mental model cho Autopilot

Autopilot nên được hiểu như một serverless Kubernetes runtime, không phải một cluster bình thường ít việc hơn. Sự khác biệt quan trọng:

Standard GKE:
  Bạn → Node Pool (machine type, size, disk) → Kubernetes scheduler → Pod

Autopilot:
  Bạn → Pod spec (resources, compute class) → Autopilot engine → Node (transparent)

Node trong Autopilot là implementation detail, không phải đối tượng bạn quản lý. Google cam kết SLA ở cấp Pod, không phải Node.

Khi nào nên dùng Autopilot

Phù hợp:

  • Đội nhỏ không có dedicated platform engineer
  • Workloads phải tuân thủ baseline security nghiêm ngặt
  • Batch jobs, event-driven processing, stateless services
  • Muốn giảm operational toil tối đa

Không phù hợp:

  • Workloads cần privileged containers (Istio injection tùy cấu hình, CNI plugins, device drivers)
  • Custom node configuration (kernel parameters, huge pages)
  • DaemonSets tùy chỉnh sâu
  • Workloads cần fine-grained node pool control

References