SlideShare a Scribd company logo
Traffic Management
with Istio ( with Demo )
2019/08/08 Cloud Native FUKUOKA #02
loftkun
About me
• @loftkun
• ヤフー株式会社 SRE部
• 将棋好き
• 対局結果検索サイトなど公開してます
• ⾳楽好き
• ROCK IN JAPAN FESTIVAL ⾏きます
• ピアノ習いたい
• コンテナ好き、k8sは前職で使ってた、現職でも使いたい
My k8s Environment
Machine
CPU Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
6Core/12Threads
RAM 64GB
OS Ubuntu 17.10
k8s
minikube v1.2.0 ( Kubernetes v1.15.0 )
assign 12cpu & 40GB RAM
kubectl v1.15.0
istio v1.2.2
helm v2.14.1
minikube start vm-driver=virtualbox
Container
VM ( Node )
Minikube
BareMetal
ssh -fNL 12345:192.168.99.100:12345 loft@192.168.3.5
192.168.3.5
grafana service のnodePortが12345の場合
http://localhost:12345 でアクセスできるぞ
192.168.99.100
192.168.3.4
Minikube ssh
でログイン可能
minikube start vm-driver=none
Container
Minikube
BareMetal192.168.3.5
( Node )
grafana service のnodePortが12345の場合
http://192.168.3.5:12345 でアクセスできるぞ
192.168.3.4
tcpdump –i docker0
全Pod間の通信をキャプチャできるぞ
Agenda
Introduction
How to use
Bookinfo
Traffic Management
Introduction
What is Istio?
https://istio.io/
• サービスメッシュを構成するOSS
• CNCF Platinum Member
• Proxyコンテナ(Envoy)をSidecarとしてPod内にInjectionしてくれる
• 様々な制御をkubectl applyできる(後ほどご紹介)
• 便利なOSS同梱
• メトリクス (Prometheus/Grafana)
• トレース (Jaeger/Zipkin)
• サービスメッシュグラフの可視化(Kiali)
https://github.com/cncf/trailmap
https://github.com/cncf/trailmap
How to use
Install à Sidecar Injection à Apply traffic rules
3 steps
Install
Sidecar Injection
Apply traffic rules
Install
Use Helm? $ kubectl apply istio-demo.yaml
Cluster has
tiller?
$ helm template istio | kubectl apply
$ helm install istio
Y
Y
おすすめはHelm使⽤。パラメタ設定が楽。
• incubator/istioはメンテが⽌まってるので使わない
• istio.ioのdoc記載の最新版をdownloadして使おう
N
N
Sidecar Injection
Manual
istioctl kube-injectコマンドでSidecarを埋め込んだmanifestを出⼒する
$ kubectl apply -f < ( istioctl kube-inject -f my-manifests.yaml )
Automatic
対象のnamespaceにラベルを設定しておくだけでOK!
$ kubectl label ns my-ns istio-injection=enabled
Apply traffic rules
kubectl apply –f my-virtualservice.yaml
• VirtualService
• a set of traffic routing rules
• 宛先別に様々なruleを設定できる
Istio setup is done, Letʼs Traffic Management !
Bookinfo
Istioが提供するサンプルアプリ
Architecture
https://istio.io/docs/examples/bookinfo/
load balancing
( by reviews service )
Demo
Traffic Management
Routing, Fault Injection, etc
Request Routing
https://istio.io/docs/examples/bookinfo/
Demo
review v1 (星なし)
Request Routing ( by header )
https://istio.io/docs/examples/bookinfo/
Demo
Traffic Management with Istio ( with Demo )
Canary Release に使えそう︕ review v2 (⿊い星)
Fault Injection (delay )
Injected
Delay : 7sec
https://istio.io/docs/examples/bookinfo/
Demo
Traffic Management with Istio ( with Demo )
https://istio.io/docs/examples/bookinfo/
hard-corded
Timeout : 10sec
Injected
Delay : 7sec
https://istio.io/docs/examples/bookinfo/
hard-corded
Timeout : 3sec
Retry : 1
hard-corded
Timeout : 10sec
Injected
Delay : 7sec
Chaos Engineering に使えそう︕ https://istio.io/docs/examples/bookinfo/
Traffic Management with Istio ( with Demo )
Other Traffic Managements
• Traffic Shifting
• Circuit Breaking
• Mirroring
and more !
https://istio.io/docs/tasks/traffic-management/
Appendix
なぜヨット︖
いろいろ船関連だった
Kubernetes 操舵手(ギリシャ語)
Helm 舵
tiller 舵柄(かじを操作するレバー)
Istio 帆(ギリシャ語)
Spinnaker 大きな三角形の帆
Thank you for listening !
福岡新着ITイベント
@ITEventFukuoka
Appendix :
commands for demo
with my home k8s
ssh config
• ~/.ssh/config
• ログイン
ssh my-k8s
ssh port forwarding
INGRESS_HOST=192.168.99.100
INGRESS_PORT=31380
ssh -fNL ${INGRESS_PORT}:${INGRESS_HOST}:${INGRESS_PORT} my-k8s
• ローカルの31380ポートをnode(MinikubeのVM) 内の
31380ポートにforwarding
• BookInfoは localhost:31380/productpage で⾒れる
ref
• Request Routing
• https://istio.io/docs/tasks/traffic-management/request-routing/
• Fault Injection
• https://istio.io/docs/tasks/traffic-management/fault-injection/
Appendix :
BookInfo screenshot
review v1のレスポンス
reload
Traffic Management with Istio ( with Demo )
review v2のレスポンス(⿊い星)
reload
Traffic Management with Istio ( with Demo )
review v3のレスポンス(⾚い星)

