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
as(型アサーション)を書く前にできること
marokanatani
10
2.7k
Realtime API 入門
riofujimon
0
150
カンファレンスの「アレ」Webでなんとかしませんか? / Conference “thing” Why don't you do something about it on the Web?
dero1to
1
110
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
Arm移行タイムアタック
qnighy
0
340
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Contemporary Test Cases
maaretp
0
140
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
CSC509 Lecture 09
javiergs
PRO
0
140
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Featured
See All Featured
Building an army of robots
kneath
302
43k
Agile that works and the tools we love
rasmusluckow
327
21k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
It's Worth the Effort
3n
183
27k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Done Done
chrislema
181
16k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Git: the NoSQL Database
bkeepers
PRO
427
64k
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Λ࡞͍͖͍ͬͯͨ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