Building a scalable microservice architecture with envoy, kubernetes and istio

SAMIR BEHARA
SAMIR BEHARASystem Architect at EBSCO Industries, Inc.
Building a scalable Microservice Architecture
With Kubernetes, Envoy and Istio
SAMIR BEHARA
System Architect, EBSCO
Samir Behara builds software solutions
using cutting edge technologies.
Has a Bachelor Degree in Computer
Science with 13 years of IT experience.
Frequent Speaker at Technical
Conferences.
Author of www.dotnetvibes.com
@samirbehara
Agenda
• Monolith vs Microservices
• How to break a Monolith into Microservices
• Complexities in a Microservice Architecture
• Journey from Netflix OSS to Istio Service Mesh
• The Rise of Sidecar Design Pattern
• Istio Architecture and capabilities
• How to make your microservices resilient & fault tolerant
• Service Mesh Observability
Monolithic Architecture
Order
Management
Service
Monolithic
Database
Large Codebase
Difficult to Scale
Longer Development Cycle
Complicated Deployments
Fixed Technology stack
Performance Issues
Tight Coupling
Applying Domain Driven Design
Monolith Architecture – Centralized Database
Order Service
Title Service
Currency Service
Pricing Service
Monolithic
Shared
Database
API
Gateway
Databases are private to each Microservice
Order API Pricing API
Deploying Monolithic Applications
Strangler Pattern in action
Transform and Eliminate Pattern
TRANSFORM CO-EXIST ELIMINATE
Microservices Deployments
Emergence of Microservices
Shorter Development Cycle
Faster Deployments
Highly Scalable
Right Technology Stack
Business Domain Driven
Resiliency & Observability
High Cohesion & Loose Coupling
Immutable Infrastructure
Declarative Configuration
Horizontal Scaling
Self Healing SystemsService Discovery
Decoupled Architecture
Load Balancing
Scalable Microservices with Kubernetes
Microservice Architecture - Challenges
8 Fallacies of Distributed Computing
Fallacy Solutions
The network is reliable Automatic Retries, Message Queues
Latency is zero Caching Strategy, Bulk Requests, Deploy in AZs near client
Bandwidth is infinite Throttling Policy, Small payloads with Microservices
The network is secure Network Firewalls, Encryption, Certificates, Authentication
Topology does not change No hardcoding IP, Service Discovery Tools
There is one administrator DevOps Culture eliminates Bus Factor
Transport cost is zero Standardized protocols like JSON, Cost Calculation
The network is homogenous Circuit Breaker, Retry and Timeout Design Pattern
Complexities in a Microservice Architecture
Tracing
Service
Discovery
Dynamic
Routing
Resiliency
Load Balancing
Netflix OSS to the rescue
What are the issues with Netflix OSS?
ROUTING
CIRCUIT BREAKER
LOAD BALANCING
SERVICE DISCOVERY
TRACING
ROUTING
CIRCUIT BREAKER
LOAD BALANCING
SERVICE DISCOVERY
TRACING
INFRASTRUCTURE
SERVICE A SERVICE B
• Tightly coupled to the Java Platform
• Not a good fit for Polyglot Architecture
• Netflix Libraries needs to be embedded
inside each microservice along side Business
functionalities
• Increases overall Application Complexity
• Operational Complexity - Patching/Upgrades
Sidecar Design Pattern
Microservice A
Microservice B
Microservice C
Sidecar
Sidecar
Sidecar
Service Mesh Control Plane
Shared Libraries vs Service Mesh
Pricing
Service
Sidecar
Order
Service
Sidecar
Currency
Service
Sidecar
Customer
Service
Sidecar
Title Service
Sidecar
Control
Plane
Business Logic
+
Shared Libraries
Business Logic
+
Shared Libraries
Business Logic
+
Shared Libraries
Business Logic
+
Shared Libraries
Business Logic
+
Shared Libraries
Smart Pipes and Smart Endpoints with Service Mesh
Responsibility of network is to transfer messages
Responsibility of microservices is to handle Business Logic,
transformations, validations and process messages.
Dumb Pipes and Smart Endpoints
Envoy
• Envoy is a high performance Open Source Proxy designed for Cloud-Native Applications
• Envoy makes the network transparent to the applications
• Envoy is deployed as a Sidecar Proxy to every service
• All traffic in a Microservice architecture flows via the Envoy Proxy
Out of Process
Architecture
Service Discovery Load Balancing
Circuit Breakers Fault Injection Observability
Istio
• Platform to Connect, Secure, Control and Monitor
Services consistently.
• Open Source Service Mesh – Governed by Google & IBM
• Shifts the complexity of running a distributed
microservice architecture to the infrastructure layer
• Control Plane for service proxies like Envoy
• Platform Independent & Language agnostic
Istio Features
Traffic Management Policy Enforcement
Observability Security Telemetry
Service A Service B
Network
Service to Service Communication over Network
Service A Service B
Sidecar Deployment using Envoy Proxy
Envoy Proxy intercepts all network traffic flowing between applications
Service A Service B
Configuration Validation, Management and Distribution
Galley
Service A Service B
Sidecar Configuration and Traffic Management capabilities
Galley Pilot
Push config data
to sidecar proxies
Service A Service B
Policy Enforcement and Telemetry Collection
Galley Pilot Mixer
Policy Checks
& Telemetry
Service A Service B
Enable Secure Communication using mutual TLS
with built-in identity and credential management
Galley Pilot Mixer Citadel
Push TLS certificates
to sidecar proxies
Service A Service B
Galley Pilot Mixer Citadel
Istio Mesh Integrated Control Plane
Sidecar
Container
SERVICE A
Pod
Container
JVM
SERVICE B
Pod
Container
JVM
Sidecar
Container
Istio Data Plane with Envoy Sidecar
SERVICE A SERVICE B
Istio Architecture
PILOT CITADEL MIXER
Control Plane
Data Plane
Service Discovery
Traffic Management
Resiliency
Policy Enforcement
Telemetry
Authentication
Security
GALLEY
Configuration Validation
and Distribution
HTTP, gRPC, TCP
Security - mTLS
Pod Pod
Service A
Istio
Gateway
Service
Entry
Virtual
Service
Service B
Destination
Rule
User
Traffic
Istio Traffic Management
Traffic Routing
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service B
Pod
Pod Labels -
version: v1
env: staging
Pod Labels -
version: v2
env: prodPILOT
Traffic
Routing Rules
# Route all traffic to v1 of ServiceB
kind: VirtualService
metadata:
name: serviceB
spec:
hosts:
- serviceB
http:
- route:
- destination:
host: serviceB
subset: v1
Canary Deployment
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service B
Pod
Pod Labels -
version: v1
env: staging
Pod Labels -
version: v2
env: prod
90%
10%
PILOT
Traffic
Routing Rules
# Percentage based Traffic Split
kind: VirtualService
metadata:
name: serviceB
spec:
hosts:
- serviceB
http:
- route:
- destination:
host: serviceB
subset: v1
weight: 90
- destination:
host: serviceB
subset: v2
weight: 10
Dark Launches
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service B
Pod
Pod Labels -
version: v1
env: staging
Pod Labels -
version: v2
env: prod
100%
Mirror
Traffic
PILOT
Traffic
Routing Rules
# Traffic Mirroring
kind: VirtualService
metadata:
name: serviceB
spec:
hosts:
- serviceB
http:
- route:
- destination:
host: serviceB
subset: v1
weight: 100
mirror:
host: serviceB
subset: v2
Building a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istio
Circuit Breaker
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service C
Pod
# Limits the number of concurrent
connections and requests
kind: DestinationRule
metadata:
name: serviceC
spec:
hosts:
- serviceC
trafficPolicy:
connectionPool:
http:
http1MaxPendingRequests: 10
maxRequestsPerConnection: 1
tcp:
maxConnections: 1
Outlier Detection
# Detect faulty instances in the
pool & remove from traffic routing
kind: DestinationRule
metadata:
name: serviceB
spec:
hosts:
- serviceB
trafficPolicy:
outlierDetection:
baseEjectionTime: 20s
consecutiveErrors: 3
interval: 10s
maxEjectionPercent: 100
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service B
Pod
Pod Labels -
version: v1
env: staging
Pod Labels -
version: v2
env: staging
Timeout
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service C
Pod
# Timeout strategy for service
communication over network
kind: VirtualService
metadata:
name: serviceB
spec:
hosts:
- serviceB
http:
- route:
- destination:
host: serviceB
timeout: 10s
Timeout:
10 sec
Timeout:
10 sec
Istio Retry Policy
Envoy
Service A
Pod
Envoy
Service B
Pod
# Retry strategy for service
communication over network
kind: VirtualService
metadata:
name: serviceB
spec:
hosts:
- serviceB
http:
- route:
- destination:
host: serviceB
retries:
attempts: 3
perTryTimeout: 2s
Retry: 5
5XX Error
Chaos Testing – Inject Delays
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service B
Pod
Pod Labels -
version: v1
env: staging
Pod Labels -
version: v2
env: prod
# Create rule to delay traffic to
ServiceB v1
kind: VirtualService
metadata:
name: serviceB
spec:
hosts:
- serviceB
http:
- fault:
delay:
fixedDelay: 10s
percent: 50
route:
- destination:
host: serviceB
subset: v1
10s delay
in 50% of
requests
Chaos Testing – Inject Errors
Envoy
Service A
Pod
Envoy
Service B
Pod
Envoy
Service B
Pod
Pod Labels -
version: v1
env: staging
Pod Labels -
version: v2
env: prod
# Create rule to inject errors to
ServiceB v1
kind: VirtualService
metadata:
name: serviceB
spec:
hosts:
- serviceB
http:
- fault:
abort:
httpStatus: 500
percent: 50
route:
- destination:
host: serviceB
subset: v2
HTTP 500
in 50% of
requests
Monitoring your Microservices Architecture
The Three Pillars of Observability
LOGGING METRICS TRACING
Prometheus Architecture
Visualizing the Service Mesh with Kiali
• Service Mesh Observability & Configuration
• Visualize Service Communication in real time
• Displays Traffic Rates and Latencies
• Quickly identify problem areas
• Configure, Update & Validate Service Mesh
View the response time and request
rate of each of the microservice inside
the service mesh.
Visualization and Time Series Analytics
Create your own Dashboards for Monitoring and explore the service metrics
Visualization tools to help you understand your data better
RED Metrics for Microservices Monitoring
Rate - Number of requests per second your services are serving
Errors - Number of failed requests per second
Duration - Amount of time each request takes to fulfil a request
Distributed Tracing
Provides end to end visibility & insights into service requests
Used to troubleshoot latency issues in a Microservice Architecture
Building a scalable microservice architecture with envoy, kubernetes and istio
Resources
Istio blogs on dotnetvibes - https://dotnetvibes.com/?s=istio
Katacoda Interactive Learning Platform - https://www.katacoda.com
Introducing Istio Service Mesh for Microservices - By Burr Sutter and Christian Posta
https://developers.redhat.com/books/introducing-istio-service-mesh-microservices/
Red Hat Developer Blogs and Tutorials - https://developers.redhat.com/topics/service-mesh/
Istio Blogs - https://istio.io/blog/
O’Reilly Live Online Training - https://www.oreilly.com/live-training
Thank You
@samirbehara www.dotnetvibes.com
1 of 59

