Nguồn: Kubernetes Blog
Tóm tắt
Kubernetes v1.36 giới thiệu các cập nhật quan trọng cho tính năng Memory QoS (alpha) — tính năng sử dụng cgroup v2 memory controller để cung cấp hướng dẫn tốt hơn cho kernel trong việc quản lý bộ nhớ container. Thay đổi lớn nhất là “tiered memory reservation” qua memoryReservationPolicy: TieredReservation: Guaranteed Pods nhận hard protection qua memory.min (kernel không bao giờ reclaim), trong khi Burstable Pods nhận soft protection qua memory.low (kernel ưu tiên giữ nhưng có thể reclaim trong extreme pressure). Trước đây trong v1.27, cả Guaranteed lẫn Burstable đều dùng memory.min, khiến hard reservation cao hơn cần thiết.
Cơ chế tiered protection ánh xạ trực tiếp đến 4 cgroup v2 interfaces: memory.min (hard protection — Guaranteed), memory.low (soft protection — Burstable), memory.high (soft throttle — pre-OOM warning), và memory.max (hard limit, giống cgroup v1 memory.limit_in_bytes). Việc Burstable Pods dùng memory.low thay vì memory.min có nghĩa là dưới điều kiện memory pressure cực độ, kernel có thể reclaim bộ nhớ từ Burstable containers để tránh system-wide OOM, trong khi Guaranteed containers được bảo vệ hoàn toàn.
Ngoài tiered reservation, v1.36 bổ sung observability metrics cho Memory QoS (giúp monitor hiệu quả trong production), opt-in memory reservation để user kiểm soát khi nào protection được áp dụng, và kernel version warning cho memory.high (tính năng này yêu cầu kernel đủ mới để hoạt động đúng). Đây là alpha feature cần enable qua feature gate, nhưng đánh dấu bước tiến quan trọng trong resource isolation của Kubernetes — đặc biệt quan trọng cho các workload mixed QoS class trên cùng node.