You are on page 1of 97

Istio on Kubernetes: Enter the

Service Mesh
benevides@redhat.com

@rafabene

Link http://bit.ly/istio-kubernetes
@rafabene 1
Rafael Benevides
Director of Developer Experience at Red Hat
benevides@redhat.com
@rafabene

Java Certifications:
SCJA / SCJP / SCWCD / SCBCD / SCEA
JBoss Certifications:
JBCD / JBCAA
Red Hat Certifications:
OpenShift / Containers / Ansible
Other Certifications:
SAP Netweaver / ITIL / IBM Software Quality
@rafabene - http://bit.ly/istio-kubernetes
bit.ly/mono2microdb

@rafabene - http://bit.ly/istio-kubernetes
bit.ly/istio-book

@rafabene - http://bit.ly/istio-kubernetes
http://bit.ly/javamsabook

@rafabene
https://quarkus.io/
Your Journey to Awesomeness

Self-Service, Automation CI & CD Advanced Microservices


Re-Org to
On-Demand, Deployment Deployment
DevOps
Elastic Pipeline Techniques
Infrastructure

@rafabene - http://bit.ly/istio-kubernetes
Monolith

MyApp

@rafabene - http://bit.ly/istio-kubernetes
Modules

@rafabene - http://bit.ly/istio-kubernetes
Microservices

@rafabene - http://bit.ly/istio-kubernetes
Microservices

@rafabene - http://bit.ly/istio-kubernetes
Microservices

@rafabene - http://bit.ly/istio-kubernetes
Microservices

@rafabene - http://bit.ly/istio-kubernetes
Microservices

@rafabene - http://bit.ly/istio-kubernetes
Network of Services - Mesh

@rafabene - http://bit.ly/istio-kubernetes
Microservices own their Data

@rafabene - http://bit.ly/istio-kubernetes
Multiple Points of Entry

@rafabene - http://bit.ly/istio-kubernetes
Multiple Pipelines

@rafabene - http://bit.ly/istio-kubernetes
Microservices Principles
1. Deployment Independence - updates to an individual microservice have no negative
impact to any other component of the system. Optimized for Replacement
2. Organized around business capabilities
3. Products not Projects
4. API Focused
5. Smart endpoints and dumb pipes
6. Decentralized Governance
7. Decentralized Data Management
8. Infrastructure Automation (infrastructure as code)
9. Design for failure 2 Pizza Team
10. Evolutionary Design

@rafabene - http://bit.ly/istio-kubernetes
Old School New School

Love Thy Mono

@rafabene - http://bit.ly/istio-kubernetes
Microservices == Distributed Computing

OS OS
JVM JVM

Service A Service C

OS
JVM

Service B

@rafabene - http://bit.ly/istio-kubernetes
Fallacies of Distributed Computing

• The Network is Reliable


• Latency is zero
• Bandwidth is infinite
• Topology does not change
• There is one administrator
• Transport cost is zero
• The network is homogeneous
https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing

@rafabene - http://bit.ly/istio-kubernetes
Failure of a Service

@rafabene - http://bit.ly/istio-kubernetes
Cascading Failure

X X
X X
X X
X

@rafabene - http://bit.ly/istio-kubernetes
Microservices embedding Capabilities

Container Container
JVM JVM
Service A Service C
Discovery Discovery
Load-balancer Load-balancer
Resiliency Resiliency
Metrics Metrics
Tracing Tracing
Container
JVM
Service B
Discovery
Load-balancer
Resiliency
Metrics
Tracing

@rafabene - http://bit.ly/istio-kubernetes
History of Microservices

AWS EC2 Java EE6 DropWizard Hystrix Eureka Spring Boot Kubernetes
2006 2009 May 2011 March 2012 July 2012 Sept 2013 June 2014 2
0
1
Continuous Agile DevOps NETFLIX Vert.x Ribbon Microservices Docker Microservices 5
Integration Manifesto 2009 to AWS June March Assess March Defined
via XP Feb 2010 2011 2012 Thoughtworks 2013 Thoughtworks
1999 2001 Radar Fowler, Lewis
March 2012 March 2014

@rafabene - http://bit.ly/istio-kubernetes
The Cloud is Born

AWS EC2 Java EE6 DropWizard Hystrix Eureka Spring Boot Kubernetes
2006 2009 May 2011 March 2012 July 2012 Sept 2013 June 2014 2
0
1
Continuous Agile DevOps NETFLIX Vert.x Ribbon Microservices Docker Microservices 5
Integration Manifesto 2009 to AWS June March Assess March Defined
via XP Feb 2010 2011 2012 Thoughtworks 2013 Thoughtworks
1999 2001 Radar Fowler, Lewis
March 2012 March 2014

@rafabene - http://bit.ly/istio-kubernetes
Fat Jars

