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
「L3以下は魔法で動いている!」と言いながらiptablesとkube-proxyを読んでみた話
Search
RyuSA
December 22, 2020
Technology
180
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
「L3以下は魔法で動いている!」と言いながらiptablesとkube-proxyを読んでみた話
社内LTでKubernetesのServiceを少し深堀した話を再編
RyuSA
December 22, 2020
More Decks by RyuSA
See All by RyuSA
Java屋だってOperatorが作りたい!
ryusa
1
620
Visual Studio Codeとコンテナでいい感じのRe:View執筆環境
ryusa
1
1.6k
JavaScriptと歩くポリシーエンジン jsPolicy
ryusa
1
610
TextAlive App APIと夢見る新しいUX
ryusa
1
460
Gitlab Operatorと夢見るGitlab自動化の旅
ryusa
2
1.1k
AccessPoint Operator on Raspberry Pi
ryusa
1
1.3k
Serviceをたずねて3000行 - Kubernetesコードリーディングの旅 -
ryusa
2
940
そのAPIはセキュアですか?
ryusa
2
850
「〇〇完全に理解したったww」から始めるエンジニア生活
ryusa
2
4.6k
Other Decks in Technology
See All in Technology
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
120
モバイルアプリ開発概論2026
recruitengineers
PRO
1
300
名古屋の市バスGTFS-JPデータ×スガキヤ 最寄りバス停検索をAmazon ElastiCache Serverless for Valkeyで最適化する
usanchuu
1
260
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
190
[MIRU26] Open-Vocabulary Intention-Guided Object Detection in Diverse Scenes
keio_smilab
PRO
0
140
ボトムアップ文化が強い組織で セキュリティをどう根付かせていくかの現在進行形の話 / Making Security Stick in a Bottom-Up Organization
yamaguchitk333
0
120
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.1k
20260608_Codexの可能性_ノンプログラマー向け_大城追記
doradora09
PRO
0
760
AIQAのナレッジ構築について
qatonchan
1
160
Atlassian Cloudサポート業務でのAIエージェント活用事例
smt7174
0
410
新しい SLO が良い感じにハマっている話
z63d
4
2.1k
トヨタ⽣産⽅式(TPS)⼊⾨
recruitengineers
PRO
1
370
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
460
Believing is Seeing
oripsolob
1
180
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
230
WCS-LA-2024
lcolladotor
0
790
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
190
Designing Powerful Visuals for Engaging Learning
tmiket
1
470
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
160
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Ethics towards AI in product and experience design
skipperchong
2
340
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Transcript
と言いながら iptablesと kube-proxyを読んでみた話 L3以下は魔法で動いている!!!
本日のおはなし
Service なにもわからない
知っていること - Serviceはkube-proxyが深くかかわっている - Serviceはデフォルトでiptablesを使っているらしい - L3以下は魔法で動いている 知らないこと - iptablesの使いどころさん
- kube-proxyが何をしている?
実際に見てみる
(DeploymentとServiceを作成) Podを3つとSvcを作成
Workerノードのiptablesを眺める
iptables わからん \(^o^)/ 我、アプリ(?)の人間ぞ??
None
送信元192.168.0.0/16 から 送信先10.109.35.24/32 宛の TCPを転送しているっぽい?
送信元192.168.0.0/16 から 送信先10.109.35.24/32 宛の TCPを転送しているっぽい? nginxサービスのIPアドレス Kubeadmで設定したPodSubnet
None
確率で3つの場所に転送している……?
None
転送の最終宛先は各PodのIPアドレス
TCP発射 ↓ SvcのIPアドレス着弾 ↓ 確率(静的)分散 ↓ DNAT ↓ (魔法が発動する) ↓
PodのIPアドレスに転送
完全に理解した (なにもわかっていない)
ということでkube-proxy読んできた
None
None
更新処理
None
eventhandlers?
None
iptablesのProxiser
None
同期している?
None
どこかで初期化されているはず
None
これが走る
None
それっぽくない?
None
確率計算とレコード追加 Endpoint一覧をforで回す PodへのDNAT
完全に理解した (なにもわからなくなった)
おしまい