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
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
선언형 UI에서의 상태관리
l2hyunwoo
0
160
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
380
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
MCP with Cloudflare Workers
yusukebe
2
220
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
命名をリントする
chiroruxx
1
410
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Featured
See All Featured
Fireside Chat
paigeccino
34
3.1k
It's Worth the Effort
3n
183
28k
Statistics for Hackers
jakevdp
796
220k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Agile that works and the tools we love
rasmusluckow
328
21k
Practical Orchestrator
shlominoach
186
10k
Being A Developer After 40
akosma
87
590k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Code Review Best Practice
trishagee
65
17k
Speed Design
sergeychernyshev
25
670
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
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ίϯϙʔωϯτ