AWS EC2 Java EE6 DropWizard Hystrix Eureka Spring Boot Kubernetes
2006 2009 May 2011 March 2012 July 2012 Sept 2013 June 2014 2
0
1
Continuous Agile DevOps NETFLIX Vert.x Ribbon Microservices Docker Microservices 5
Integration Manifesto 2009 to AWS June March Assess March Defined
via XP Feb 2010 2011 2012 Thoughtworks 2013 Thoughtworks
1999 2001 Radar Fowler, Lewis
March 2012 March 2014

@rafabene - http://bit.ly/istio-kubernetes
Netflix goes Open Source

AWS EC2 Java EE6 DropWizard Hystrix Eureka Spring Boot Kubernetes
2006 2009 May 2011 March 2012 July 2012 Sept 2013 June 2014 2
0
1
Continuous Agile DevOps NETFLIX Vert.x Ribbon Microservices Docker Microservices 5
Integration Manifesto 2009 to AWS June March Assess March Defined
via XP Feb 2010 2011 2012 Thoughtworks 2013 Thoughtworks
1999 2001 Radar Fowler, Lewis
March 2012 March 2014

@rafabene - http://bit.ly/istio-kubernetes
Perfect Storm for Microservices

AWS EC2 Java EE6 DropWizard Hystrix Eureka Spring Boot Kubernetes
2006 2009 May 2011 March 2012 July 2012 Sept 2013 June 2014 2
0
1
Continuous Agile DevOps NETFLIX Vert.x Ribbon Microservices Docker Microservices 5
Integration Manifesto 2009 to AWS June March Assess March Defined
via XP Feb 2010 2011 2012 Thoughtworks 2013 Thoughtworks
1999 2001 Radar Fowler, Lewis
March 2012 March 2014

@rafabene - http://bit.ly/istio-kubernetes
What's Wrong with Netflix OSS?

Java Only

Adds a lot of libraries to YOUR code

@rafabene - http://bit.ly/istio-kubernetes
Microservices'ilities
API

Tracing Discovery

Monitoring Invocation

MyService

Logging Elasticity

Authentication Resilience

Pipeline

@rafabene - http://bit.ly/istio-kubernetes
@rafabene - http://bit.ly/istio-kubernetes
Microservices'ilities + Kubernetes
API

Tracing Discovery

Monitoring Invocation

MyService

Logging Elasticity

Authentication Resilience

Pipeline

@rafabene - http://bit.ly/istio-kubernetes
Microservices'ilities + OpenShift
API

Tracing Discovery

Monitoring Invocation

MyService

Logging Elasticity

Authentication Resilience

Pipeline

@rafabene - http://bit.ly/istio-kubernetes
Istio - Sail
(Kubernetes - Helmsman or ship’s pilot)

@rafabene - http://bit.ly/istio-kubernetes
Service Mesh Defined

A service mesh is a dedicated infrastructure layer for handling service-to-service


communication. It’s responsible for the reliable delivery of requests through the
complex topology of services that comprise a modern, cloud native application. In
practice, the service mesh is typically implemented as an array of lightweight
network proxies that are deployed alongside application code, without the
application needing to be aware
https://buoyant.io/2017/04/25/whats-a-service-mesh-and-why-do-i-need-one/

@rafabene - http://bit.ly/istio-kubernetes
Microservices'ilities + Istio
API

Tracing Discovery

Monitoring Invocation

MyService

Logging Elasticity

Authentication Resilience

Pipeline

@rafabene - http://bit.ly/istio-kubernetes
Microservices embedding Capabilities

Container Container
JVM JVM
Service A
Discovery Before Istio Service C
Discovery
Load-balancer Load-balancer
Resiliency Resiliency
Metrics Metrics
Tracing Tracing
Container
JVM
Service B
Discovery
Load-balancer
Resiliency
Metrics
Tracing

@rafabene - http://bit.ly/istio-kubernetes
Microservices externalizing Capabilities

Pod Pod
Container Container
JVM JVM
Service A
After Istio Service C

Sidecar Container Sidecar Container

Pod
Container
JVM
Service B

Sidecar Container

@rafabene - http://bit.ly/istio-kubernetes
Microservices externalizing Capabilities

Pod Pod
Container Container
JVM JVM
Service A
After Istio
The sidecar intercepts all network traffic
Service C

Sidecar Container Sidecar Container

Pod
Sidecar Container

Container
JVM
Service B

@rafabene - http://bit.ly/istio-kubernetes
Envoy is the current sidecar

Pod Pod
Container Container
JVM JVM
Service A Service C

Sidecar Container Sidecar Container

Pod
Sidecar Container

Container
JVM
Service B

@rafabene - http://bit.ly/istio-kubernetes
Sidecar

https://www.imz-ural.com/blog/waffles-the-sidecar-dog

@rafabene - http://bit.ly/istio-kubernetes
Next Generation Microservices - Service Mesh

Code Independent (Polyglot)


