Kubernetes sidecar pattern as a swiss-army knife for microservices.pptx

Abhishek Tiwari
Abhishek TiwariSenior Software Development Manager at Amazon
@abhishektiwari
Kubernetes sidecar
pattern as a swiss-army
knife for microservices
Abhishek Tiwari
https://www.abhishek-tiwari.com
@abhishektiwari
A bit about me
● Director of Engineering at HelloFresh
● An early adopter of K8S ~ Dec 2015
● Ran large K8s clusters in AWS and GCP
● A range of mission critical stateles workloads
@abhishektiwari
scaling microservices require excellence in devops
Amazon Twitter
@abhishektiwari
J-CURVE OF DevOPs Excellence
Credits: Accelerate: State of DevOps 2018: Strategies for a New Economy | Does DevOps Matter?
7% Elite
@abhishektiwari
Common DevOps Concerns
A
B
C
Service-to-service
communication
A
B
C
Securing services and
communication
A
B
C
Control and enforce
policies
@abhishektiwari
Common DevOps Concerns
A
B
C
Service observability
and telemetry
A
B
C
Fault tolerance and
circuit breakers
A
B
C
Deployments and
service topologies
@abhishektiwari
Old Approach
fault tolerance libraries
Implementation specific to
- Languages (Java/Scala) or
- Frameworks or
- Server (Tomcat/Jetty)or
- Protocols (Thrift/RPC)
@abhishektiwari
Kubernetes
Kubernetes has now become the de facto standard
for deploying containerized applications at scale
in private, public and hybrid cloud.
@abhishektiwari
High-level architecture
Kubernetes
Master
Node Node Node
Pod Pod
Pod Pod
Pod
Pod
Pod
Pod
Pod
Pod
Pod Pod
Pods are scheduled and packed dynamically on Kubernetes nodes
Docker Kubelet Kube Proxy Docker Kubelet Kube Proxy Docker Kubelet Kube Proxy
@abhishektiwari
PODS
A pod can co-schedule multiple containers as an atomic unit.
MySQL
Django
Nginx
MySQL
Django
Nginx
Co-scheduled multiple
containers as pod
Scheduled independently as
containers
@abhishektiwari
Design patterns for
container-based
distributed systems
@abhishektiwari
Design patterns for
container-based
distributed systems
3 Essential
Patterns
● Single-pod single-container patterns
● Single-pod multiple-container patterns
● multi-pod patterns
@abhishektiwari
MySQL
Django
Nginx
MySQL
Django
Nginx
Single-pod, multiple-
containers pattern
Single-pod, single-
container pattern
PODS
MySQL
Django
Nginx
1 2
3
Combination of 1 & 2
@abhishektiwari
MySQL
3
Combination of 1 & 2
Django
Nginx
Django
Nginx
Stateless Autoscaling of PODS
Django
Nginx
@abhishektiwari
Main container
Sidecar container
Sidecar pattern
A sidecar is a utility container
in the Pod and its whole purpose
is to support the main container
Fluentd
Python App
error.log
@abhishektiwari
● Independent resource
● Completely reusable
● Graceful degradation
● Seperate life cycle
● Runtime injection
● Multiple per main
● Peripheral tasks
Benefits of
Sidecar
@abhishektiwari
Envoy Linkerd
Sidecar proxy (aka data plane)
traefik
Intelligent service proxy which mediate
and/or control all network communication
Nginx
HAProxy
@abhishektiwari
Nginx Sidecar proxy
MySQL
Django
Nginx
Sidecar Nginx proxy mediates
all traffic to and from main
Django container
Python App
@abhishektiwari
Service to service communication
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Envoy.yaml: Routing
virtual_hosts:
- name: backend
domains:
- "*"
routes:
- match:
prefix: "/service/a"
route:
cluster: service_a
- match:
prefix: "/service/b"
route:
cluster: service_b
- match:
prefix: "/service/c"
route:
cluster: service_c
@abhishektiwari
Service to service communication
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Envoy.yaml: Load Balancing
clusters:
- name: service_a
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
http2_protocol_options: {}
hosts:
- socket_address:
address: service_a
port_value: 443
- name: service_b
connect_timeout: 0.25s
type: strict_dns
lb_policy: round_robin
http2_protocol_options: {}
hosts:
- socket_address:
address: service_b
port_value: 443
@abhishektiwari
Securing services and communication
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Envoy.yaml: JWT Authentication
providers:
jwt_provider1:
issuer: https://auth0.com
audiences:
audience1
local_jwks:
inline_string: PUBLIC-KEY
rules:
- match:
prefix: /health
- match:
prefix: /api
requires:
provider_and_audiences:
provider_name: jwt_provider1
audiences:
api_audience
- match:
prefix: /
requires:
provider_name: jwt_provider1
@abhishektiwari
Fault tolerance and circuit breakers
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Envoy.yaml: Circuit Breakers
circuit_breakers:
thresholds:
max_connections: 1
max_pending_requests: 1
max_requests: 1
@abhishektiwari
Fault tolerance and circuit breakers
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Envoy.yaml: Retry/Timeout
retry_policy:
retry_on: 5xx
num_retries: 3
per_try_timeout: 5s
@abhishektiwari
Fault tolerance and circuit breakers
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Envoy.yaml: Fault/Delay
http_filters:
- name: envoy.fault
config:
delay:
type: fixed
fixed_delay: 10s
percentage:
numerator: 50
denominator: HUNDRED
@abhishektiwari
Service observability and telemetry
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Envoy.yaml: Zipkin Tracing
tracing:
http:
name: zipkin
typed_config:
type: zipkin
collector_cluster: zipkin
collector_endpoint: "/zipc"
@abhishektiwari
Configuration hell
Static
configs
Envoy
Envoy
Envoy
@abhishektiwari
We need a control plane
Control Plane
Manages and configures the proxies, enforce policies and collect telemetry
Service-A
Envoy
Service-B
Envoy
Service-C
Envoy
Data Plane
@abhishektiwari
Control plane + Data Plane = Service mesh
@abhishektiwari
Lastly
What microservices are part of my
service mesh and how are
they connected?
@abhishektiwari
THanks
Q&A
1 of 30

