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
ttakada
April 24, 2019
Technology
0
690
雰囲気で語るKubernetesネットワーク
ttakada
April 24, 2019
Tweet
Share
More Decks by ttakada
See All by ttakada
SaaSで実現するトラッフィク制御とセキュリティ
ttakada
0
440
クラウドのメタデータサービスとSSRF脆弱性
ttakada
1
580
Kixsのご紹介
ttakada
0
2.5k
クラウド/オンプレのネットワークアーキテクチャ再考
ttakada
0
300
AWS re:Invent2017に行ってきた
ttakada
0
430
誰も知りたくないKixsの軌跡
ttakada
0
1.4k
AWS 認定の概要と勉強法
ttakada
0
1.5k
Oracle Databaseを パブリッククラウド(AWS)で 使うときの注意点
ttakada
0
23k
RADIUSって知ってますか?
ttakada
0
1.3k
Other Decks in Technology
See All in Technology
KubeCon + CloudNativeCon Japan 2025 に行ってきた! & containerd の新機能紹介
honahuku
0
120
CursorによるPMO業務の代替 / Automating PMO Tasks with Cursor
motoyoshi_kakaku
2
790
整頓のジレンマとの戦い〜Tidy First?で振り返る事業とキャリアの歩み〜/Fighting the tidiness dilemma〜Business and Career Milestones Reflected on in Tidy First?〜
bitkey
0
240
Liquid Glass革新とSwiftUI/UIKit進化
fumiyasac0921
0
300
さくらのIaaS基盤のモニタリングとOpenTelemetry/OSC Hokkaido 2025
fujiwara3
2
240
B2C&B2B&社内向けサービスを抱える開発組織におけるサービス価値を最大化するイニシアチブ管理
belongadmin
0
110
OpenHands🤲にContributeしてみた
kotauchisunsun
1
500
250627 関西Ruby会議08 前夜祭 RejectKaigi「DJ on Ruby Ver.0.1」
msykd
PRO
2
370
無意味な開発生産性の議論から抜け出すための予兆検知とお金とAI
i35_267
0
920
Beyond Kaniko: Navigating Unprivileged Container Image Creation
f30
0
110
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
130
AI専用のリンターを作る #yumemi_patch
bengo4com
3
1.9k
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
680
How to train your dragon (web standard)
notwaldorf
94
6.1k
We Have a Design System, Now What?
morganepeng
53
7.7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Gamification - CAS2011
davidbonilla
81
5.3k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Designing for Performance
lara
609
69k
Statistics for Hackers
jakevdp
799
220k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.4k
Transcript
None
https://www.slideshare.net/HirokiSakonju/kubernetes-virgin-is-permitted-until-2017
雰囲気で語る Kubernetesネットワーク 髙田 知典
ワークロード処理実行単位の変遷
なぜコンテナ https://www.docker.com/resources/what-container • はやい • オーバーヘッドすくない • 管理が簡単(???)
• コンテナオーケストラエンジン ◦ コンテナのデプロイ ◦ スケーリング • 環境 ◦ ローカル
▪ Minukube ◦ 構築 ▪ Kubeadm ▪ Rancher ◦ マネージド ▪ GKE(Google Kubernetes Engine) ▪ AKS(Azure Kubernetes Service) ▪ EKS(Elastic Container Service for Kubernetes)
Cluster https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro/ • Master ◦ API Server • Node ◦
コンテナが動くホスト(物理ホスト/仮想マシ ン)
Node https://kubernetes.io/docs/tutorials/kubernetes-basics/explore/explore-intro/#pods-overview • 物理/仮想マシン • 一つのNodeに複数のPod
Pod • Kubernetes上のコンテナ管理単位 • 1個以上のコンテナで構成される • (内部)IPアドレスは、Podに割り当てら れる ◦ コンテナ単位には割り当てられない
◦ Pod内では、コンテナはIPアドレス と Port番 号空間を共有する = 一つの Pod内のコン テナは重複するPort番号を使えない https://kubernetes.io/docs/tutorials/kubernetes-basics/explore/explore-intro/#pods-overview
ネットワーク通信の種類 • コンテナ間通信 • Pod間通信 • Service通信 • Ingressによる通信
コンテナ間通信 Node Network (External) Pod Network (Internal) Node Pod Pod
localhost宛 通信 Pod宛通信 NIC NIC lo0
NodeをまたがるPod Network Node Network (External) Pod Network (Internal) Node Pod
Pod Pod Node オーバーレイ ネットワーク NIC NIC NIC
CNI(Container Network Interface) • CNI は コンテナにネットワーク接続を提供することにフォーカスした仕様とライブラ リ (libcni) と参照実装の
CNI プラグインなどから構成 • Flannel ◦ VXVLAN / Host GW(IPルーティング) • Project Calico • Canal • NSX-T Container Plugin https://www.slideshare.net/motonorishindo/cni-124981353
Service • Podをまとめたグループ • Pod宛の通信用にエンドポイントを提供して、Pod、Nodeの存在を抽象化 ◦ PodのIPアドレスを意識する必要性をなくす • 以下の機能を提供 ◦
Pod宛トラフィックのL4ロードバランシング ◦ ラベルを利用したPodのサービスディスカバリ ◦ クラスタ内DNS Service IPとDNS名が付与
Serviceの種類 • LoadBalancer ◦ クラスタ外で提供されている Load Balancerの仮想IPアドレス • ClusterIP ◦
Kubernetes Cluster内でのみ疎通可能な仮想 IPアドレス • ExternalIP • NodePort ◦ 全Nodeのアドレス(0.0.0.0) • Headless • ExternalName • None-Selector
Service Node Network (External) Pod Network (Internal) Node Pod Pod
Pod Node Endpoint (Load Balancer) Endpoint (Cluster IP) NIC NIC NIC
クラスタ内DNSとクラスタ外DNS Node Network (External) Pod Network (Internal) Node Pod Pod
Pod Node Pod クラスタ内DNS Serviceエンドポイ ント名が自動登録さ れる その他の名前は、 外部に再帰問い合 わせ
Ingress • L7ロードバランシング (パスベースルーティング/HTTPS終端等) • IngressリソースとIngress Controllerで構成 • クラスタ外のロードバランサの利用 ◦ GKE
Ingress • クラスタ内にIngress用のPodをデプロイ ◦ Nginx Ingress ▪ kubernetes/ingress-nginx, nginxinc/kubernetes-ingress with NGINX, nginxinc/kubernetes-ingress with NGINX Plus ◦ HA Proxy など
クラスタ外 Ingress Node Network (External) Pod Network (Internal) Node Pod
Pod Pod Node NIC NIC NIC Ingress /path1: Service A /path2: Service B Node Port Service A Node Port Service B
クラスタ内 Ingress Node Network (External) Pod Network (Internal) Node Pod
Pod Pod Node NIC NIC NIC Endpoint (Load Balancer) Pod NIC Ingress Controller Pod /path1: Service A /path2: Service B
まとめ • Kubernetesでは、内部(Pod)ネットワークと外部(Node)ネットワークとで構成される • PodはServiceとしてグループ化されて、Serviceのエンドポイント(DNS名/IPアド レス)宛の通信は、Pod(コンテナ)へ、L4ロードバランスされる • Ingressは、L7ロードバランスを提供 ◦ Kubertesクラスタ外に配置する構成 (※実質
GKE Ingressのみ) ◦ Podとして配置する構成