Recommended

Api service mesh and microservice tooling by
Api service mesh and microservice toolingApi service mesh and microservice tooling
Api service mesh and microservice toolingLuca Mattia Ferrari
307 views74 slides
Consul: Service Mesh for Microservices by
Consul: Service Mesh for MicroservicesConsul: Service Mesh for Microservices
Consul: Service Mesh for MicroservicesArmonDadgar
458 views78 slides
Navigating the service mesh landscape with Istio, Consul Connect, and Linkerd by
Navigating the service mesh landscape with Istio, Consul Connect, and LinkerdNavigating the service mesh landscape with Istio, Consul Connect, and Linkerd
Navigating the service mesh landscape with Istio, Consul Connect, and LinkerdChristian Posta
5K views53 slides
Open Source Networking Days- Service Mesh by
Open Source Networking Days- Service MeshOpen Source Networking Days- Service Mesh
Open Source Networking Days- Service MeshCloudOps2005
152 views39 slides
Managing microservices with Istio Service Mesh by
Managing microservices with Istio Service MeshManaging microservices with Istio Service Mesh
Managing microservices with Istio Service MeshRafik HARABI
710 views54 slides
microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud... by
microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud...microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud...
microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud...Daniel Bryant
1.2K views58 slides

More Related Content

