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
200
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
1k
Deep Dive into Runtime Shim
moricho
3
2.1k
Recap: Zero Trust Service Mesh with Calico, SPIRE, and Envoy
moricho
1
1.1k
gVisorで実現するこれからのコンテナセキュリティ
moricho
6
5k
Deep dive into sync.Pool
moricho
2
1.2k
Other Decks in Programming
See All in Programming
気づいて!アプリからのSOS 〜App Store Connect APIで始めるパフォーマンス健康診断〜
waka12
0
260
フロントエンド開発に役立つクライアントプログラム共通のノウハウ / Universal client-side programming best practices for frontend development
nrslib
7
3.8k
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
150
2025年版 サーバーレス Web アプリケーションの作り方
hayatow
23
25k
Playwrightはどのようにクロスブラウザをサポートしているのか
yotahada3
7
2.2k
Build your own WebP codec in Swift
kishikawakatsumi
2
870
Web技術を最大限活用してRAW画像を現像する / Developing RAW Images on the Web
ssssota
2
1.1k
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osk2025-duckdb
takahashiikki
1
230
大規模アプリのDIフレームワーク刷新戦略 ~過去最大規模の並行開発を止めずにアプリ全体に導入するまで~
mot_techtalk
0
350
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
240
CSC509 Lecture 01
javiergs
PRO
1
430
Чего вы не знали о строках в Python – Василий Рябов, PythoNN
sobolevn
0
150
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Visualization
eitanlees
148
16k
Git: the NoSQL Database
bkeepers
PRO
431
66k
KATA
mclloyd
32
14k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
610
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Gamification - CAS2011
davidbonilla
81
5.5k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
30
2.9k
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Λ࡞͍͖͍ͬͯͨ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