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
59
kubesprayで作って壊そうk8sクラスタ
2022/10/12 K8s@home #1のLT資料です。
Kentaro Sasaki
October 12, 2022
Tweet
Share
Other Decks in Programming
See All in Programming
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
230
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
890
Outline View in SwiftUI
1024jp
1
330
Better Code Design in PHP
afilina
PRO
0
130
Arm移行タイムアタック
qnighy
0
330
最新TCAキャッチアップ
0si43
0
190
Ethereum_.pdf
nekomatu
0
460
Jakarta EE meets AI
ivargrimstad
0
210
Realtime API 入門
riofujimon
0
150
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
420
GitHub's CSS Performance
jonrohan
1030
460k
Unsuck your backbone
ammeep
668
57k
We Have a Design System, Now What?
morganepeng
50
7.2k
Designing the Hi-DPI Web
ddemaree
280
34k
BBQ
matthewcrist
85
9.3k
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ίϯϙʔωϯτ