SlideShare une entreprise Scribd logo
1  sur  59
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
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
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

Contenu connexe

Tendances

Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Ryan Jarvinen
 
Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Animesh Singh
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopBob Killen
 
Introduction to Kubernetes RBAC
Introduction to Kubernetes RBACIntroduction to Kubernetes RBAC
Introduction to Kubernetes RBACKublr
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Edureka!
 
GitOps with ArgoCD
GitOps with ArgoCDGitOps with ArgoCD
GitOps with ArgoCDCloudOps2005
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Megan O'Keefe
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Edureka!
 
Kubernetes
KubernetesKubernetes
Kuberneteserialc_w
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes IntroductionPeng Xiao
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsWeaveworks
 

Tendances (20)

Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!Microservices, Kubernetes and Istio - A Great Fit!
Microservices, Kubernetes and Istio - A Great Fit!
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Ingress overview
Ingress overviewIngress overview
Ingress overview
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Introduction to Kubernetes RBAC
Introduction to Kubernetes RBACIntroduction to Kubernetes RBAC
Introduction to Kubernetes RBAC
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
 
GitOps with ArgoCD
GitOps with ArgoCDGitOps with ArgoCD
GitOps with ArgoCD
 
Istio a service mesh
Istio   a service meshIstio   a service mesh
Istio a service mesh
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
Kubernetes Networking | Kubernetes Services, Pods & Ingress Networks | Kubern...
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
CI/CD with Github Actions
CI/CD with Github ActionsCI/CD with Github Actions
CI/CD with Github Actions
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
 

Similaire à Building a scalable microservice architecture with envoy, kubernetes and istio

Service mesh in action with onap
Service mesh in action with onapService mesh in action with onap
Service mesh in action with onapHuabing Zhao
 
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18
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
 
Api service mesh and microservice tooling
Api service mesh and microservice toolingApi service mesh and microservice tooling
Api service mesh and microservice toolingRed Hat
 
Introduction to Istio Service Mesh
Introduction to Istio Service MeshIntroduction to Istio Service Mesh
Introduction to Istio Service MeshGeorgios Andrianakis
 
Managing microservices with Istio Service Mesh
Managing microservices with Istio Service MeshManaging microservices with Istio Service Mesh
Managing microservices with Istio Service MeshRafik HARABI
 
Managing microservices with istio on OpenShift - Meetup
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
 
Api observability
Api observability Api observability
Api observability Red Hat
 
Introduction to Istio for APIs and Microservices meetup
Introduction to Istio for APIs and Microservices meetupIntroduction to Istio for APIs and Microservices meetup
Introduction to Istio for APIs and Microservices meetupDaniel Ciruli
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Ram Vennam
 
ISTIO Deep Dive
ISTIO Deep DiveISTIO Deep Dive
ISTIO Deep DiveYong Feng
 
Service Mesh in Practice
Service Mesh in PracticeService Mesh in Practice
Service Mesh in PracticeBallerina
 
Consul Connect - EPAM SEC - 22nd september 2018
Consul Connect - EPAM SEC - 22nd september 2018Consul Connect - EPAM SEC - 22nd september 2018
Consul Connect - EPAM SEC - 22nd september 2018Peter Souter
 
Upgrading_your_microservices_to_next_level_v1.0.pdf
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.pdfVladimirRadzivil
 
Dev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advanceDev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advanceChristina Lin
 
Reference architectures shows a microservices deployed to Kubernetes
Reference architectures shows a microservices deployed to KubernetesReference architectures shows a microservices deployed to Kubernetes
Reference architectures shows a microservices deployed to KubernetesRakesh Gujjarlapudi
 
Pros and Cons of a MicroServices Architecture talk at AWS ReInvent
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 ReInventSudhir Tonse
 

Similaire à Building a scalable microservice architecture with envoy, kubernetes and istio (20)

Service mesh in action with onap
Service mesh in action with onapService mesh in action with onap
Service mesh in action with onap
 
Make Java Microservices Resilient with Istio - Mangesh - IBM - CC18
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
 
Api service mesh and microservice tooling
Api service mesh and microservice toolingApi service mesh and microservice tooling
Api service mesh and microservice tooling
 
Introduction to Istio Service Mesh
Introduction to Istio Service MeshIntroduction to Istio Service Mesh
Introduction to Istio Service Mesh
 
Istio presentation jhug
Istio presentation jhugIstio presentation jhug
Istio presentation jhug
 
Managing microservices with Istio Service Mesh
Managing microservices with Istio Service MeshManaging microservices with Istio Service Mesh
Managing microservices with Istio Service Mesh
 
Managing microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - MeetupManaging microservices with istio on OpenShift - Meetup
Managing microservices with istio on OpenShift - Meetup
 
Api observability
Api observability Api observability
Api observability
 
Introduction to Istio for APIs and Microservices meetup
Introduction to Istio for APIs and Microservices meetupIntroduction to Istio for APIs and Microservices meetup
Introduction to Istio for APIs and Microservices meetup
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019
 
ISTIO Deep Dive
ISTIO Deep DiveISTIO Deep Dive
ISTIO Deep Dive
 
Service Mesh in Practice
Service Mesh in PracticeService Mesh in Practice
Service Mesh in Practice
 
Consul Connect - EPAM SEC - 22nd september 2018
Consul Connect - EPAM SEC - 22nd september 2018Consul Connect - EPAM SEC - 22nd september 2018
Consul Connect - EPAM SEC - 22nd september 2018
 
Designing microservices
Designing microservicesDesigning microservices
Designing microservices
 
Upgrading_your_microservices_to_next_level_v1.0.pdf
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
 
Dev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advanceDev conf .in cloud native reference architecture .advance
Dev conf .in cloud native reference architecture .advance
 
Reference architectures shows a microservices deployed to Kubernetes
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
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
 
Microservice Powered Orchestration
Microservice Powered OrchestrationMicroservice Powered Orchestration
Microservice Powered Orchestration
 
Cics Connectivity
Cics ConnectivityCics Connectivity
Cics Connectivity
 

Dernier

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

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
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 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
  • 57.
  • 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