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
Is Kubernetes On-premises Hardway?
Search
Kazuhiko Yamashita
November 05, 2021
Technology
2
570
Is Kubernetes On-premises Hardway?
CloudNativeDays Tokyo 2021にて登壇した資料です。
Kazuhiko Yamashita
November 05, 2021
Tweet
Share
More Decks by Kazuhiko Yamashita
See All by Kazuhiko Yamashita
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Tuning GraphQL on Rails
pyama86
2
1.2k
ttlcacheのここがスゴい
pyama86
1
73
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
470
実践ARMアーキテクチャ移行
pyama86
2
2.2k
リモートワーク時代の守護神 PHP開発者のためのセキュリティ強化術
pyama86
3
1k
実践DevSecOps~クラウドネイティブとオンプレミスの間から~
pyama86
1
65
ペパボOpenTelemetry革命
pyama86
2
2k
Site Reliability Engineering for GMO
pyama86
10
1.3k
Other Decks in Technology
See All in Technology
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.4k
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
210
Engineer Career Talk
lycorp_recruit_jp
0
180
【Pycon mini 東海 2024】Google Colaboratoryで試すVLM
kazuhitotakahashi
2
520
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.1k
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
410
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Lexical Analysis
shigashiyama
1
150
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Become a Pro
speakerdeck
PRO
25
5k
Designing Experiences People Love
moore
138
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Building Applications with DynamoDB
mza
90
6.1k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
The Cost Of JavaScript in 2023
addyosmani
45
6.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Transcript
Is Kubernetes On-premises Hardway? ʙ݁ࠗɺͦΕରͰ͋Δʙ
ࢁԼ!QZBNB (.0ϖύϘٕज़ج൫νʔϜ γχΞɾϓϦϯγύϧ UFOTOBQPODPN QZBNBGVO TUOTKQ
45/4 -JOVY/444FSWFS TUOTKQ
45/4
https://github.com/pyama86/github-replacer
ϗεςΟϯάࣄۀ &$ࢧԉࣄۀ ϋϯυϝΠυɾͦͷଞࣄۀ
Is Kubernetes On-premises Hardway?
ϚωʔδυαʔϏεͷϝϦοτ • Control Plane/Data Planeͷཧ • όʔδϣϯΞοϓͷ༰қ͞ • Ϋϥυࣄۀऀ͕ఏڙ͢ΔͦͷଞͷϚωʔδυαʔϏεͱͷ࿈ܞͷ༰қ͞ •
ແݶεέʔϦϯά(If you have much money)
ΦϯϓϨϛεͷϝϦοτ • ͯ͢ΛΒͶͳΒͳ͍͕ނʹࣗ༝ • ਓ݅අΛআ͘ϥϯχϯάίετͷ҆͞
ࠓ͢͜ͱ • ϖύϘͷKubernetesΫϥελͷ֓ཁ • Hardwayͩͬͨ͜ͱ • ࠓޙΓ͍ͨ͜ͱ
KubernetesΫϥελ • OpenStack (Nyah) • Nyah Kubernetes Engine(NKE)
KubernetesΫϥελ نײ • ࡐ͝ͱʹΫϥελΛ͓ͯ͠Γɺ23Ϋϥελ(ൃද࣌) • ࡐʹΑͬͯNKE / GKE / EKSͰͷϋΠϒϦουΫϥυͰར༻
• AWS Direct ConnectͰઐ༻ઢར༻
KubernetesΫϥελ ٕज़ج൫νʔϜ Embedded SRE • NKEίϚϯυͷ։ൃ • ϓϦηοτϚχϑΣετͷߋ৽ • Ϋϥελ্Ͱಈ͘ιϑτΣΞͷಋೖ
• όʔδϣϯΞοϓͳͲͷϝϯςφϯε ։ൃͱར༻ऀ͕ҟͳΔ
NKE • ΫϥελͷߏஙɺόʔδϣϯΞοϓ • ΫϥελཧϚχϑΣετͷద༻ • Data PlaneͷՃɺআ • AnsibleΛ༻͍ͨϓϩϏδϣχϯά
ΫϥελཧΛίʔυԽ͠CLIΠϯλʔϑΣʔεʹͨ͠ͷ
NKE ઃఆϑΝΠϧɺൿಗใετΞʹج͖ͮɺ ΫϥελΛߏஙɺӡ༻ VM VM VM NKE tenant- con fi
g.toml Hashicorp Vault conta iner conta iner conta iner
NKE • Golang • Hashicorp Vault • Consul • Packer
ओཁίϯϙʔωϯτ
Kubernetesͷόʔδϣϯཧ
Kubernetesͷόʔδϣϯཧ • NKEͷϒϥϯν͝ͱʹόʔδϣϯཧ • trunk: ։ൃ༻ϒϥϯν • 1.20,1.21 ϦϦʔεϒϥϯν
Kubernetesͷόʔδϣϯཧ trunk 1.20 1.21 Unit Test E2E Test Unit Test
E2E Test Unit Test E2E Test merge merge
Kubernetesͷόʔδϣϯཧ • CIΛར༻ͨ͠ςετΛύεͨ͠߹ɺ։ൃ༻Ϋϥελɺࣾπʔϧ༻Ϋ ϥελͷόʔδϣϯΞοϓίϚϯυΛ࣮ߦ • ֤Ϋϥελͷཧऀ͕όʔδϣϯΞοϓίϚϯυΛ࣮ߦ • ΫϥελʹΑͬͯ2ܥ࣋ͭΑ͏ʹͯ͠ɺόʔδϣϯΞοϓ࡞ۀͳͲͷ μϯλΠϜΛආ͚ΔΛ͍ͯ͠Δ
Kubernetesͷόʔδϣϯཧ • Control Plane,Data PlaneͱʹPodΛ͍ग़ͭͭ͠ɺ ϩʔϦϯάΞοϓσʔτ • Control PlaneɺEtcdʹ͍ͭͯ1ೖΕସ͑͝ͱʹϔϧενΣοΫΛ ͍ΕͯμϯλΠϜΛආ͚͍ͯΔ
Kubernetesͷӡ༻ཧ
Kubernetesͷӡ༻ཧ • ࢹ • ηΩϡϦςΟࠪ • CI/CD • ϩάཧ
Kubernetesͷࢹ Prometheus Alert Manager Grafana mackerel-agent ࣌ܥྻσʔλͷอଘ ڞ௨ϧʔϧʹै͍ɺSlack௨ PrometheusͷσʔλͷϏδϡΞϥΠθʔγϣϯ Prometheus+AlertManagerͷࢹ
KubernetesͷηΩϡϦςΟࠪ • Wazuh • Falco • GateKeeper
Wazuh https://atmarkit.itmedia.co.jp/ait/articles/1902/18/news012.html OSͷઃఆࠪ ෆਖ਼ΞΫηεݕ ੬ऑੑࠪ
Falco ίϯςφͷৼΔ͍ࠪɾݕ
Gatekeeper Admission ControllerͰಈ࡞͢Δ ϚχϑΣετͷࠪͳͲ Ұॹʹͬͯ͘Δਓɺೖࣾͯ͘͠Εʙʙʙʙ
ࣗಈApply ࢹɺηΩϡϦςΟϙϦγʔҰ੪ tag cluster A cluster B cluster C apply
CI/CD • ςετɺίϯςφϏϧυɺ੬ऑੑεΩϟϯGithub ActionsͷSelf Hosted Runner্Ͱ࣮ߦ • ίϯςφΠϝʔδͷεΩϟϯΤϯδϯtrivyΛར༻ • CDArgoCD
+ argocd-image-updaterΛར༻
ϩάཧ Kafkaʹूͯ͠ɺ༻్ʹԠͯ͡SaaS
͜͜·Ͱͨ͜͠ͱ • NKEίϚϯυͷ։ൃʹΑͬͯΫϥελͷߏஙϝϯςφϯεΛࣗಈԽͯ͠ ͍Δ • ࢹηΩϡϦςΟࠪʹ͍ͭͯNKEͰϕʔεͱͳΔͷΛఏڙ • όʔδϣϯΞοϓʹ͍ͭͯE2EͰಈ࡞Λ୲อͭͭ͠ɺ։ൃ༻ΫϥελͰ ͕ͳ͍͜ͱΛ֬ೝͯ͠ɺద༻͍ͯ͠Δ
Hardwayͩͬͨ͜ͱ
1.12.7
[࠶ܝ]KubernetesΫϥελ ٕज़ج൫νʔϜ Embedded SRE • NKEίϚϯυͷ։ൃ • ϓϦηοτϚχϑΣετͷߋ৽ • Ϋϥελ্Ͱಈ͘ιϑτΣΞͷಋೖ
• όʔδϣϯΞοϓͳͲͷϝϯςφϯε ։ൃͱར༻ऀ͕ҟͳΔ
όʔδϣϯΞοϓͷಈػ͕͍͜ͱ͕͋Δ • Ϋϥελͷ༻్ • ୲ऀ͕ଟ • Kubernetesɺ͍͍ͩͨݹͯ͘ಈ͘ • όʔδϣϯΞοϓʹର͢Δ৺ཧোน
όʔδϣϯཧࣗಈԽ͍ͨ͠ NKE Manifests Cluster A NKE Manifests Cluster B NKE
Manifests Cluster C NKE Cluster A Cluster B Cluster C manifestͷఆٛʹج͍ͮͯࣗಈͰऩଋͯ͠΄͍͠
͋Δಥવͷ ”error: You must be logged in to the server
(Unauthorized)”
Կ͕ى͖͔ͨ kube-apiserver Service Account token ServiceAccountͷར༻͍ͯ͠ΔτʔΫϯ͕ࣦޮͯ͠ೝূΤϥʔ
ͳͥى͖͔ͨ • Kubernetes ͷ SAτʔΫϯ༗ޮظݶ͕Forever • ϖύϘͷKubernetesͷSAτʔΫϯͷ伴ࣗಈͰϩʔςʔγϣϯ͍ͯ͠Δ
Կ͕ى͖͔ͨ kube-apiserver Service Account token ূ໌ॻɺ伴ͷߋ৽ɺHashicorpVaultͰࣗಈԽ kube-controller- manager τʔΫϯͷ͍ग़͠ τʔΫϯͷݕূ
Hashicorp Vault Cert Key ূ໌ॻͱ伴ͷࣗಈ
Կ͕ى͖͔ͨ kube-apiserver Service Account token ূ໌ॻɺ伴ͷߋ৽ɺHashicorpVaultͰࣗಈԽ kube-controller- manager τʔΫϯͷ͍ग़͠ τʔΫϯͷݕূ
Hashicorp Vault Cert Key ূ໌ॻͱ伴ͷࣗಈ Ӭٱอଘʂʂʂ
Կ͕ى͖͔ͨ kube-apiserver Service Account token ূ໌ॻɺ伴ͷߋ৽ɺHashicorp VaultͰࣗಈԽ kube-controller- manager τʔΫϯͷ͍ग़͠
τʔΫϯͷݕূ Hashicorp Vault Cert Key ূ໌ॻͱ伴ͷࣗಈ 伴͕ߋ৽͞ΕΔ͜ͱͰ ݕূ͕Ͱ͖ͳ͘ͳΔ
ରॲʂѹతఆରॲʂʂʂ ಈ͍͍ͯΔϙουಈ͖ଓ͚Δ͕ɺϦεέδϡʔϧ͕Ͱ͖ͳ͍ͷͰ ·ͣShellͰରॲ ͜ͷ͋ͱɺূ໌ॻͷঢ়گΛࢹͯ͠ஔ͖͑ΔϓϩηεΛಈ͔͍ͯ͠·͢
࠷ޙͷॴײ • ΦϯϓϨKubernetesΔͳΒཧιϑτΣΞΛ։ൃͨ͠΄͏͕౷߹తʹཧͰ͖ΔͷͰ ࠷ऴίετམͱͤΔͱࢥ͏ • Kubernetesͦͷͷͱͯྑ͘Ͱ͖͍ͯͯɺKubernetesࣗମͷԿ͔Λ౿Ή͜ͱͦΜͳʹͳ͍ • ࠓհ͍ͯ͠ͳ͍ωοτϫʔΫपΓͷΧʔωϧνϡʔχϯάͳͲɺඞཁͳέʔε͋ͬͨͷ Ͱɺͦ͏͍͏ྖҬΛݟΕΔਓ͕͍ͳ͍ͱݫ͍͠ͱࢥ͏ •
େମͷϢʔεέʔεVM + DockerͰࣄΓΔͷͰɺ΄ΜͱʹͦΕKubernetes͍Δͷʁͱ͍͏ έʔε݁ߏ͋Δͱࢥ͏ • ͜Ε·ͰͷιϑτΣΞʹՃ͑ͯɺKubernetesͱ͍͏ϨΠϠʔ͕ೖΔ͜ͱͰτϥϒϧγϡʔτ ཧେมʹͳΔ
͓͠·͍ ࠷৽ͷ࠾༻ใΛνΣοΫˠ !QC@SFDSVJU