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
大規模コンピューティングを支える Kubernetes のネットワーク
Search
Honahuku
July 05, 2024
0
170
大規模コンピューティングを支える Kubernetes のネットワーク
第4回分散システム集会で発表したときの資料です
https://distributed.connpass.com/event/321792/
Honahuku
July 05, 2024
Tweet
Share
More Decks by Honahuku
See All by Honahuku
KubeCon + CloudNativeCon Japan 2025 に行ってきた! & containerd の新機能紹介
honahuku
0
130
「改訂版ブルーム・タキソノミー」を利用したソフトウェアドキュメンテーションの改善手法の提案
honahuku
0
470
Kubernetes のクラスタ内ネットワーク概要
honahuku
1
47
エンジニアでも論文が読みたい!
honahuku
0
870
今から始める分散システム
honahuku
0
310
SecAd~Ad data drivin’ network security~
honahuku
0
180
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
How to Think Like a Performance Engineer
csswizardry
25
1.7k
Side Projects
sachag
455
42k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Why Our Code Smells
bkeepers
PRO
336
57k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Being A Developer After 40
akosma
90
590k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Transcript
大規模コンピューティングを支える Kubernetes のネットワーク 第4回分散システム集会 @honahuku
自己紹介 Honahuku(ほなふく) 第4回分散システム集会 • 7月からGKEを使った広告の部 署に異動に • 梅雨で頭が痛いが頑張る • 好きな色の折りたたみ傘を見つ
けてうきうき • オフィスの近くで食べた「食べる 豚汁」が美味しかった • 次の土曜日は三重にセキュリ ティ・ミニキャンプのチューター として行ってきます 最近のトピック
分散システムとは(短縮版)
第4回分散システム集会 • 複数ノードにおいて処理を分散して行うもの(ほなふくが勝手に 定義) • ジョブ型とコンテナ型(ほなふくが勝手に定義) • ユーザーからのリクエストを受け付けるか • k8s
は web リクエストを受け付けることが多い 分散システムとは [1] Slurm Workload Manager [2] Slurm Workload Manager
kubernetes のネットワーク
第4回分散システム集会 • インターネットから Nodeにトラフィック が流れてくる • どのマシンでも同じよ うにコンテナが動いて ほしい •
→ Pod は Node と 独立したネットワーク を持ち、 Pod ごとに IP が振られる k8s でのユーザーリクエストの処理 [3] Pod へのトラフィック
外からのトラフィックは直接 Node に送信される?
第4回分散システム集会 • Pod は揮発する ◦ Node の調子が悪くなったときに別 の Node に退避したい
• Service は Pod に対するアクセスを 抽象化する ◦ 外からのトラフィック以外にもクラス タ内の他のリソースから Pod にアク セスすることもある • Pod とは独立したネットワークを持ち、 Service ごとに IP が振られる Service という概念 [3] Service と Pod
(Service は) Pod と独立した ネットワークを持つ??
第4回分散システム集会 Node と Service と Pod [4] k8s のネットワーク
k8s の中ではめちゃくちゃ ネットワークが分離されている (overlay network)
誰が提供するのこれ
\\ CNI // (Container Network Interface)
第4回分散システム集会 CNI [5] k8s と CNI
第4回分散システム集会 CNI
なるほどわからん
第4回分散システム集会 • CNI は k8s 以外でも使える ◦ Linux コンテナ向けのネットワークの仕様とライブ ラリ
• CNIの k8s 向け実装は Network Plugin と呼ばれ る[10] • k8s では overlay network を提供する[11] ◦ Pod へ IP を振ったり ◦ Service へ IP を振ったりする • VXLAN や IP-in-IP で動いてる [5] CNI
第4回分散システム集会 • Service は実態として kube-proxy というやつがいい 感じにしている ◦ ノードに流れてきた Pod
向けのトラフィックを Pod に流す • kube-proxy はクラスタの外から CNI plugin までを 繋いでいる • ネットワークを抽象化(≒仮想化)することによって k8s のコンポーネントがネットワークを k8s の API とかの仕 組み上でいじれるようになってる ◦ 代わりにオーバーヘッドもある[4] CNI plugin と Service
まとめ
第4回分散システム集会 • overlay network により Pod 間 や Service 間
で NAT をせずに疎通できる(他にも色々やってくれる) • これは CNI Plugin により提供される • overlay network までのトラフィックは kube-proxy が繋ぎこむ まとめ [7] [8]
参考文献
参考文献 第4回分散システム集会 • [1] Slurm Workload Manager https://slurm.schedmd.com/ • [2]
Kubernetes https://kubernetes.io/ • [3] ネットワークの概要 https://cloud.google.com/kubernetes-engine/docs/concepts/network-overview • [4] コンテナネイティブロードバランシングの話 / A story about container native load balancing https://speakerdeck.com/inductor/a-story-about-container-native-load-balancing • [5] Assessing Container Network Interface Plugins: Functionality, Performance, and Scalability https://doi.org/10.1109/TNSM.2020.3047545 • [6]久々に社内勉強会で発表するので資料を公開します https://blog.inductor.me/entry/container-native-load-balancing • [7]Kubernetes Components https://kubernetes.io/docs/concepts/overview/components/ • [8]CNI - the Container Network Interface https://github.com/containernetworking/cni • [9]ふくねっと Vol.1 https://booth.pm/ja/items/5399365 • [10]Network Plugins https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/ne twork-plugins/ • [11]The Kubernetes network model https://kubernetes.io/docs/concepts/services-networking/#the-kubernetes-netwo rk-model