Individual microservices are relatively easy to develop, but managing a distributed system composed of microservices is never a simple task. Kubernetes helps, but it falls short of providing everything such a system needs. This is where the Istio Service Mesh comes in.
Running microservices in production, you'll soon realize you want things like traffic splitting, automatic connection retries, timeouts and failovers, secure communication and authentication between your services, distributed metrics, tracing and logging. By introducing Istio into your architecture, you get all of that and more. And you get most of it without changing your code at all.
In this talk, you'll see a demonstration of Istio in action and learn about the tricks that make its magic possible.
2. Marko Lukša
● Software engineer at Red Hat
● 20+ years
● Currently working on:
○ Istio
○ Kubernetes
○ OpenShift
● Author of Kubernetes in Action
○ www.manning.com/books/kubernetes-in-action
○ FREE chapters 2-5: Exploring Kubernetes
■ www.manning.com/books/exploring-kubernetes
3. About you? Show of hands
● Develop Microservices?
● Heard of Istio?
● Using Istio?
● Using Kubernetes?
6. Microservices: The fairy tale
● Smaller, simpler units
● Easier to develop
● Different languages
● Re-use existing components
● Independent development cycles
● Independent release cycles
● Independent scaling
● ...
7. Microservices: The reality
*hacker icon source: https://www.freeiconspng.com/img/37219
*hourglass icon by Freepik from www.flaticon.com
*monitoring icon by Francesco Daffini from www.onlinewebfonts.com
User
v2v1
10. A service mesh is
decentralized application networking infrastructure
that connects your (micro)services
11. Istio is in-between your microservices
User
v2v1
● No libraries to import
● No* code changes required
● Completely transparent to
the application
● Sounds impossible?
14. Sidecar container pattern
sidecar noun /ˈsaɪd.kɑːr/
a small, low vehicle attached to the side of a motorcycle
for carrying passengers.
sidecar container
a container that augments and improves the main
application container, often without the main application’s
knowledge.
Pod
Service
(Your code)
Sidecar
Istio Proxy
15. Pod B
Service B
Istio Proxy
Communication through Istio Proxy
Pod A
Service A
Istio Proxy
16. Istio Control PlanePilot Mixer CitadelGalley
Istio Service Mesh architecture
Service A Service B Service C
Istio Proxy Istio Proxy Istio Proxy
HTTP/1.1
HTTP/2
gRPC
TCP
HTTP/1.1
HTTP/2
gRPC
TCP
mTLS mTLS
22. Distributed Tracing
Pod
Service A
Istio Proxy
Pod
Service B
Istio Proxy
Istio Control Plane
Pod
Service C
Istio Proxy
Pod
Service D
Istio Proxy
??
?
?
? ?
?
?
34. Encryption & authentication with Mutual TLS
Pod
Service A
Istio Proxy
Pod
Service B
Istio Proxy
mTLS
kind: DestinationRule
metadata:
name: service-b
spec:
host: service-b
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
...
35. Authorization with Istio RBAC
Service A Service B
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRole
metadata:
name: service-b-viewer
spec:
rules:
- services:
- service-b.ns.svc.cluster.local
methods:
- GET
apiVersion: "rbac.istio.io/v1alpha1"
kind: ServiceRoleBinding
metadata:
name: bind-ratings
spec:
subjects:
- user: cluster.local/ns/default/sa/service-a
roleRef:
kind: ServiceRole
name: service-b-viewer
Service C
37. Connection timeouts & retries
Pod
Service A
Istio Proxy
Pod
Service B
Istio Proxy
kind: VirtualService
metadata:
name: service-b
spec:
hosts:
- service-b
http:
- route:
- destination:
host: service-b
subset: v1
timeout: 10s
retries:
attempts: 5
perTryTimeout: 2s
Timeout: 10s
Retry: 5x
38. Rate limiting
Pod
Service A
Istio Proxy
Pod
Service B
Istio Proxy
kind: DestinationRule
metadata:
name: service-b
spec:
host: service-b
trafficPolicy:
connectionPool:
tcp:
maxConnections: 200
http:
http2MaxRequests: 500
Max 200
connections
Max 500
requests
39. Circuit breaker (Outlier detection)
Pod
Service A
Istio Proxy
Pod
Service B
Istio Proxy
kind: DestinationRule
metadata:
name: service-b
spec:
host: service-b
trafficPolicy:
...
outlierDetection:
consecutiveErrors: 3
interval: 5m
baseEjectionTime: 10m
If 3 errors in
5 minutes:
eject for 10
minutes
41. Chaos Engineering: Inserting a delay
Pod
Service A
Istio Proxy
Pod
Service B
Istio Proxy
kind: VirtualService
metadata:
name: service-b
spec:
hosts:
- service-b
http:
- route:
- destination:
host: service-b
subset: v1
fault:
delay:
percent: 50
fixedDelay: 3s
Insert 3
second
delay
in 50%
of requests
42. Chaos Engineering: Inserting a fault
Pod
Service A
Istio Proxy
Pod
Service B
Istio Proxy
kind: VirtualService
metadata:
name: service-b
spec:
hosts:
- service-b
http:
- route:
- destination:
host: service-b
subset: v1
fault:
abort:
percent: 10
httpStatus: 500
HTTP 500
in 10%
of requests
46. OpenShift Service Mesh
● Red Hat's distribution of Istio
○ Jaeger distributed tracing
○ Kiali for visualizing services
○ Prometheus for monitoring
○ Grafana for visualizing monitoring data
○ Istio operator - automatic install and management of Istio
● Maistra
○ Upstream, open-source project
○ OpenShift Service Mesh is based on Maistra
○ https://github.com/Maistra