What's hot

Things I wish someone had told me about Istio, Omer Levi Hevroni by
Things I wish someone had told me about Istio, Omer Levi HevroniThings I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi HevroniSoluto
350 views55 slides
Istio : Service Mesh by
Istio : Service MeshIstio : Service Mesh
Istio : Service MeshKnoldus Inc.
317 views23 slides
Microservices Architecture - Bangkok 2018 by
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018Araf Karsh Hamid
2.4K views80 slides
Microservices, Containers, Kubernetes, Kafka, Kanban by
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, KanbanAraf Karsh Hamid
2.6K views84 slides
Layer 7 Observability and Centralized Configuration with Consul Service Mesh by
Layer 7 Observability and Centralized Configuration with Consul Service MeshLayer 7 Observability and Centralized Configuration with Consul Service Mesh
Layer 7 Observability and Centralized Configuration with Consul Service MeshMitchell Pronschinske
1.6K views215 slides
Full lifecycle of a microservice by
Full lifecycle of a microserviceFull lifecycle of a microservice
Full lifecycle of a microserviceLuigi Bennardis
3.4K views73 slides

What's hot(20)

Things I wish someone had told me about Istio, Omer Levi Hevroni by Soluto
Things I wish someone had told me about Istio, Omer Levi HevroniThings I wish someone had told me about Istio, Omer Levi Hevroni
Things I wish someone had told me about Istio, Omer Levi Hevroni
Soluto350 views
Istio : Service Mesh by Knoldus Inc.
Istio : Service MeshIstio : Service Mesh
Istio : Service Mesh
Knoldus Inc.317 views
Microservices Architecture - Bangkok 2018 by Araf Karsh Hamid
Microservices Architecture - Bangkok 2018Microservices Architecture - Bangkok 2018
Microservices Architecture - Bangkok 2018
Araf Karsh Hamid2.4K views
Microservices, Containers, Kubernetes, Kafka, Kanban by Araf Karsh Hamid
Microservices, Containers, Kubernetes, Kafka, KanbanMicroservices, Containers, Kubernetes, Kafka, Kanban
Microservices, Containers, Kubernetes, Kafka, Kanban
Araf Karsh Hamid2.6K views
Layer 7 Observability and Centralized Configuration with Consul Service Mesh by Mitchell Pronschinske
Layer 7 Observability and Centralized Configuration with Consul Service MeshLayer 7 Observability and Centralized Configuration with Consul Service Mesh
Layer 7 Observability and Centralized Configuration with Consul Service Mesh
Full lifecycle of a microservice by Luigi Bennardis
Full lifecycle of a microserviceFull lifecycle of a microservice
Full lifecycle of a microservice
Luigi Bennardis3.4K views
Cloud native microservices for systems and applications ieee rev2 by Prem Sankar Gopannan
Cloud native microservices for systems and applications ieee rev2Cloud native microservices for systems and applications ieee rev2
Cloud native microservices for systems and applications ieee rev2
Mastering Chaos - A Netflix Guide to Microservices by Josh Evans
Mastering Chaos - A Netflix Guide to MicroservicesMastering Chaos - A Netflix Guide to Microservices
Mastering Chaos - A Netflix Guide to Microservices
Josh Evans14.8K views
Deep-dive into Microservice Outer Architecture by WSO2
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer Architecture
WSO23.5K views
Do You Need A Service Mesh? by NGINX, Inc.
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
NGINX, Inc.788 views
CI-CD Jenkins, GitHub Actions, Tekton by Araf Karsh Hamid
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
Araf Karsh Hamid1.2K views
Microservices for Enterprises by Kasun Indrasiri
Microservices for Enterprises Microservices for Enterprises
Microservices for Enterprises
Kasun Indrasiri28K views
TIBCO Latest Interview Questions with Answers by Garuda Trainings by Garuda Trainings
TIBCO Latest Interview Questions with Answers by Garuda TrainingsTIBCO Latest Interview Questions with Answers by Garuda Trainings
TIBCO Latest Interview Questions with Answers by Garuda Trainings
Garuda Trainings27.4K views
Chaos Debugging for Microservices by Christian Posta
Chaos Debugging for MicroservicesChaos Debugging for Microservices
Chaos Debugging for Microservices
Christian Posta694 views
Kubernetes Ingress to Service Mesh (and beyond!) by Christian Posta
Kubernetes Ingress to Service Mesh (and beyond!)Kubernetes Ingress to Service Mesh (and beyond!)
Kubernetes Ingress to Service Mesh (and beyond!)
Christian Posta614 views
Microservices Architecture & Testing Strategies by Araf Karsh Hamid
Microservices Architecture & Testing StrategiesMicroservices Architecture & Testing Strategies
Microservices Architecture & Testing Strategies
Araf Karsh Hamid2.8K views
The Complete Guide to Service Mesh by Aspen Mesh
The Complete Guide to Service MeshThe Complete Guide to Service Mesh
The Complete Guide to Service Mesh
Aspen Mesh435 views