• Intelligent Routing and Load-Balancing
• A/B Tests
• Smarter Canary Releases
• Chaos: Fault Injection
• Resilience: Circuit Breakers
• Observability: Metrics and Tracing
• Fleet wide policy enforcement

@rafabene - http://bit.ly/istio-kubernetes
Istio Data Plane vs Control Plane

Data Pod Pod Pod


Plane Container Container Container
JVM JVM JVM

HTTP1.1, HTTP2, Service A HTTP1.1, HTTP2, Service B HTTP1.1, HTTP2, Service C


gRPC, TCP w/TLS gRPC, TCP w/TLS gRPC, TCP w/TLS

Envoy Sidecar Envoy Sidecar Envoy Sidecar

Control
Plane Istio Pilot Istio Mixer Istio Galey Istio Citadel

istioctl, API, config Quota, Telemetry Validation mTLS, SPIFFE


Rate Limiting, ACL

@rafabene - http://bit.ly/istio-kubernetes
Polyglot Microservices Platform circa 2019

Config Server Jaeger Istio

NETFLIX Ribbon

@rafabene - http://bit.ly/istio-kubernetes
Observability

@rafabene - http://bit.ly/istio-kubernetes
@rafabene - http://bit.ly/istio-kubernetes
Kiali.io
New Service Graph

@rafabene - http://bit.ly/istio-kubernetes
@rafabene - http://bit.ly/istio-kubernetes
Prometheus

@rafabene - http://bit.ly/istio-kubernetes
How to add an Istio-Proxy (sidecar)?

istioctl kube-inject -f NormalDeployment.yaml


OR
kubectl label namespace myspace istio-
injection=enabled
To "see" the sidecar:
kubectl describe deployment customer

@rafabene - http://bit.ly/istio-kubernetes
Traffic Control

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green
Deployment

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

BUILD
SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

BUILD
SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

BUILD
SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

BUILD
SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

SCM BUILD

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

SCM
x

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Blue/Green Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Demo Blue/Green

- Only Recommendation-v2
- Only Recommendation-v1
- Both (Delete Rule)

@rafabene - http://bit.ly/istio-kubernetes
Canary
Deployment

@rafabene - http://bit.ly/istio-kubernetes
@rafabene - http://bit.ly/istio-kubernetes
Canary Resuscitator

http://www.openculture.com/2018/05/the-device-invented-to-resuscitate-canaries-in-coal-mines-circa-1896.html
Thanks to Paolo Antinori!
@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canary Deployment

SCM

DEVELOPMENT QA STAGING PRODUCTION ROUTER USERS

@rafabene - http://bit.ly/istio-kubernetes
Canaries with Kubernetes

Pod
Container
JVM
50%
Service A
v1

Route/
Service
Ingress Pod
Container
JVM

Service A 50%
v2

@rafabene - http://bit.ly/istio-kubernetes
Canaries with Istio

Pod
Container
JVM
90%
Service A
v1

Route/
Service
Ingress Pod
Container
JVM

Service A 10%
v2

@rafabene - http://bit.ly/istio-kubernetes
Demo Canary

- 90/10
- 75/25
- Based on User-Agent

@rafabene - http://bit.ly/istio-kubernetes
Dark
Launch

@rafabene - http://bit.ly/istio-kubernetes
Dark Launches with Istio
Pod
Container
JVM
100%
Service A
v1

Mirror
requests
Route/
Service
Ingress
Pod
Container
JVM

Service A 100%
v2

@rafabene
Demo Dark
Launch

@rafabene - http://bit.ly/istio-kubernetes
Service Resiliency
• Retry
• Kiali

X X
X X
X X
X

@rafabene - http://bit.ly/istio-kubernetes
Chaos Testing

@rafabene - http://bit.ly/istio-kubernetes
By Netflix - https://github.com/Netflix/SimianArmy/blob/master/assets/SimianArmy.png, Apache License 2.0,
https://commons.wikimedia.org/w/index.php?curid=63503083
@rafabene - http://bit.ly/istio-kubernetes
Demo Caos

- 503
- Delay

@rafabene - http://bit.ly/istio-kubernetes
Access Control

Pod Pod Pod

Customer Preference Recommendation

istio-proxy ✓ istio-proxy ✓ istio-proxy

@rafabene - http://bit.ly/istio-kubernetes
Most Communication Inbound & Internal

@rafabene - http://bit.ly/istio-kubernetes
Outbound/Egress Blocked By Default


@rafabene - http://bit.ly/istio-kubernetes
Demo Egress

- Access http://worldclockapi.com

@rafabene - http://bit.ly/istio-kubernetes
bit.ly/istio-book

@rafabene - http://bit.ly/istio-kubernetes
https://learn.openshift.com/servicemesh

@rafabene - http://bit.ly/istio-kubernetes
Demo
bit.ly/istio-tutorial
@rafabene - http://bit.ly/istio-kubernetes
The End
(but Serverless is coming)

@rafabene - http://bit.ly/istio-kubernetes
@RAFABENE

@rafabene

You might also like