Service Meshの範囲をインクリメンタルに広げる

Service Meshの範囲をインクリメンタルに広げる手順

  1. 1つPodにのみ対してistio-proxy(Envoy)をinjectする
  2. 自動テストを流す
  3. 1でistio-proxyをinjectしたPodに対して必要最低限のVirtual ServiceとDestination Ruleを書く
  4. IstioのGatewayを経由させて自動テストを流す

1つPodにのみ対してistio-proxy(Envoy)をinjectする

$ istioctl kube-inject -f <your-app-spec>.yaml | kubectl apply -f 
$ kubectl label namespace <namespace> istio-injection=enabled
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: foo
spec:
template:
metadata:
labels:
app: foo
version: blue
annotations:
sidecar.istio.io/inject: "false"
spec:
containers:
- name: foo
image: foo

自動テストを流す

Virtual ServiceとDestination Ruleを書く

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: foo-vs
namespace: bar
spec:
gateways:
- default/default-gateway
hosts:
- foo.bar.svc.cluster.local
http:
- route:
- destination:
host: foo.bar.svc.cluster.local
subset: blue
---
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: foo-dr
namespace: bar
spec:
host: foo.bar.svc.cluster.local
subsets:
- name: blue
labels:
version: blue

IstioのGatewayを経由させて自動テストを流す

まとめ

--

--

--

Software engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Takanori Ishibashi

Takanori Ishibashi

Software engineer

More from Medium

Using Telepresence to intercept microservices on a Kubernetes cluster

The Benefits of Deploying a Service Mesh ISTIO!

What does Istio service discovery do?

Service Mesh and Microservices