Recommended

[DW Webinar] Effective Management of APIs and the Edge when Adopting Kubernetes by
[DW Webinar] Effective Management of APIs and the Edge when Adopting Kubernetes[DW Webinar] Effective Management of APIs and the Edge when Adopting Kubernetes
[DW Webinar] Effective Management of APIs and the Edge when Adopting KubernetesDaniel Bryant
232 views28 slides
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes by
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes
Webinar: Effective Management of APIs and the Edge when Adopting Kubernetes Ambassador Labs
132 views29 slides
Openshift serverless Solution by
Openshift serverless SolutionOpenshift serverless Solution
Openshift serverless SolutionRyan ZhangCheng
124 views46 slides
All About Microservices and OpenSource Microservice Frameworks by
All About Microservices and OpenSource Microservice FrameworksAll About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksMohammad Asif Siddiqui
331 views62 slides
Developing reliable applications with .net core and AKS by
Developing reliable applications with .net core and AKSDeveloping reliable applications with .net core and AKS
Developing reliable applications with .net core and AKSAlessandro Melchiori
271 views32 slides
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz) by
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)QAware GmbH
501 views121 slides

More Related Content

Similar to Kubernetes sidecar pattern as a swiss-army knife for microservices.pptx

[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais by
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex GervaisAmbassador Labs
292 views40 slides
Jakarta Tech Talk: How to develop your first cloud-native Application with Java by
Jakarta Tech Talk: How to develop your first cloud-native Application with JavaJakarta Tech Talk: How to develop your first cloud-native Application with Java
Jakarta Tech Talk: How to develop your first cloud-native Application with JavaNiklas Heidloff
793 views59 slides
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways" by
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"Daniel Bryant
13 views22 slides
Introduction to kubernetes by
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesGabriel Carro
228 views182 slides
TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana... by
TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana...TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana...
TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana...CA Technologies
1K views20 slides
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu... by
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...Shift Conference
104 views36 slides

Similar to Kubernetes sidecar pattern as a swiss-army knife for microservices.pptx(20)

[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais by Ambassador Labs
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
[Confoo Montreal 2020] Build Your Own Serverless with Knative - Alex Gervais
Ambassador Labs292 views
Jakarta Tech Talk: How to develop your first cloud-native Application with Java by Niklas Heidloff
Jakarta Tech Talk: How to develop your first cloud-native Application with JavaJakarta Tech Talk: How to develop your first cloud-native Application with Java
Jakarta Tech Talk: How to develop your first cloud-native Application with Java
Niklas Heidloff793 views
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways" by Daniel Bryant
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
PlatformCon 23: "The Busy Platform Engineers Guide to API Gateways"
Daniel Bryant13 views
Introduction to kubernetes by Gabriel Carro
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Gabriel Carro228 views
TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana... by CA Technologies
TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana...TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana...
TechTalk: Extend Existing Architectures to Digital Endpoints with CA API Mana...
CA Technologies1K views
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu... by Shift Conference
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
Designing API: REST | gRPC | GraphQL, which one should you pick? - Cedrick Lu...
Shift Conference104 views
PortoTechHub - Hail Hydrate! From Stream to Lake with Apache Pulsar and Friends by Timothy Spann
PortoTechHub  - Hail Hydrate! From Stream to Lake with Apache Pulsar and FriendsPortoTechHub  - Hail Hydrate! From Stream to Lake with Apache Pulsar and Friends
PortoTechHub - Hail Hydrate! From Stream to Lake with Apache Pulsar and Friends
Timothy Spann986 views
Intro to GitOps with Weave GitOps, Flagger and Linkerd by Weaveworks
Intro to GitOps with Weave GitOps, Flagger and LinkerdIntro to GitOps with Weave GitOps, Flagger and Linkerd
Intro to GitOps with Weave GitOps, Flagger and Linkerd
Weaveworks85 views
GlueCon 2018: Are REST APIs Still Relevant Today? by LaunchAny
GlueCon 2018: Are REST APIs Still Relevant Today?GlueCon 2018: Are REST APIs Still Relevant Today?
GlueCon 2018: Are REST APIs Still Relevant Today?
LaunchAny1.9K views
Resilient Microservices with Spring Cloud by VMware Tanzu
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring Cloud
VMware Tanzu1.6K views
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop by Apigee | Google Cloud
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations WorkshopI Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
DevOpsCon 2020: The Past, Present, and Future of Cloud Native API Gateways by Daniel Bryant
DevOpsCon 2020: The Past, Present, and Future of Cloud Native API GatewaysDevOpsCon 2020: The Past, Present, and Future of Cloud Native API Gateways
DevOpsCon 2020: The Past, Present, and Future of Cloud Native API Gateways
Daniel Bryant259 views
End to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage by Animesh Singh
End to end Machine Learning using Kubeflow - Build, Train, Deploy and ManageEnd to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage
End to end Machine Learning using Kubeflow - Build, Train, Deploy and Manage
Animesh Singh1.9K views
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
SpringOne Platform 2018 Recap in 5 minutes by Rohit Kelapure
SpringOne Platform 2018 Recap in 5 minutesSpringOne Platform 2018 Recap in 5 minutes
SpringOne Platform 2018 Recap in 5 minutes
Rohit Kelapure165 views
Building a scalable microservice architecture with envoy, kubernetes and istio by SAMIR BEHARA
Building a scalable microservice architecture with envoy, kubernetes and istioBuilding a scalable microservice architecture with envoy, kubernetes and istio
Building a scalable microservice architecture with envoy, kubernetes and istio
SAMIR BEHARA1.1K views
Microservices with Spring Cloud and Netflix OSS by Denis Danov
Microservices with Spring Cloud and Netflix OSSMicroservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Denis Danov2.1K views
AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways" by Daniel Bryant
AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways"AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways"
AllTheTalks 2020: "The Past, Present, and Future of Cloud Native API Gateways"
Daniel Bryant560 views

Recently uploaded

Tridens DevOps by
Tridens DevOpsTridens DevOps
Tridens DevOpsTridens
9 views28 slides
Advanced API Mocking Techniques by
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking TechniquesDimpy Adhikary
19 views11 slides
Roadmap y Novedades de producto by
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de productoNeo4j
50 views33 slides
Unleash The Monkeys by
Unleash The MonkeysUnleash The Monkeys
Unleash The MonkeysJacob Duijzer
7 views28 slides
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove... by
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...Deltares
17 views17 slides
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... by
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...Deltares
9 views24 slides

Recently uploaded(20)

Tridens DevOps by Tridens
Tridens DevOpsTridens DevOps
Tridens DevOps
Tridens9 views
Advanced API Mocking Techniques by Dimpy Adhikary
Advanced API Mocking TechniquesAdvanced API Mocking Techniques
Advanced API Mocking Techniques
Dimpy Adhikary19 views
Roadmap y Novedades de producto by Neo4j
Roadmap y Novedades de productoRoadmap y Novedades de producto
Roadmap y Novedades de producto
Neo4j50 views
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove... by Deltares
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
DSD-INT 2023 HydroMT model building and river-coast coupling in Python - Bove...
Deltares17 views
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J... by Deltares
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
DSD-INT 2023 3D hydrodynamic modelling of microplastic transport in lakes - J...
Deltares9 views
Neo4j y GenAI by Neo4j
Neo4j y GenAI Neo4j y GenAI
Neo4j y GenAI
Neo4j42 views
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge... by Deltares
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
DSD-INT 2023 Delft3D FM Suite 2024.01 2D3D - New features + Improvements - Ge...
Deltares16 views
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit... by Deltares
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
DSD-INT 2023 FloodAdapt - A decision-support tool for compound flood risk mit...
Deltares13 views
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko... by Deltares
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
DSD-INT 2023 Simulation of Coastal Hydrodynamics and Water Quality in Hong Ko...
Deltares11 views
Software testing company in India.pptx by SakshiPatel82
Software testing company in India.pptxSoftware testing company in India.pptx
Software testing company in India.pptx
SakshiPatel827 views
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... by Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri711 views
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ... by Deltares
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
DSD-INT 2023 Wave-Current Interaction at Montrose Tidal Inlet System and Its ...
Deltares9 views
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)... by Deltares
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
DSD-INT 2023 Modelling litter in the Yarra and Maribyrnong Rivers (Australia)...
Deltares9 views
Citi TechTalk Session 2: Kafka Deep Dive by confluent
Citi TechTalk Session 2: Kafka Deep DiveCiti TechTalk Session 2: Kafka Deep Dive
Citi TechTalk Session 2: Kafka Deep Dive
confluent17 views
A first look at MariaDB 11.x features and ideas on how to use them by Federico Razzoli
A first look at MariaDB 11.x features and ideas on how to use themA first look at MariaDB 11.x features and ideas on how to use them
A first look at MariaDB 11.x features and ideas on how to use them
Federico Razzoli45 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 views

Kubernetes sidecar pattern as a swiss-army knife for microservices.pptx

Editor's Notes

  1. How many of you are developing microservices as part of your tech footprint? How many of you have more than 20 microservices in your tech ecosystem? How many of you are running microservice on top Kubernetes or in containers? Challenges faced when scaling microservices How Kubernetes and sidecar pattern help to
  2. Datadog. Stackdriver SumoLogic
  3. Independent resource accounting and allocation Sidecar can be paired with numerous different "main" containers Containing failure boundary, making it a graceful degradation Independent testing, packaging, upgrade, deployment, & rollback Runtime injection of sidecar i.e. no change in legacy pods/containers