Lesson · Hinglish · ⏱ 8 min padhne mein
☸️ Kubernetes: containers ko bade scale pe chalaana
EnglishHinglish
🏠 Asli zindagi ki misaal
Badi shaadi ka caterer ek chulha nahi chalata. Ek manager kai cooking stations pe nazar rakhta hai, mehmaan badhne pe stations badhaata hai, beemar cook ko replace karta hai, aur khaana lagaataar chalta rehta hai. Kubernetes containers ke liye wahi manager hai: sahi number mein containers chalaata hai, fail hone pe restart karta hai, aur traffic ke saath scale karta hai.
💡 Aasaan shabdon mein
Aap Kubernetes ko desired state batate ho ('meri model API ki 3 copies chalao, har ek ko 2 GB memory aur 1 GPU'), aur woh asliyat ko usse match karta hai. Key objects: Pod ek ya zyaada chalte containers hai, Deployment N pods ko healthy rakhta hai aur rolling updates sambhaalta hai, Service pods ko stable address deta hai, aur HorizontalPodAutoscaler load badhne pe pods badhaata hai. AI ke liye GPU nodes schedule karte ho aur resource limits set karte ho, taaki ek model doosre ke resources na kha jaaye. Helm is saare YAML ko reusable charts mein pack karta hai. Local pe kind ya minikube se shuru karo.
🎬 Dekho kaise kaam karta hai
Traffic badhne pe autoscaler pods jodta hai. Pod crash ho to Kubernetes use apne aap replace kar deta hai, aur desired state hamesha bani rehti hai.
🪜 Step by step
- Pod ek ya zyaada containers chalata hai. Deployment tay ginti ke ek jaise Pods chalu rakhta hai aur kharab hue badal deta hai.
- Service Pods ko ek stable address deti hai aur traffic unme baantti hai.
- Resource requests aur limits (CPU, memory, GPU) set karo taaki scheduler Pods sahi jagah rakhe.
- Readiness aur liveness probes jodo taaki traffic sirf healthy Pods tak pahunche.
- Load badhne pe Pods jodne ke liye Horizontal Pod Autoscaler use karo, aur naye versions dheere dheere roll out karo.
🔑 Zaroori shabd
- Pod
- Kubernetes ki sabse chhoti unit: ek ya zyaada containers.
- Deployment
- Pods ki ek fixed ginti chalaata hai aur unhe safely update karta hai.
- Autoscaling
- Load ke hisaab se apne aap pods badhaana ya ghataana.
👀 Example dekho
apiVersion: apps/v1
kind: Deployment
metadata: { name: price-api }
spec:
replicas: 3
selector: { matchLabels: { app: price-api } }
template:
metadata: { labels: { app: price-api } }
spec:
containers:
- name: api
image: registry.example.com/price-api:1.4
resources: { limits: { memory: "2Gi", cpu: "1" } }'Version 1.4 ki 3 copies chalao, har ek 2 GB tak limited.' Baaki Kubernetes karta hai.
⚠️ Aam galtiyaan jinse bachna hai
- Resource limits nahi: ek Pod saari memory kha jaata hai aur node gira deta hai.
- Readiness probe nahi: traffic un Pods pe jaata hai jo abhi bada model load kar rahe hain aur requests fail hoti hain.
✅ Jaldi se check karo
Sale mein traffic teen guna ho gaya. Apne aap aur pods kaun jodta hai?
- HorizontalPodAutoscaler
- Dockerfile
- Service
Jawaab dekho
A. HorizontalPodAutoscaler: Autoscaler load (jaise CPU ya requests) dekhta hai aur replicas ki ginti badalta hai.
🙋 Seekhne wale yeh poochhte hain
Kya pehle model ke liye Kubernetes chahiye?
Aam taur pe nahi. Managed service (Cloud Run, App Runner, PaaS) simple hai. Kubernetes tab faayda deta hai jab bahut saari services scale pe chalti hain.
Helm kya hai?
Kubernetes ka package manager: yeh app ke YAML ko template karta hai taaki ek command se install aur upgrade ho sake.
📌 Yaad rakho
Desired state batao, Kubernetes use sach rakhta hai: restarts, scaling, updates.
📖 Is lesson ke shabd (AI dictionary)
Poora course, aapke roadmap ke hisaab se
Progress tracking, quick checks aur step-by-step order ke saath. Yeh lesson in courses ka hissa hai:
Course mein seekho