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
Spatial Rendering for Apple Vision Pro
warrenm
0
110
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
770
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
100
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
770
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
190
Go の GC の不得意な部分を克服したい
taiyow
3
790
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
240
テストコード書いてみませんか?
onopon
2
110
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
250
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
49
11k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Bash Introduction
62gerente
608
210k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Cult of Friendly URLs
andyhume
78
6.1k
Designing Experiences People Love
moore
138
23k
Designing for humans not robots
tammielis
250
25k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building Your Own Lightsaber
phodgson
103
6.1k
Thoughts on Productivity
jonyablonski
67
4.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
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ίϯϙʔωϯτ