📚 Resources Requests & Limits သဘောတရား
August 5, 2026
🎯 ဘာလို အရေးကြီးလဲ? Production မှာ resources မသတ်မှတ်ရင်:
- 😱 Pod တစ်ခု က node တစ်ခု လုံးရဲ့ CPU/Memory သုံးပစ်နိုင်တယ်
• 💥 အခြား pod တွေ ပျက်စီးသွားနိုင်တယ်
• 🚫 Scheduler က pod ကို ဘယ်မှာ ချထားရမလဲ မသိဘူး 🔑 Requests vs Limits
resources:
requests: # "ငါ့ကို အနည်းဆုံး ဒီလောက် ပေးပါ"
cpu: "500m" # 0.5 CPU core
memory: "512Mi" # 512 MiB RAM
limits: # "ငါ အများဆုံး ဒီလောက်ပဲ သုံးမယ်"
cpu: "1000m" # 1 CPU core
memory: "1Gi" # 1 GiB RAM
| Concept | Purpose | What happens? |
| Requests | Scheduling အတွက် | Scheduler က requests အပေါ် မူတည်ပြီး node ရွေးတယ် |
| Limits | Runtime protection | Pod က limits ထက် ပိုသုံးရင် throttle/kill လုပ်တယ် |
• Pod က ဆက် run နေတယ်၊ CPU ပဲ လျှော့ပေးတယ်
Memory (Non-Compressible Resource): - Limit ကျော်ရင် → OOMKilled (Out of Memory - သေသွားတယ်!)
• Pod က restart ဖြစ်တယ် 📖 Part 2: QoS Classes (Quality of Service) Kubernetes က pod ရဲ့ resources config ကို ကြည့်ပြီး QoS class သတ်မှတ်တယ်။ 🏆 QoS Classes (3 မျိုး)
| Class | Condition | Eviction Priority |
| Guaranteed | requests = limits (all containers) | နောက်ဆုံး evict (အရေးကြီးဆုံး) |
| Burstable | requests \< limits (or only requests) | အလယ် evict |
| BestEffort | No requests/limits | ပထမဆုံး evict (အရေးမကြီး) |
Pod QoS ဆိုတာ 3 ခု rule ကို စစ်တယ်: 1. Guaranteed rule satisfy လား? → No → ဆက်စစ် 2. BestEffort rule satisfy လား? → No → ဆက်စစ် 3. Default → Burstable ✅ ဥပမာ
Pod: my-pod (5 containers)
Container 1: Guaranteed (requests = limits) Container 2: Guaranteed (requests = limits) Container 3: Guaranteed (requests = limits) Container 4: Guaranteed (requests = limits) Container 5: BestEffort (no resources)
```
</column>
<column ratio="50">
Step 1: Check Guaranteed?<br>→ ALL containers have requests=limits? ❌ (Container 5 မရှိဘူး)<br>→ NOT Guaranteed
Step 2: Check BestEffort?<br>→ ALL containers have NO resources? ❌ (Container 1-4 ရှိတယ်)<br>→ NOT BestEffort
Step 3: Default to Burstable<br>→ Pod QoS = Burstable ✅
</column>
| Scenario | Pod QoS |
| All containers: requests=limits | Guaranteed |
| All containers: no resources | BestEffort |
| Mix (some resources, not all requests=limits) | Burstable |
| 4 Guaranteed + 1 BestEffort | Burstable ❌ NOT BestEffort |
| 4 Guaranteed + 1 Burstable | Burstable |
| Question | Answer |
| Evict pod သိုမဟုတ် container? | Pod တစ်ခုလုံး ✅ |
| Container တစ်ခုပဲ evict လိုရလား? | မရဘူး ❌ |
| Pod evict ရင် containers အားလုံး die လား? | ဟုတ်တယ် ✅ |