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
1
150
「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
580
Visual Studio Codeとコンテナでいい感じのRe:View執筆環境
ryusa
1
1.5k
JavaScriptと歩くポリシーエンジン jsPolicy
ryusa
1
570
TextAlive App APIと夢見る新しいUX
ryusa
1
420
Gitlab Operatorと夢見るGitlab自動化の旅
ryusa
2
1.1k
AccessPoint Operator on Raspberry Pi
ryusa
1
1.2k
Serviceをたずねて3000行 - Kubernetesコードリーディングの旅 -
ryusa
2
880
そのAPIはセキュアですか?
ryusa
2
820
「〇〇完全に理解したったww」から始めるエンジニア生活
ryusa
2
4.4k
Other Decks in Technology
See All in Technology
小さく、早く、可能性を多産する。生成AIプロジェクト / prAIrie-dog
visional_engineering_and_design
0
110
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
280
ActiveJobUpdates
igaiga
1
330
『君の名は』と聞く君の名は。 / Your name, you who asks for mine.
nttcom
1
120
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
430
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
240
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.7k
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
20251203_AIxIoTビジネス共創ラボ_第4回勉強会_BP山崎.pdf
iotcomjpadmin
0
140
コールドスタンバイ構成でCDは可能か
hiramax
0
100
ソフトウェアエンジニアとAIエンジニアの役割分担についてのある事例
kworkdev
PRO
0
300
[Neurogica] 採用ポジション/ Recruitment Position
neurogica
1
130
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
The SEO identity crisis: Don't let AI make you average
varn
0
39
A Soul's Torment
seathinner
1
2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
980
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
32
Digital Ethics as a Driver of Design Innovation
axbom
PRO
0
130
Ethics towards AI in product and experience design
skipperchong
1
140
For a Future-Friendly Web
brad_frost
180
10k
Automating Front-end Workflow
addyosmani
1371
200k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
150
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
完全に理解した (なにもわからなくなった)
おしまい