ကျွန်တော်ဒီနေ့ kubernetes ကို နေ့စဉ်အသုံးပြုနေတဲ့ admin နဲ့ developer တွေအတွက် မရှိမဖြစ် tool တစ်ခုဖြစ်တဲ့ kubectl plugin manager, krew အကြောင်းကို share ပေးချင်ပါတယ်။
krew ဆိုတာ ဘာလဲ
krew ဆိုတာ kubectl command-line tool အတွက် အသုံးဝင်တဲ့ plugins တွေကို manage လုပ်ပေးတဲ့ package manager တစ်ခုပါ။ linux မှာဆို apt ဒါမှမဟုတ် yum၊ macOS မှာဆို Homebrew လိုပါပဲ။ kubectl ရဲ့ built-in မှာ မပါဝင်သေးတဲ့ commands တွေကို ထပ်ထည့်ပြီး ကျွန်တော်တို့ရဲ့ daily workflow ကို ပိုမိုမြန်ဆန်လွယ်ကူစေဖို့ ဒီ tool ကို ဖန်တီးထားတာပါ။
krew ကို ဘာကြောင့် သုံးသင့်တာလဲ
kubernetes ကို အသုံးပြုတဲ့အခါ အချို့ operations တွေက ခက်ခဲနိုင်ပါတယ်။ ဥပမာ - namespace အားလုံးမှာ dns နာမည်ပါတဲ့ pod, service, deployment တွေကို list လုပ်ဖို့အတွက် kubectl get all -A | grep dns ဆိုပြီး command ကို ရိုက်ရပါတယ်။ ဒီလို pipeline နဲ့ တွဲမသုံးချင်ရင် krew repository က grep plugin ကို install လုပ်ပြီး kubectl grep all dns -A ဆိုပြီး ပိုပြီးလွယ်ကူစွာ သုံးနိုင်ပါတယ်။
ပုံမှန် kubectl နဲ့ဆို resource တွေရဲ့ dependency ကို လွယ်လွယ်ကူကူမြင်ရဖို့ ခက်ခဲပါတယ်။ ဒီလိုပြဿနာတွေကို krew က ဖြေရှင်းပေးနိုင်ပါတယ်။ လိုအပ်တဲ့ plugins တွေကို တစ်ချက်တည်း install လုပ်လိုက်ရုံနဲ့ အပေါ်ကပြဿနာတွေကို command တိုတိုလေးတွေနဲ့ ဖြေရှင်းနိုင်မှာပါ။
krew ကို install လုပ်ခြင်း
ပထမဆုံးအနေနဲ့ krew ကို ကိုယ့်စက်ထဲမှာ install လုပ်ရပါမယ်။ official website မှာ ကိုယ်သုံးတဲ့ os အလိုက် install လုပ်နည်းကို အသေးစိတ်ရှင်းပြထားပါတယ်။
plugins တွေကို ရှာဖွေခြင်း
krew ရဲ့ repository မှာ ဘယ် plugins တွေရှိလဲဆိုတာ ကြည့်နိုင်ဖို့ kubectl krew search ကို သုံးနိုင်ပါတယ်။
plugins တွေကို install လုပ်ခြင်း
အသုံးလိုတဲ့ plugin ကိုတွေ့ရင် kubectl krew install [plugin-name] ဆိုပြီး install လုပ်နိုင်ပါတယ်။ ဥပမာ - context တွေပြောင်းဖို့အတွက် plugin ကို install လုပ်မယ်ဆိုရင် kubectl krew install ctx ဆိုပြီး သုံးနိုင်ပါတယ်။
plugins တွေကို အသုံးပြုခြင်း
install လုပ်ပြီးသွားရင်တော့ kubectl [plugin-name] ဆိုပြီး တိုက်ရိုက်အသုံးပြုနိုင်ပါပြီ။
အခုပြထားတဲ့ plugins တွေကတော့ ctx, ns, get-all, tree, shell, df-pvc, neat, access-matrix, view-secret, who-can, grep, etc လူသုံးမျာတဲ့ plugins တွေဖြစ်ပါတယ်။ krew မှာ ဒီထက်မက အသုံးဝင်တဲ့ plugins တွေ အများကြီးရှိပါသေးတယ်။
Discussion
Join the conversation
How do you feel about this article?
Comments
Sign in to join the conversation
Sign in to be the first to comment!
Share Your Article
Share with your professional network
Recent Articles

Day 2 - GitHub Actions ရဲ့ အဓိက Concepts များနှင့် Runner အကြောင်း
ပြီးခဲ့တဲ့အပတ် Day 1 တုန်းက ကျွန်တော်တို့ CI/CD ရဲ့ Concept တွေကို အကြမ်းဖျင်း ပြောခဲ့ကြပြီးပြီနော်။ ဒီနေရာမှာ လက်တွေ့မစ...
Day 1 - Software Development ကို ပိုပြီးမြန်စေမယ့် CI/CD
Software တစ်ခုရေးပြီးပြီဆိုရင် "ငါ့စက်ထဲမှာတော့ အလုပ်လုပ်တယ်" ဆိုရုံနဲ့ မပြီးသေးပါဘူး။ User တွေသုံးမယ့် Server ပေါ်ရောက်...

Secure AWS ECR Github Action Using OIDC
Modern DevOps နှင့် Cloud Security တို့မှာ အဓိကဖြစ်လာသည့် Authentication System ယနေ့ခေတ် DevOps, Cloud Engineering, CI/C...

Manual vs Automated Infrastructure: Why "useradd" Still Matters in the Terraform Era
DevOps careerကို လျှောက်နေတဲ့သူတိုင်း Terraform၊ Ansible စတဲ့ Infrastructure as Code (IaC) tools တွေရဲ့ အလုပ်လုပ်နိုင်စွ...
From Surviving to Thriving
“AI ကြောင့် developer အလုပ်ပျောက်သွားမလား?” ဆိုတဲ့ မေးခွန်းကို Junior developer တိုင်း စဉ်းစားဖူးကြမှာပါ။ ဈေးကွက်အခြေအနေ...

