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
Write Kubernetes CustomController in Go
Search
moricho
December 04, 2019
Programming
1
170
Write Kubernetes CustomController in Go
moricho
December 04, 2019
Tweet
Share
More Decks by moricho
See All by moricho
Enhance Kubernetes Security with Gatekeeper
moricho
3
950
Deep Dive into Runtime Shim
moricho
3
1.9k
Recap: Zero Trust Service Mesh with Calico, SPIRE, and Envoy
moricho
1
990
gVisorで実現するこれからのコンテナセキュリティ
moricho
6
4.9k
Deep dive into sync.Pool
moricho
2
1.2k
Other Decks in Programming
See All in Programming
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Outline View in SwiftUI
1024jp
1
330
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Jakarta EE meets AI
ivargrimstad
0
160
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
cmp.Or に感動した
otakakot
2
150
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Done Done
chrislema
181
16k
The Cult of Friendly URLs
andyhume
78
6k
Documentation Writing (for coders)
carmenintech
65
4.4k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
Making Projects Easy
brettharned
115
5.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Transcript
Write Kubernetes CustomController in Go golang.tokyo #28 Dec.4
None
OVERVIEW golang.tokyo #28 Dec.4 ɾk8sͷ༻ޠͷ͓͞Β͍ ɾcontroller-runtimeΛ࣮ͬͨ ɾk8sͷControllerͱʁ
k8sͷ͓͞Β͍ ɾPod : ϫʔΫϩʔυͷ࠷খ୯Ґ ex. Goίϯςφ(API) + fluentdίϯςφ(logging) ɾReplicaSet :
͋ΔPodͷू߹
k8sͷControllerͱʁ k8sManifest(yaml)Ͱ·͍͠ঢ়ଶΛએݴ => ͦͷঢ়ଶΛҡ࣋͠ଓ͚Δ ref) Operator Basic in CNDK2019 -
speakerdeck
k8sͷControllerͱʁ
k8sͷControllerͱʁ
k8sͷControllerͱʁ
k8sͷControllerͱʁ k8s෦Ͱ͜ͷॲཧΛ ܁Γฦ͍ͯ͠Δ => ͋Δ͖ঢ়ଶͱ ɹ ݱࡏͷঢ়ଶΛ߹ΘͤΔ
CustomController controllerࣗલͰ࡞Δ͜ͱͰ͖Δ => ͦΕ͕CustomController kubernetes-sigs/controller-runtime ͱ͍͏ϥΠϒϥϦ͕ఏڙ͞Ε͍ͯΔ
controller-runtimeΛ ࣮ͬͨ ࠓճͷαϯϓϧɿ ReplicaSet͕࡞͞ΕͨΒɺ ͦͷཧԼͷίϯςφ໊Λදࣔ͢Δ ίϯτϩʔϥʔ
controller-runtimeΛ ࣮ͬͨ (controller.go) ͲͷϦιʔεΛऔಘͯ͠ɺͲ͏͍͏ॲཧΛ࣮ߦ͢Δ͔ ɾ Reconciler ɾ
controller-runtimeΛ ࣮ͬͨ (controller.go) Namespace, Ϧιʔε(ReplicaSet)Λࢦఆͯ͠ɺ ϦιʔεͷใΛऔಘɺίϯςφ໊Λग़ྗ ɾ
controller-runtimeΛ ࣮ͬͨ (main.go) ControllerΛੜ ɾ ઌ΄Ͳఆٛͨ͠ReconcilerΛࢦఆ ɾ
controller-runtimeΛ ࣮ͬͨ (main.go) ɾࢦఆͨ͠ϦιʔεΛControllerͰࢹ ɾ ɾReplicaSetʹߋ৽͕͋ͬͨΒɺઌ΄ͲͷॲཧΛ࣮ߦ
controller-runtimeΛ ࣮ͬͨ ReplicaSetΛ࡞ͨ͠Βɺ ͦͷཧԼͷίϯςφͷ໊લ͕ දࣔ͞Εͨ 70ߦ͘Β͍Ͱ؆୯ʹॻ͚ͨ
࣮༻తͳControllerΛ࡞͍͖͍ͬͯͨ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