Similar to Building a scalable microservice architecture with envoy, kubernetes and istio

Service mesh in action with onap by
Service mesh in action with onapService mesh in action with onap
Service mesh in action with onapHuabing Zhao
624 views21 slides
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18 by
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18CodeOps Technologies LLP
9.1K views47 slides
Introduction to Istio Service Mesh by
Introduction to Istio Service MeshIntroduction to Istio Service Mesh
Introduction to Istio Service MeshGeorgios Andrianakis
503 views41 slides
Istio presentation jhug by
Istio presentation jhugIstio presentation jhug
Istio presentation jhugGeorgios Andrianakis
357 views44 slides
Managing microservices with istio on OpenShift - Meetup by
Managing microservices with istio on OpenShift - MeetupManaging microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - MeetupJosé Román Martín Gil
1.3K views63 slides
Api observability by
Api observability Api observability
Api observability Luca Mattia Ferrari
185 views25 slides

Similar to Building a scalable microservice architecture with envoy, kubernetes and istio(20)

Service mesh in action with onap by Huabing Zhao
Service mesh in action with onapService mesh in action with onap
Service mesh in action with onap
Huabing Zhao624 views
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18 by CodeOps Technologies LLP
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18
Introduction to Istio for APIs and Microservices meetup by Daniel Ciruli
Introduction to Istio for APIs and Microservices meetupIntroduction to Istio for APIs and Microservices meetup
Introduction to Istio for APIs and Microservices meetup
Daniel Ciruli278 views
Istio Triangle Kubernetes Meetup Aug 2019 by Ram Vennam
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019
Ram Vennam206 views
ISTIO Deep Dive by Yong Feng
ISTIO Deep DiveISTIO Deep Dive
ISTIO Deep Dive
Yong Feng2.6K views
Service Mesh in Practice by Ballerina
Service Mesh in PracticeService Mesh in Practice
Service Mesh in Practice
Ballerina237 views
Consul Connect - EPAM SEC - 22nd september 2018 by Peter Souter
Consul Connect - EPAM SEC - 22nd september 2018Consul Connect - EPAM SEC - 22nd september 2018
Consul Connect - EPAM SEC - 22nd september 2018
Peter Souter366 views
Upgrading_your_microservices_to_next_level_v1.0.pdf by VladimirRadzivil
Upgrading_your_microservices_to_next_level_v1.0.pdfUpgrading_your_microservices_to_next_level_v1.0.pdf
Upgrading_your_microservices_to_next_level_v1.0.pdf
VladimirRadzivil24 views
Dev conf .in cloud native reference architecture .advance by Christina Lin
Dev conf .in cloud native reference architecture .advanceDev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advance
Christina Lin634 views
Reference architectures shows a microservices deployed to Kubernetes by Rakesh Gujjarlapudi
Reference architectures shows a microservices deployed to KubernetesReference architectures shows a microservices deployed to Kubernetes
Reference architectures shows a microservices deployed to Kubernetes
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent by Sudhir Tonse
Pros and Cons of a MicroServices Architecture talk at AWS ReInventPros and Cons of a MicroServices Architecture talk at AWS ReInvent
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
Sudhir Tonse18.7K views
Building a Service Mesh with NGINX Owen Garrett.pptx by PINGXIONG3
Building a Service Mesh with NGINX Owen Garrett.pptxBuilding a Service Mesh with NGINX Owen Garrett.pptx
Building a Service Mesh with NGINX Owen Garrett.pptx
PINGXIONG34 views

