Thuta Learning
ရှာဖွေရန်
ExercisesDevOpsintermediate

လက်တွေ့ လေ့ကျင့်ခန်း အစုံ ၁

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • လက်တွေ့ လေ့ကျင့်ခန်း အစုံ ၁ ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် kubectl command/YAML ကို run ကြည့်တတ်မယ်
  • Real project ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်

ဒီ round က learn ခဲ့ပြီးသား Basic/Intermediate concept တွေကို လက်တွေ့ ပြန်စမ်းကြည့်ဖို့ round ပါ — အသစ်ဘာမှ သင်ပေးမှာ မဟုတ်ဘူး, Pod vs Deployment vs Service ကို ခွဲသိခြင်း, YAML ထဲက error ကို ရှာဖွေခြင်း, kubectl command ကို မှန်ကန်စွာ ရေးတတ်ခြင်းကိုပဲ ကိုယ်တိုင် လက်တွေ့ လုပ်ကြည့်ရမှာပါ။ Task တစ်ခုချင်းစီက ၅ မိနစ်ထက် မကြာသင့်ပါဘူး။

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

Task 1: 'Pod', 'Deployment', 'Service' သုံးလုံးရဲ့ တာဝန် ကွာခြားချက်ကို ဝါကျတစ်ကြောင်းစီနဲ့ ရှင်းပြပါ။ Task 2: Deployment YAML တစ်ခုမှာ `selector.matchLabels: app: web` ရေးထားပေမယ့် `template.metadata.labels` မှာ `app: website` လို့ မှားရေးထားရင် ဘာ error ဖြစ်မလဲ ခန့်မှန်းပြီး ရေးပါ။ Task 3: Service type ၃ မျိုး (ClusterIP, NodePort, LoadBalancer) ကို ဘယ်အခါသုံးရမလဲ ဥပမာနဲ့တကွ ရေးပါ။ Task 4: `kubectl get pods` run လိုက်ရင် pod status 'Pending' ဖြစ်နေတယ်ဆိုရင် ဘယ် command ၂ ခုနဲ့ debug စမလဲ ရေးပါ။

အတူတူ ကြည့်မယ်

text
# Task 2 - label mismatch
selector.matchLabels: { app: web }
template.metadata.labels: { app: website }   # MISMATCH!

Result: Deployment creates pods with label "app: website",
but its own selector looks for "app: web" — it will never
see its own pods as "managed", and may create pods endlessly
or error depending on the Kubernetes version.

# Task 4 - debug a Pending pod
kubectl describe pod <pod-name>   # check Events for the reason
kubectl get nodes                  # check if any node has capacity
You should see
Pod/Deployment/Service ကွာခြားချက်၊ label mismatch bug ရှာဖွေခြင်း၊ Pending pod debug command များ ရရှိလာမည်။

၅ မိနစ် စမ်းကြည့်

ကိုယ်ပိုင် Deployment YAML တစ်ခု ရေးပြီး တမင် label mismatch bug ထည့်ကြည့်ပါ — `kubectl apply` ပြီးရင် ဘာဖြစ်လဲ ကိုယ်တိုင် သက်သေပြကြည့်ပါ။

သတိလေးတစ်ချက်

ဒီ round မှာ cluster အသစ် setup လုပ်ဖို့ မလိုပါဘူး — concept/debugging logic ကိုပဲ အဓိကထား practice လုပ်ခြင်းပါ။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Pod/Deployment/Service ကို 'အားလုံးတူတူပဲ' လို့ ရှုပ်ထွေးနေခြင်း
  • YAML error ကို terminal output ကနေ ဖတ်ရှုချသွားပြီး `kubectl describe`/`kubectl get events` ကို မသုံးခြင်း

အခု ကိုယ်တိုင် စမ်းကြည့်

ကိုယ်ပိုင် Deployment YAML တစ်ခု ရေးပြီး တမင် label mismatch bug ထည့်ကြည့်ပါ — `kubectl apply` ပြီးရင် ဘာဖြစ်လဲ ကိုယ်တိုင် သက်သေပြကြည့်ပါ။

You'll know it worked when: Pod/Deployment/Service ကွာခြားချက်၊ label mismatch bug ရှာဖွေခြင်း၊ Pending pod debug command များ ရရှိလာမည်။

လက်တွေ့ လေ့ကျင့်ခန်း အစုံ ၁ | Thuta Learning