Permalink
Browse files

Added Istio example

  • Loading branch information...
saturnism committed Jun 22, 2018
1 parent 1d8c9ca commit d8852f460aebf960f771931cb4f6deaccd0dd3a9
@@ -144,6 +144,37 @@ For each instance, see the logs:
$ kubectl logs -f echo-client...
```
Proxy Load Balancing with Istio
-------------------------------
[Istio](https://istio.io) is a Service Mesh that essentially deploys an Envoy proxy per microservice instance.
Istio automatically intercepts the requests and forward the request to a sidecar proxy (i.e., there is a proxy instance
running along side of every microservice instance). The proxy can automatically discover backend instances and
perform L7 load balancing. There is a lot more Istio can do - traffic routing, request retries, ciruit breaking, etc.
1. [bootstrap a Kubernetes cluster with Istio](https://istio.io/docs/setup/kubernetes/quick-start/)
1. [Enable automatic sidecar injection](https://istio.io/docs/setup/kubernetes/sidecar-injection/#automatic-sidecar-injection)
Then, deploy the example:
```
$ kubectl apply -f kubernetes/istio-lb/echo-server.yaml
$ kubectl apply -f kubernetes/istio-lb/echo-client.yaml
```
These files are essentially the same file as the `l4-lb` example. I.e., unlike other examples that require
changes to the code base, when using Istio, L7 load balancing will be automatically applied.
Find the client instances:
```
$ kubectl get pods -l run=echo-client
```
For each instance, see the logs:
```
$ kubectl logs -f echo-client...
```
Other Examples
--------------
* [Spring Boot, Eureka, and gRPC w/ Client-side Load Balancing](https://github.com/saturnism/grpc-java-by-example/tree/master/springboot-example)
@@ -0,0 +1,24 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: echo-client
name: echo-client
spec:
replicas: 2
selector:
matchLabels:
run: echo-client
template:
metadata:
labels:
run: echo-client
spec:
containers:
- name: echo-client
image: saturnism/echo-client-simple
env:
- name: ECHO_SERVICE_HOST
value: echo-server
- name: ECHO_SERVICE_PORT
value: "8080"
@@ -0,0 +1,36 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: echo-server
name: echo-server
spec:
replicas: 2
selector:
matchLabels:
run: echo-server
template:
metadata:
labels:
run: echo-server
spec:
containers:
- name: echo-server
image: saturnism/echo-server
---
apiVersion: v1
kind: Service
metadata:
labels:
run: echo-server
name: echo-server
spec:
ports:
- name: grpc
port: 8080
protocol: TCP
targetPort: 8080
selector:
run: echo-server
sessionAffinity: None
type: ClusterIP

0 comments on commit d8852f4

Please sign in to comment.