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
170
1
Share
「L3以下は魔法で動いている!」と言いながらiptablesとkube-proxyを読んでみた話
社内LTでKubernetesのServiceを少し深堀した話を再編
RyuSA
December 22, 2020
More Decks by RyuSA
See All by RyuSA
Java屋だってOperatorが作りたい!
ryusa
1
610
Visual Studio Codeとコンテナでいい感じのRe:View執筆環境
ryusa
1
1.6k
JavaScriptと歩くポリシーエンジン jsPolicy
ryusa
1
600
TextAlive App APIと夢見る新しいUX
ryusa
1
440
Gitlab Operatorと夢見るGitlab自動化の旅
ryusa
2
1.1k
AccessPoint Operator on Raspberry Pi
ryusa
1
1.2k
Serviceをたずねて3000行 - Kubernetesコードリーディングの旅 -
ryusa
2
910
そのAPIはセキュアですか?
ryusa
2
840
「〇〇完全に理解したったww」から始めるエンジニア生活
ryusa
2
4.5k
Other Decks in Technology
See All in Technology
多角的な視点から見たAGI
terisuke
0
130
AI 時代の Platform Engineering
recruitengineers
PRO
1
140
Tachikawa.any 運営挨拶
daitasu
0
140
Claude Code / Codex / Kiro に AWS 権限を 渡すとき、何を設計すべきか
k_adachi_01
3
640
ESP32 IoTを動かしながらメモリ使用量を観測してみた話
zozotech
PRO
0
100
新卒エンジニア研修、ハンズオンの設計における課題と実践知/ #tachikawaany
nishiuma
2
140
Modernizing Your HCL Connections Experience: Visual Report to chain, Profile Enhancements, and AI Integration
wannesrams
0
300
小さいVue.jsを30分で作る
hal_spidernight
0
150
サービスの信頼性を高めるため、形骸化した「プロダクションミーティング」を立て直すまでの取り組み
stefafafan
1
260
ハーネスエンジニアリング入門
hatyibei
0
120
[Scram Fest Niigata2026]Quality as Code〜AIにQAの思考を再現させる試み〜
masamiyajiri
1
300
Vision Banana: Image Generators are Generalist Vision Learners
kzykmyzw
0
340
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
970
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
550
Site-Speed That Sticks
csswizardry
13
1.2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
340
YesSQL, Process and Tooling at Scale
rocio
174
15k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
320
The Invisible Side of Design
smashingmag
302
52k
Everyday Curiosity
cassininazir
0
200
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
790
The Spectacular Lies of Maps
axbom
PRO
1
740
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
230
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
完全に理解した (なにもわからなくなった)
おしまい