Recently uploaded

Java Platform Approach 1.0 - Picnic Meetup by
Java Platform Approach 1.0 - Picnic MeetupJava Platform Approach 1.0 - Picnic Meetup
Java Platform Approach 1.0 - Picnic MeetupRick Ossendrijver
27 views39 slides
Special_edition_innovator_2023.pdf by
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdfWillDavies22
17 views6 slides
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
257 views86 slides
Tunable Laser (1).pptx by
Tunable Laser (1).pptxTunable Laser (1).pptx
Tunable Laser (1).pptxHajira Mahmood
24 views37 slides
Transcript: The Details of Description Techniques tips and tangents on altern... by
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...BookNet Canada
135 views15 slides
6g - REPORT.pdf by
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdfLiveplex
10 views23 slides

Recently uploaded(20)

Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software257 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada135 views
6g - REPORT.pdf by Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb13 views
From chaos to control: Managing migrations and Microsoft 365 with ShareGate! by sammart93
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
From chaos to control: Managing migrations and Microsoft 365 with ShareGate!
sammart939 views
Spesifikasi Lengkap ASUS Vivobook Go 14 by Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang37 views
DALI Basics Course 2023 by Ivory Egg
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023
Ivory Egg16 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson66 views
1st parposal presentation.pptx by i238212
1st parposal presentation.pptx1st parposal presentation.pptx
1st parposal presentation.pptx
i2382129 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views

