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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
RyuSA
December 22, 2020
Technology
1
160
「L3以下は魔法で動いている!」と言いながらiptablesとkube-proxyを読んでみた話
社内LTでKubernetesのServiceを少し深堀した話を再編
RyuSA
December 22, 2020
Tweet
Share
More Decks by RyuSA
See All by RyuSA
Java屋だってOperatorが作りたい!
ryusa
1
590
Visual Studio Codeとコンテナでいい感じのRe:View執筆環境
ryusa
1
1.5k
JavaScriptと歩くポリシーエンジン jsPolicy
ryusa
1
580
TextAlive App APIと夢見る新しいUX
ryusa
1
430
Gitlab Operatorと夢見るGitlab自動化の旅
ryusa
2
1.1k
AccessPoint Operator on Raspberry Pi
ryusa
1
1.2k
Serviceをたずねて3000行 - Kubernetesコードリーディングの旅 -
ryusa
2
890
そのAPIはセキュアですか?
ryusa
2
830
「〇〇完全に理解したったww」から始めるエンジニア生活
ryusa
2
4.4k
Other Decks in Technology
See All in Technology
【Ubie】AIを活用した広告アセット「爆速」生成事例 | AI_Ops_Community_Vol.2
yoshiki_0316
1
120
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
740
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
260
OpenShiftでllm-dを動かそう!
jpishikawa
0
150
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.7k
AWS DevOps Agent x ECS on Fargate検証 / AWS DevOps Agent x ECS on Fargate
kinunori
2
340
Prox Industries株式会社 会社紹介資料
proxindustries
0
150
猫でもわかるKiro CLI(セキュリティ編)
kentapapa
1
170
Agent Skils
dip_tech
PRO
0
160
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
210
Oracle AI Database移行・アップグレード勉強会 - RAT活用編
oracle4engineer
PRO
0
120
[CV勉強会@関東 World Model 読み会] Orbis: Overcoming Challenges of Long-Horizon Prediction in Driving World Models (Mousakhan+, NeurIPS 2025)
abemii
0
160
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
170
Producing Creativity
orderedlist
PRO
348
40k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
460
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
99
Marketing to machines
jonoalderson
1
4.7k
From π to Pie charts
rasagy
0
130
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
54
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
完全に理解した (なにもわからなくなった)
おしまい