More Related Content

PDF
ちょっと古いマシンにLinuxを
PDF
FreeBSD jail+vnetと戯れた話
PDF
OpenContrailのソースコードを探検しよう!
PPTX
Traffic Management with Istio
PPTX
plotnetcfg入門 | Introduction to plotnetcfg
PDF
LagopusとAzureとIPsecとDPDK
PDF
(仮)このMany Core CPU野郎!!
ODP
「BluetoothでLinuxマシンとAndroidを繋いで話が出来るようにした話」「台風で停電になって省電力の設定をした話」「ネットワークの設定が引き...
ちょっと古いマシンにLinuxを
FreeBSD jail+vnetと戯れた話
OpenContrailのソースコードを探検しよう!
Traffic Management with Istio
plotnetcfg入門 | Introduction to plotnetcfg
LagopusとAzureとIPsecとDPDK
(仮)このMany Core CPU野郎!!
「BluetoothでLinuxマシンとAndroidを繋いで話が出来るようにした話」「台風で停電になって省電力の設定をした話」「ネットワークの設定が引き...

What's hot (20)

PDF
Using rump on NetBSD 7.0
PDF
OSvの概要と実装
PDF
勉強会向けサーバを作ってみる2 / Rasbian jessieを試す/ Google Authenticatorのパスコードを作る
PPTX
Introduction to Ostinato , network packet crafting and generator.
PPTX
ネットワーク機器のAPIあれこれ入門 (NetOpsCoding#2)
PDF
ほしいプロトコルはトンネルすればいいじゃない at JAWS DAYS 2014 Tech Deep Dive
PDF
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい
PDF
高速ネットワーク最新動向と具体例 (ENOG58 Meeting)
PDF
Ethernetの受信処理
PPTX
軽量高機能webサーバーnginx
PDF
Redunduncy of NAT instance on AWS/VPC
PDF
Bossan dentoo
PDF
Raspberry Piにdiskless modeのalpine linuxを導入してみる
PDF
Lagopus 0.2.2
PDF
Hatoholのログ監視機能 2014/10版
PDF
Nbug201503
PDF
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい2
KEY
Lxc on cloud
PDF
シーサーでのInfiniBand導入事例
PDF
Pythonによる並列プログラミング -GPGPUも-
Using rump on NetBSD 7.0
OSvの概要と実装
勉強会向けサーバを作ってみる2 / Rasbian jessieを試す/ Google Authenticatorのパスコードを作る
Introduction to Ostinato , network packet crafting and generator.
ネットワーク機器のAPIあれこれ入門 (NetOpsCoding#2)
ほしいプロトコルはトンネルすればいいじゃない at JAWS DAYS 2014 Tech Deep Dive
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい
高速ネットワーク最新動向と具体例 (ENOG58 Meeting)
Ethernetの受信処理
軽量高機能webサーバーnginx
Redunduncy of NAT instance on AWS/VPC
Bossan dentoo
Raspberry Piにdiskless modeのalpine linuxを導入してみる
Lagopus 0.2.2
Hatoholのログ監視機能 2014/10版
Nbug201503
技適なBluetooth GNSS/GPSレシーバーをRaspberryPiで作りたい2
Lxc on cloud
シーサーでのInfiniBand導入事例
Pythonによる並列プログラミング -GPGPUも-
Ad

More from ロフト くん (9)

PPTX
OpenShiftのサポートを始めるぞ!高頻度で更新されるOSSを効果的にキャッチアップする仕組みを考えました!
PDF
Demo of write slides and books with VSCode + Markdown
PDF
Write slides and books in VSCode + Markdown
PPTX
OpenShift from Easy way to Hard ? Way
PPTX
Kubernetes The Hard Way をやってみた
PPTX
Operator reading and writing ( Operator SDK 編 )
PPTX
Getting Started with Graph Database with Python
PDF
AbemaTVのコメントビューアを作る話
PDF
Enjoying k8s cluster with Minikube and Helm
OpenShiftのサポートを始めるぞ!高頻度で更新されるOSSを効果的にキャッチアップする仕組みを考えました!
Demo of write slides and books with VSCode + Markdown
Write slides and books in VSCode + Markdown
OpenShift from Easy way to Hard ? Way
Kubernetes The Hard Way をやってみた
Operator reading and writing ( Operator SDK 編 )
Getting Started with Graph Database with Python
AbemaTVのコメントビューアを作る話
Enjoying k8s cluster with Minikube and Helm
Ad

Traffic Management with Istio ( with Demo )