Building a scalable microservice architecture with envoy, kubernetes and istio

  • 1. Building a scalable Microservice Architecture With Kubernetes, Envoy and Istio
  • 2. SAMIR BEHARA System Architect, EBSCO Samir Behara builds software solutions using cutting edge technologies. Has a Bachelor Degree in Computer Science with 13 years of IT experience. Frequent Speaker at Technical Conferences. Author of www.dotnetvibes.com @samirbehara
  • 3. Agenda • Monolith vs Microservices • How to break a Monolith into Microservices • Complexities in a Microservice Architecture • Journey from Netflix OSS to Istio Service Mesh • The Rise of Sidecar Design Pattern • Istio Architecture and capabilities • How to make your microservices resilient & fault tolerant • Service Mesh Observability
  • 4. Monolithic Architecture Order Management Service Monolithic Database Large Codebase Difficult to Scale Longer Development Cycle Complicated Deployments Fixed Technology stack Performance Issues Tight Coupling
  • 6. Monolith Architecture – Centralized Database Order Service Title Service Currency Service Pricing Service Monolithic Shared Database API Gateway
  • 7. Databases are private to each Microservice Order API Pricing API
  • 10. Transform and Eliminate Pattern TRANSFORM CO-EXIST ELIMINATE
  • 12. Emergence of Microservices Shorter Development Cycle Faster Deployments Highly Scalable Right Technology Stack Business Domain Driven Resiliency & Observability High Cohesion & Loose Coupling
  • 13. Immutable Infrastructure Declarative Configuration Horizontal Scaling Self Healing SystemsService Discovery Decoupled Architecture Load Balancing Scalable Microservices with Kubernetes
  • 15. 8 Fallacies of Distributed Computing Fallacy Solutions The network is reliable Automatic Retries, Message Queues Latency is zero Caching Strategy, Bulk Requests, Deploy in AZs near client Bandwidth is infinite Throttling Policy, Small payloads with Microservices The network is secure Network Firewalls, Encryption, Certificates, Authentication Topology does not change No hardcoding IP, Service Discovery Tools There is one administrator DevOps Culture eliminates Bus Factor Transport cost is zero Standardized protocols like JSON, Cost Calculation The network is homogenous Circuit Breaker, Retry and Timeout Design Pattern
  • 16. Complexities in a Microservice Architecture
  • 18. What are the issues with Netflix OSS? ROUTING CIRCUIT BREAKER LOAD BALANCING SERVICE DISCOVERY TRACING ROUTING CIRCUIT BREAKER LOAD BALANCING SERVICE DISCOVERY TRACING INFRASTRUCTURE SERVICE A SERVICE B • Tightly coupled to the Java Platform • Not a good fit for Polyglot Architecture • Netflix Libraries needs to be embedded inside each microservice along side Business functionalities • Increases overall Application Complexity • Operational Complexity - Patching/Upgrades
  • 19. Sidecar Design Pattern Microservice A Microservice B Microservice C Sidecar Sidecar Sidecar Service Mesh Control Plane
  • 20. Shared Libraries vs Service Mesh Pricing Service Sidecar Order Service Sidecar Currency Service Sidecar Customer Service Sidecar Title Service Sidecar Control Plane Business Logic + Shared Libraries Business Logic + Shared Libraries Business Logic + Shared Libraries Business Logic + Shared Libraries Business Logic + Shared Libraries
  • 21. Smart Pipes and Smart Endpoints with Service Mesh Responsibility of network is to transfer messages Responsibility of microservices is to handle Business Logic, transformations, validations and process messages. Dumb Pipes and Smart Endpoints
  • 22. Envoy • Envoy is a high performance Open Source Proxy designed for Cloud-Native Applications • Envoy makes the network transparent to the applications • Envoy is deployed as a Sidecar Proxy to every service • All traffic in a Microservice architecture flows via the Envoy Proxy Out of Process Architecture Service Discovery Load Balancing Circuit Breakers Fault Injection Observability
  • 23. Istio • Platform to Connect, Secure, Control and Monitor Services consistently. • Open Source Service Mesh – Governed by Google & IBM • Shifts the complexity of running a distributed microservice architecture to the infrastructure layer • Control Plane for service proxies like Envoy • Platform Independent & Language agnostic
  • 24. Istio Features Traffic Management Policy Enforcement Observability Security Telemetry
  • 25. Service A Service B Network Service to Service Communication over Network
  • 26. Service A Service B Sidecar Deployment using Envoy Proxy Envoy Proxy intercepts all network traffic flowing between applications
  • 27. Service A Service B Configuration Validation, Management and Distribution Galley
  • 28. Service A Service B Sidecar Configuration and Traffic Management capabilities Galley Pilot Push config data to sidecar proxies
  • 29. Service A Service B Policy Enforcement and Telemetry Collection Galley Pilot Mixer Policy Checks & Telemetry
  • 30. Service A Service B Enable Secure Communication using mutual TLS with built-in identity and credential management Galley Pilot Mixer Citadel Push TLS certificates to sidecar proxies
  • 31. Service A Service B Galley Pilot Mixer Citadel Istio Mesh Integrated Control Plane
  • 33. SERVICE A SERVICE B Istio Architecture PILOT CITADEL MIXER Control Plane Data Plane Service Discovery Traffic Management Resiliency Policy Enforcement Telemetry Authentication Security GALLEY Configuration Validation and Distribution HTTP, gRPC, TCP Security - mTLS Pod Pod
  • 35. Traffic Routing Envoy Service A Pod Envoy Service B Pod Envoy Service B Pod Pod Labels - version: v1 env: staging Pod Labels - version: v2 env: prodPILOT Traffic Routing Rules # Route all traffic to v1 of ServiceB kind: VirtualService metadata: name: serviceB spec: hosts: - serviceB http: - route: - destination: host: serviceB subset: v1
  • 36. Canary Deployment Envoy Service A Pod Envoy Service B Pod Envoy Service B Pod Pod Labels - version: v1 env: staging Pod Labels - version: v2 env: prod 90% 10% PILOT Traffic Routing Rules # Percentage based Traffic Split kind: VirtualService metadata: name: serviceB spec: hosts: - serviceB http: - route: - destination: host: serviceB subset: v1 weight: 90 - destination: host: serviceB subset: v2 weight: 10
  • 37. Dark Launches Envoy Service A Pod Envoy Service B Pod Envoy Service B Pod Pod Labels - version: v1 env: staging Pod Labels - version: v2 env: prod 100% Mirror Traffic PILOT Traffic Routing Rules # Traffic Mirroring kind: VirtualService metadata: name: serviceB spec: hosts: - serviceB http: - route: - destination: host: serviceB subset: v1 weight: 100 mirror: host: serviceB subset: v2
  • 43. Circuit Breaker Envoy Service A Pod Envoy Service B Pod Envoy Service C Pod # Limits the number of concurrent connections and requests kind: DestinationRule metadata: name: serviceC spec: hosts: - serviceC trafficPolicy: connectionPool: http: http1MaxPendingRequests: 10 maxRequestsPerConnection: 1 tcp: maxConnections: 1
  • 44. Outlier Detection # Detect faulty instances in the pool & remove from traffic routing kind: DestinationRule metadata: name: serviceB spec: hosts: - serviceB trafficPolicy: outlierDetection: baseEjectionTime: 20s consecutiveErrors: 3 interval: 10s maxEjectionPercent: 100 Envoy Service A Pod Envoy Service B Pod Envoy Service B Pod Pod Labels - version: v1 env: staging Pod Labels - version: v2 env: staging
  • 45. Timeout Envoy Service A Pod Envoy Service B Pod Envoy Service C Pod # Timeout strategy for service communication over network kind: VirtualService metadata: name: serviceB spec: hosts: - serviceB http: - route: - destination: host: serviceB timeout: 10s Timeout: 10 sec Timeout: 10 sec
  • 46. Istio Retry Policy Envoy Service A Pod Envoy Service B Pod # Retry strategy for service communication over network kind: VirtualService metadata: name: serviceB spec: hosts: - serviceB http: - route: - destination: host: serviceB retries: attempts: 3 perTryTimeout: 2s Retry: 5 5XX Error
  • 47. Chaos Testing – Inject Delays Envoy Service A Pod Envoy Service B Pod Envoy Service B Pod Pod Labels - version: v1 env: staging Pod Labels - version: v2 env: prod # Create rule to delay traffic to ServiceB v1 kind: VirtualService metadata: name: serviceB spec: hosts: - serviceB http: - fault: delay: fixedDelay: 10s percent: 50 route: - destination: host: serviceB subset: v1 10s delay in 50% of requests
  • 48. Chaos Testing – Inject Errors Envoy Service A Pod Envoy Service B Pod Envoy Service B Pod Pod Labels - version: v1 env: staging Pod Labels - version: v2 env: prod # Create rule to inject errors to ServiceB v1 kind: VirtualService metadata: name: serviceB spec: hosts: - serviceB http: - fault: abort: httpStatus: 500 percent: 50 route: - destination: host: serviceB subset: v2 HTTP 500 in 50% of requests
  • 50. The Three Pillars of Observability LOGGING METRICS TRACING
  • 52. Visualizing the Service Mesh with Kiali • Service Mesh Observability & Configuration • Visualize Service Communication in real time • Displays Traffic Rates and Latencies • Quickly identify problem areas • Configure, Update & Validate Service Mesh
  • 53. View the response time and request rate of each of the microservice inside the service mesh.
  • 54. Visualization and Time Series Analytics Create your own Dashboards for Monitoring and explore the service metrics Visualization tools to help you understand your data better
  • 55. RED Metrics for Microservices Monitoring Rate - Number of requests per second your services are serving Errors - Number of failed requests per second Duration - Amount of time each request takes to fulfil a request
  • 56. Distributed Tracing Provides end to end visibility & insights into service requests Used to troubleshoot latency issues in a Microservice Architecture
  • 58. Resources Istio blogs on dotnetvibes - https://dotnetvibes.com/?s=istio Katacoda Interactive Learning Platform - https://www.katacoda.com Introducing Istio Service Mesh for Microservices - By Burr Sutter and Christian Posta https://developers.redhat.com/books/introducing-istio-service-mesh-microservices/ Red Hat Developer Blogs and Tutorials - https://developers.redhat.com/topics/service-mesh/ Istio Blogs - https://istio.io/blog/ O’Reilly Live Online Training - https://www.oreilly.com/live-training