LimitRange & Resource Quoataရဲ့ သဘောတရား
August 27, 2026
LimitRange က Pod Level မှာ အလုပ်လုပ်တယ်
Resource Quoata က namespace level မှာ အလုပ်လုပ်တယ်
ဥပမာ အားဖြင့်TechCorp company မှာ 4 teams ရှိတယ်ဆိုပါစို့
Company: TechCorp
Cluster: 100 CPU, 200Gi RAM
Teams:
├── Backend Team (10 developers)
├── Frontend Team (8 developers)
├── Data Team (5 developers)
└── ML Team (3 developers)
ဒီ company မှာသာ resource တွေကို limit လုပ်မထားဘူးဆိုရင်
❌ Resource Hogging ဖြစ်နိုင်တယ်
ML Team က GPU pod 50 ခု deploy လုပ်လိုက်တယ်
→ Cluster resource တစ်ခုလုံး သုံးစွဲသွားတယ်
→ Backend/Frontend teams က pod run လို မရတော့ဘူး 😱
Tiny Pods Everywhere လဲ ဖြစ်နိုင်တယ်
Developer က pod create လုပ်တယ်
→ Resources မသတ်မှတ်ဘူး
→ BestEffort QoS
→ Production မှာ pod 1000+ ခု ရှိသွားတယ် (သေးငယ်တဲ့ pods)
→ Scheduler overhead တက်သွားတယ်
Giant Pods တစ်ခု တည်းက နေရာ အကုန်ယူသွားတာမျိုး ဖြစ်နိုင်တယ်
Developer က pod create လုပ်တယ်
→ limits: cpu=100, memory=500Gi (အလွန်ကြီးတယ်)
→ Node တစ်ခုလုံး block ဖြစ်သွားတယ်
→ တခြား pods schedule လို မရတော့ဘူး
ဒါကို ၂နည်း နဲ့ ဖြေရှင်းလို့ရတယ် - 2-Layer Defense
Layer 1: LimitRange (Pod/Container Level)
"Pod/Container တစ်ခုချင်းစီ အတွက် rules" Controls:
- ✅ Minimum resources (သေးငယ်လွန်းတဲ့ pods ကို ဟန့်တာ)
• ✅ Maximum resources (ကြီးမားလွန်းတဲ့ pods ကို ဟန့်တာ)
• ✅ Default values (resources မရှိရင် auto-inject) Layer 2: ResourceQuota (Namespace Level)
"Namespace တစ်ခုလုံး အတွက် total limits" ✅ Total CPU/Memory per namespace
• ✅ Total pod count
• ✅ Prevents one team from hogging cluster ဟုတ်ပြီ ဒါကို တကယ့် Real World Analogy နဲ့ ဘယ်လိုကြည့်လို့ရလဲ ဆိုတော့
ဥပမာ - Hotel တစ်ခု ဆိုပါစို့ LimitRange က ဘယ်လို အလုပ်လုပ်လဲ ဆိုတော့ Room Rules အနေနဲ့ မြင်ကြည့်လို့ရတယ် အခန်းတစ်ခုမှာ
├── Minimum guests: 1 person (ဒီထက် မသေးနဲ့ )
├── Maximum guests: 4 people (ဒီထက် မကြီးနဲ့)
├── Default bed: Queen size (Define လုပ်မထားရင် default)
└── Check applies to EACH room ResourceQuota ကကျတော့ Hotel Floor Capacity ဖြစ်သွားပြီ(namespace level ပေါ့) Floor 5 (Backend Team floor):
├── Total rooms: 20 rooms max
├── Total guests: 80 people max
├── Total beds: 60 beds max
└── Check applies to ENTIRE floor ပိုပြီးရှင်းလင်းအောင် ဒီလိုကြည့်လို့ရတယ်
apiVersion: v1
kind: LimitRange
metadata:
name: dev-limits
namespace: dev
spec:
limits:
- max: # ← pod တစ်ခုရဲ့ request က ဒီထက် ကြီးလို့မရဘူး
cpu: "2"
memory: "4Gi"
min: # ← pod တစ်ခုရဲ့ request က ဒီထက် နည်း လို့မရဘူး
cpu: "100m"
memory: "128Mi"
default: # ← ဒါက limits အတွက် default
cpu: "500m"
memory: "512Mi"
defaultRequest: # ← ဒါက requests အတွက် default
cpu: "250m"
memory: "256Mi"
type: Container
LimitRange ကို ဘာတွေ အတွက် limit လုပ်လို့ရလဲ
- Container (အသုံးအများဆုံး)
- usage : Container တစ်ခုချင်းစီ ကို control လုပ်တာ
- Pod (pod level limits)
- Pod level total limits (container အားလုံး ပေါင်း)
- PersistentVolumeClaim (storage limits)
- Storage size limits

- Storage size limits
