Pod တစ်ခုမှာ multiple containers တွေ run နိုင်တဲ့ အကြောင်းသိပြီးတဲ့နောက်မှာ ဒီအပတ်တော့ pod ထဲက main app container အပြင် ဒီ app container လေးကို support လုပ်မယ့် တခြားသော additional containers တွေဖြစ်ကြတဲ့ init container နဲ့ sidecar container တွေအကြောင်းကို တိုတိုနဲ့လိုရင်း ရေးပါမယ်။
Init Container
Init Container ဆိုတာ pod ထဲမှာ main app container မစခင် အရင်ဆုံး run ရတဲ့ container ဖြစ်ပါတယ်။ App Container မစခင် တစ်ခါတည်း run ပြီး Init Container ပြီးမှသာ App Container စပါတယ်။ Init Container မပြီးသေးရင် Pod က Init state မှာပဲ ရပ်နေမှာဖြစ်ပါတယ်။
- App မစခင် မှာ လိုအပ်တဲ့ DB service up ဖြစ်လား မဖြစ်လား စစ်တာတို့၊ config file ကို volume ထဲ copy လုပ်တာတို့ စတဲ့ One-time setup tasks တွေမှာအသုံးဝင်ပါတယ်။
- Init containers ကို အသုံးပြုခြင်းအားဖြင့် Task များကို အစဉ်လိုက် မှန်ကန်စွာ run လုပ်နိုင်တဲ့အတွက် reliability ပိုကောင်းလာပါတယ်။
- Initialization process ကို streamline လုပ်နိုင်မယ်။ Dependency issues ကို လျှော့ချနိုင်မယ်
Sidecar Container
Sidecar Container ဆိုတာ Pod ထဲမှာ App Container နဲ့အတူ run နေတဲ့ container ဖြစ်ပြီးတော့ App ကို support/helper အနေနဲ့ လုပ်ပေးတဲ့ role ဖြစ်ပါတယ်။
-
Logging service သို့မဟုတ် monitoring service တစ်ခုကို sidecar container အနေနဲ့ ထည့်သုံးနိုင်ပါတယ်။ App logs ကို sidecar ကယူပြီး Elasticsearchလို external system ကိုပို့တဲ့ use case မျိုးတွေမှာသုံးပါတယ်။ အမှန်တကယ်ဆိုရင် logging နဲ့ monitoring logic ကို main container ထဲမှာပဲ ထည့်ရေးနိုင်ပေမယ့် အဲဒီလိုလုပ်မယ်ဆိုရင် application architecture ပိုပြီး ရှုပ်ထွေးလာပါမယ်။
-
Sidecar container ကို အသုံးပြုခြင်းအားဖြင့် architecture ကို ပိုပြီး ရှင်းသွားစေပြီး scalability ကိုလည်း ပိုကောင်းသွားစေပါတယ်။
-
Main container ကို မထိခိုက်ဘဲ sidecar container တွေကို အတိုးအလျှော့ ပြုလုပ်နိုင်ပါတယ်။
-
Main Container က core functionality ပဲ လုပ်ဆောင်ရတဲ့အတွက် code separation ကောင်းပြီး maintain လုပ်ရတာ လွယ်ကူလာပါတယ်။
အတိုးချုံး ပြန်ပြောရရင် App မစခင် လုပ်ရမယ့် setup ကိုလုပ်ပေးတာက Init Container၊ App run နေချိန်မှာ အမြဲလိုအပ်တဲ့ support ကို ပေးတာက Sidecar Container ဖြစ်ပါတယ်။
နောက်အပတ်ကစပြီး ကျွန်တော် တခြားလုပ်စရာ သွားစရာလေးတွေရှိတဲ့အတွက် စာရေးတာရပ်ထားပါမယ်။
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 တိုင်း စဉ်းစားဖူးကြမှာပါ။ ဈေးကွက်အခြေအနေ...

