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

Helm Basics

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

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

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

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

Application တစ်ခု deploy ဖို့ Deployment, Service, ConfigMap, Secret, Ingress — YAML file အများကြီး လိုနိုင်ပါတယ် — environment (dev/staging/prod) တစ်ခုစီအတွက် value cbcopy paste ထားရင် error-prone ဖြစ်ပါတယ်။ Helm Chart က ဒီ YAML files တွေကို template အဖြစ် ပြောင်းပြီး, `values.yaml` ဆိုတဲ့ file ထဲမှာ environment-specific value (image tag, replica count, resource limit) ကိုပဲ ပြောင်းလို့ရပါတယ် — `helm install` command တစ်ကြောင်းတည်းနဲ့ app တစ်ခုလုံး deploy လို့ရပါတယ်။ Public Helm Chart repository (Artifact Hub) ကနေ database, monitoring tool စတာတွေကို pre-built chart နဲ့ တစ်ကြိမ်တည်း install လို့လည်း ရပါတယ်.

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

PostgreSQL database ကို manual YAML ရေးမယ့်အစား `helm install my-db bitnami/postgresql` လို့ run ရင် production-ready configuration (backup, replication ပါ) ပါတဲ့ database တစ်ခုလုံး ချက်ချင်း run လာပါတယ်။ ကိုယ်ပိုင် app ကိုတော့ `helm create my-app` နဲ့ Chart template scaffold ဖန်တီးပြီး ကိုယ့် Deployment/Service YAML ကို template ထဲ ထည့်ရေးလို့ရပါတယ်.

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

bash
# Install Helm (see helm.sh for your OS), then:

# Add a chart repository
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

# Install a pre-built chart (e.g. PostgreSQL)
helm install my-db bitnami/postgresql

# See what's installed
helm list

# Scaffold your own chart
helm create my-app
You should see
$ helm list
NAME     NAMESPACE   REVISION   STATUS     CHART
my-db    default     1          deployed   postgresql-13.2.0

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

Helm ကို install လုပ်ပြီး `helm create my-app` run ကြည့်ပါ — generate ဖြစ်လာတဲ့ folder structure (templates/, values.yaml) ကို လေ့လာကြည့်ပါ။

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

Public chart (Artifact Hub) ကို install ခင်, `--dry-run` ဒါမှမဟုတ် `helm template` နဲ့ generate ဖြစ်မယ့် resource ကို အရင်ကြည့်ပါ — trust မထားရသေးသော chart ကို production cluster ထဲ blind install မလုပ်ပါနှင့်။

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

  • `helm install` ပြီးရင် `kubectl get pods` နဲ့ ကိုယ့်ဘာသာ verify မလုပ်ဘဲ 'ပြီးပြီ' လို့ ယူဆခြင်း
  • values.yaml ထဲက default value (password, resource limit) ကို production အတွက် ပြင်ဆင်စရာမလို ဆိုပြီး default အတိုင်း run ခြင်း

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

Helm ကို install လုပ်ပြီး `helm create my-app` run ကြည့်ပါ — generate ဖြစ်လာတဲ့ folder structure (templates/, values.yaml) ကို လေ့လာကြည့်ပါ။

You'll know it worked when: $ helm list NAME NAMESPACE REVISION STATUS CHART my-db default 1 deployed postgresql-13.2.0

Helm Basics | Thuta Learning