Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
kubesprayで作って壊そうk8sクラスタ
Search
Kentaro Sasaki
October 12, 2022
Programming
0
63
kubesprayで作って壊そうk8sクラスタ
2022/10/12 K8s@home #1のLT資料です。
Kentaro Sasaki
October 12, 2022
Tweet
Share
Other Decks in Programming
See All in Programming
DMMオンラインサロンアプリのSwift化
hayatan
0
180
[JAWS-UG横浜 #80] うわっ…今年のServerless アップデート、少なすぎ…?
maroon1st
0
100
ゼロからの、レトロゲームエンジンの作り方
tokujiros
3
1k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
280
Azure AI Foundryのご紹介
qt_luigi
1
200
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
170
PHPカンファレンス 2024|共創を加速するための若手の技術挑戦
weddingpark
0
140
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
950
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
170
良いユニットテストを書こう
mototakatsu
11
3.6k
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Designing for Performance
lara
604
68k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Faster Mobile Websites
deanohume
305
30k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Embracing the Ebb and Flow
colly
84
4.5k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
It's Worth the Effort
3n
183
28k
Transcript
kubesprayͰ ࡞ͬͯյͦ͏k8sΫϥελ 2022/10/12 K8s@home #1 ࠤʑ ݈ଠ࿕ɹɹ@ponzmild 1
ࣗݾհ ࠤʑ ݈ଠ࿕ (Kentaro Sasaki) - ɹ@ponzmild • ॴଐ: ຊΞΠɾϏʔɾΤϜגࣜձࣾ
• ීஈͷ͓ࣄ: OpenShiftͰΞϓϦ։ൃ & ϞμφΠθʔγϣϯࢧԉ • ॻ੶ࣥච: ʰApache KafkaΛ͡ΊΔʱ(ΠϯϓϨεR&Dࣾ) • ࣗk8sྺ: 1 2
ͦͷKubernetesΫϥελɺ ʮࠓʯ͏Ұ࡞Γͤ·͔͢ʁ 3
͘ӡ༻͍ͯ͠Δͱ࡞Γ͕࣌͘͢Δ ཧϚγϯ ϋΠύʔόΠβʔ ཧϚγϯ ཧϚγϯ 7. 7. 7. 7. 7.
,VCFSOFUFT 1PE 1PE 1PE Ϧιʔε૿ڧɺNWઃఆͷมߋɺ ిݯஅͰμϯ ఆظతͳόʔδϣϯΞοϓ Pod͔Βར༻͢Δύοέʔδಋೖɺ ಉډ͢ΔVMͷͨΊʹϦιʔεۭ͚Θͨ͠ K8sΫϥελͷόʔδϣϯΞοϓɺ ίϯϙʔωϯτͷ߹࣮ͤมߋ 4
·ͱΊͯ࡞Γ͢ͷେมʂʂ ઃఆΛΕͨ ͳͥ͜ΜͳઃఆΛ ೖΕͨͷ͔ෆ໌ ख࡞ۀͩͱԿ Γ͠ ࡞Γ͍ͨ͠ͷ Ұ෦͚ͩͳͷʹ 5
kubesprayͰ ΧδϡΞϧʹk8s࡞ͬͯյͦ͏ʂ 6
kubesprayͱ • K8sΫϥελΛߏཧɺ͓Αͼ࡞~আΛ࣮ߦ͢ΔπʔϧΩοτ • https://github.com/kubernetes-sigs/kubespray • ϕΞϝλϧɺvSphereɺAWSɺAzureͱ͍ͬͨෳڥʹରԠ • HAߏͷΫϥελߏՄೳ •
࣮ଶAnsible Playbookͷू߹ = k8sΫϥελΛIaCԽ 7
https://kubernetes.io/ja/docs/setup/production-environment/tools/kubespray/ 8
kubesprayͷΈ ཧϚγϯ ϋΠύʔόΠβʔ ཧϚγϯ ཧϚγϯ 7. 7. 7. 7. 7.
,VCFSOFUFT kubespray Ansible Ansible Playbook (YAML) K8sʹඞཁͳOSઃఆ Addons 1PE 1PE 1PE 9
kubesprayΛ͡ΊΔ 10
kubesprayͷલఏ • kubespray࣮ߦϚγϯʹPythonΛΠϯετʔϧࡁͰ͋Δ͜ͱ • ansible-coreͷόʔδϣϯʹ߹ΘͤͯɺPython 3.8Ҏ্Λਪ • K8s NodeLinuxͰ͋Δ͜ͱ •
Debian, Ubuntu, RHEL/Fedora, Oracle Linux • Windows Node͚ͷPlaybook͋Δ͕ެࣜʹαϙʔτ͞Ε͍ͯͳ͍ 11
Step1: kubesprayͷηοτΞοϓ (JUϦϙδτϦλά໊ ͰΫϩʔϯΛਪ 12
Step2: ΠϯϕϯτϦͱઃఆϑΝΠϧΛੜ "OTJCMFΛΒͳ͘ ͯΠϯϕϯτϦͱઃఆ :".-ΛੜՄೳ 13
Step3: ઃఆϑΝΠϧΛฤू Inventory/mycluster/group_vars/ k8s_cluster/k8s-cluster.yml Inventory/mycluster/group_vars/ k8s_cluster/addons.yml HSPVQ@WBSTҎԼͷ ඞཁͳύϥϝʔλ͚ͩฤू ͢Ε0, 14
Step4a: kubesprayͰΫϥελΛཱͯΔ • ࣄલఆٛ͞ΕͨPlaybook “cluster.yml” Ͱk8sΫϥελΛཱͯΔ NBTUFS XPSLFS Ͱd 15
Step4b: ඞཁͳ࣌ʹ͙͢յͤΔ • ࣄલఆٛ͞ΕͨPlaybook “reset.yml” ͰΧδϡΞϧʹյͤΔ 16
kubesprayͰخ͍͠ϙΠϯτ 👍 • K8sΫϥελͷίϯϙʔωϯτબఆɾઃఆPlaybookΛݟΕશͯΘ͔Δ • Gitཧ͢Εɺͳͥͦͷઃఆʹ͔ͨ͠ (=Why) ݟ͕ίϛοτϩάʹΔ • Կճ࣮ߦͯ݁͠Ռ͕ಉ͡ʹͳΔ
= “ႈ” • ҆৺ͯ͠k8sΫϥελΛ࡞Γ͠Մೳ (※ͨͩ͠VMΑΓ্ͷϨΠϠʔʹݶΔ) • PlaybookͷҰ෦͚ͩྲྀ͢͜ͱՄೳ • طଘͷPlaybook͔ΒKubesprayͷPlaybookΛݺͼग़͢͜ͱՄೳͰ͢ 17
ͦͷKubernetesΫϥελɺ ʮࠓʯ͏Ұ࡞Γͤ·͔͢ʁ → kubesprayͰ࡞ͬͯյͦ͏ʂ 18
Happy k8s@home!😉 19
(ࢀߟ) kubesprayͷAddons • Load Balancer … MetalLB • Ingress …
NGINX Ingress Controller • Storage … CephFS, RBD, Rancher Local Path Provisioner • Observability … Metrics Server • GitOps … ArgoCD • Security … Cert Manager 20 ※ AddonsͷҰཡv2.20.0࣌ LTΫϥελͱಉ͡ϥ ΠϑαΠΫϧͰಋೖ͢Δ 1BB4ίϯϙʔωϯτ