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
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
最新TCAキャッチアップ
0si43
0
190
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
880
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Jakarta EE meets AI
ivargrimstad
0
110
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
cmp.Or に感動した
otakakot
3
200
受け取る人から提供する人になるということ
little_rubyist
0
230
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Designing for Performance
lara
604
68k
Statistics for Hackers
jakevdp
796
220k
A better future with KSS
kneath
238
17k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
We Have a Design System, Now What?
morganepeng
50
7.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
BBQ
matthewcrist
85
9.3k
Gamification - CAS2011
davidbonilla
80
5k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
890
How to train your dragon (web standard)
notwaldorf
88
5.7k
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ίϯϙʔωϯτ