Service Mesh from the Ground Up: How Istio Can Transform Your - - PowerPoint PPT Presentation

service mesh from the ground up
SMART_READER_LITE
LIVE PREVIEW

Service Mesh from the Ground Up: How Istio Can Transform Your - - PowerPoint PPT Presentation

Service Mesh from the Ground Up: How Istio Can Transform Your Organization Megan O'Keefe Hello! I'm a Developer Relations Engineer at Google Cloud. I help make Google's products easy to adopt and use. I test-drive new features,


slide-1
SLIDE 1

Service Mesh from the Ground Up:

How Istio Can Transform Your Organization

Megan O'Keefe

slide-2
SLIDE 2

☁ I'm a Developer Relations Engineer at Google Cloud. 💖 I help make Google's products easy to adopt and use. 💼 I test-drive new features, build demos/ tools/workshops, and talk to end-users. ☸ I work on: Kubernetes, Service Mesh, and Anthos.

Hello!

slide-3
SLIDE 3

The world of distributed applications Why use a service mesh? Istio feature tour Live demos! Q&A

Today's Goals

slide-4
SLIDE 4

Why Service Mesh?

slide-5
SLIDE 5

The increasing adoption of containers, microservices, and hybrid cloud deployments has created more distributed applications than ever.

slide-6
SLIDE 6

Distributed apps can be defjned as a collection of services.

slide-7
SLIDE 7

What is a Service?

A Service is one deployable unit of sofuware. A Service implements a specifjc set of business logic, and is ofuen owned by one team. A Service can run and scale independently from its dependencies. A Service can be small or large. A Service can be stateless or stateful.

slide-8
SLIDE 8

Services: Benefjts

Separation of concerns Abstract away infrastructure Faster deployments Scale independently Cost savings

slide-9
SLIDE 9

Monolith Microservices

How do your developers and operators keep things up and running with explosive growth in number of services?

Number

  • f services

deployed

slide-10
SLIDE 10

By thinking services fjrst: investing in automation, tools, and cultural change.

Core Ops Team Number

  • f services

deployed

Monolith Microservices

slide-11
SLIDE 11

This is not easy.

slide-12
SLIDE 12

Services: Challenges

More languages, client libraries Choosing an environment Lifecycling Applications Scaling to demand Resource

  • ptimization
slide-13
SLIDE 13
slide-14
SLIDE 14

What can Kubernetes do?

Multitenancy, Isolation Abstract away compute Keep containers alive Automated scaling Optimize resources

slide-15
SLIDE 15

image source: Wikimedia Commons

Kubernetes runs Pods (Workloads) in a Cluster. A Cluster = a set of Viruual Machines (Nodes)

slide-16
SLIDE 16

master node node node

Cluster

slide-17
SLIDE 17

master

Pods in a Cluster

slide-18
SLIDE 18

master

Pods in a Cluster

you

slide-19
SLIDE 19

apiVersion: apps/v1 kind: Deployment metadata: name: hello-world spec: replicas: 1 template: metadata: labels: app: hello-world spec: containers:

  • name: hello-world-server

image: gcr.io/megangcp/helloworld:v0.0.1 ports:

  • containerPort: 8080

Pod Docker Image

slide-20
SLIDE 20

apiVersion: v1 kind: Service metadata: name: helloworld spec: selector: app: hello-world ports:

  • name: http

protocol: TCP port: 80 targetPort: 8080 type: LoadBalancer

Allow traffjc in

slide-21
SLIDE 21

➜ kubectl apply -f deployment.yaml deployment.extensions/hello-world created

slide-22
SLIDE 22

➜ kubectl get pods NAME READY STATUS RESTARTS hello-world-84c646556b-kn59b 1/1 Running 0

slide-23
SLIDE 23

➜ kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP helloworld LoadBalancer 10.51.246.3 35.188.110.209

slide-24
SLIDE 24

➜ curl http://35.188.110.209 Hello world!

slide-25
SLIDE 25

But...

slide-26
SLIDE 26

Where does Kubernetes fall shoru?

Safe Rollouts Observability Traffjc Encryption Request-level Authorization Resilience

slide-27
SLIDE 27

What is a Service Mesh?

A transparent layer on top of your services. A way to make the network aware of application protocols like HTTP and gRPC. An observability tool A security tool.

slide-28
SLIDE 28

🕹 Decouple Dev from Ops 🕹 Separate applications from infrastructure 🕹 Get generated metrics without instrumenting your services 🕹 Manage security policies in one place 🕹 Modify traffjc fmow without changing app code

Why use a Service Mesh?

slide-29
SLIDE 29

What is Istio?

slide-30
SLIDE 30

An open-source service mesh tool to manage service interactions across container and VM-based services. Created by Google, IBM, and Lyfu in 2017 Runs on Kubernetes Works at the application layer (Layer 7: HTTP, gRPC) Today: 300+ organizations contributing

Istio

slide-31
SLIDE 31
slide-32
SLIDE 32

Observability Network Automation Security

What Does Istio Do?

slide-33
SLIDE 33

Telemetry for every service Logs for all traffjc Service graph

What Does Istio Do?

slide-34
SLIDE 34

Telemetry for every service Logs for all traffjc Service graph Safe rollouts with traffjc splituing Client-side load balancing Timeouts, retry, circuit-breaking

What Does Istio Do?

slide-35
SLIDE 35

Telemetry for every service Logs for all traffjc Service graph Safe rollouts with traffjc splituing Client-side load balancing Timeouts, retry, circuit-breaking Encryption in transit Service identity, authentication Authorization

What Does Istio Do?

slide-36
SLIDE 36

Infrastructure Operators: Monitor traffjc across clusters and regions, add failover Platgorm Engineers: Build CI/CD tools for app developers, migrate legacy services App Developers: Investigate service metrics and behavior, debug during outages Security Admins: Enforce authentication and authorization policies Quality Assurance: Mirror production traffjc to a test environment

Who is Istio for?

slide-37
SLIDE 37

IBM Cloud Solo AspenMesh Envoy Knative Cisco Datadog WeaveWorks Palo Alto Networks

more at: istio.io/about/community/paruners/ | image source: Datadog

Istio Paruners

slide-38
SLIDE 38

AutoTrader eBay Continental The Weather Company Descarues Labs Autodesk Trulia HP Fitstation

more at: istio.io/about/community/customers/

Istio Users

slide-39
SLIDE 39

Adopting Kubernetes led to a 75 percent reduction in compute resources Adopting Istio led to improved security and visibility, with no extra developer efgoru or training needed Istio's service metrics improved visibility across a large microservices architecture source: Google Cloud Blog

Case Study: Autotrader

slide-40
SLIDE 40

Source: karlstoney@ - Twituer

slide-41
SLIDE 41

How Istio Works

slide-42
SLIDE 42

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-43
SLIDE 43

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-44
SLIDE 44

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

Policy checks and telemetry

slide-45
SLIDE 45

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-46
SLIDE 46

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

Policy checks and telemetry

slide-47
SLIDE 47

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-48
SLIDE 48

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

Telemetry

slide-49
SLIDE 49

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-50
SLIDE 50

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-51
SLIDE 51

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-52
SLIDE 52

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

slide-53
SLIDE 53

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

Policy checks and telemetry

slide-54
SLIDE 54

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

Policy checks and telemetry TLS certs to proxies via Secrets Sidecar configuration to Pods

Ingress Gateway

YAML

Ingress Traffic

slide-55
SLIDE 55

Installing Istio

slide-56
SLIDE 56
slide-57
SLIDE 57

dev

us-east1-b

slide-58
SLIDE 58

Pilot Galley Citadel

Istio Control Plane

Mixer Injector Ingress Gateway

dev

us-east1-b

slide-59
SLIDE 59

Pilot Galley Citadel

Istio Control Plane

Mixer Injector

Redis

EmailService ProductCatalog Service Recommendation Service Frontend CurrencyService ShippingService PaymentService CheckoutService CartService AdService

Ingress Gateway

dev

us-east1-b

slide-60
SLIDE 60

Pilot Galley Citadel

Istio Control Plane

Mixer Injector

dev

us-east1-b

Redis

EmailService ProductCatalog Service Recommendation Service Frontend CurrencyService ShippingService PaymentService CheckoutService CartService AdService

Ingress Traffic Ingress Gateway

slide-61
SLIDE 61

Demo

slide-62
SLIDE 62

Questions? ⛵

slide-63
SLIDE 63

Observability

slide-64
SLIDE 64

Observability is a measure

  • f how well internal states
  • f a system can be inferred

from knowledge of its external outputs.

slide-65
SLIDE 65

Service graph - track dependencies at runtime Bird’s eye view of service behavior for issue triage, reduce time to detect and fjx outages Automatically collects the "golden signals" for every service - latency, error rate, throughput Set, monitor and enforce Service-Level Objectives (SLOs) Tracing: track a request from end to end, across service boundaries

Istio Observability Features

slide-66
SLIDE 66

Demo

slide-67
SLIDE 67

Security

slide-68
SLIDE 68

Moving from VMs to Kubernetes introduces new security challenges.

slide-69
SLIDE 69

Isolation at the host level Workloads allocated to hosts Workloads share OS, dependencies Stable host IPs May run in a trusted, on-prem environment

Viruual Machines

Containers share a host (Node) Nodes work as one viruual host Containers have own dependencies Ephemeral Pod IPs May run in a cloud environment

Kubernetes

slide-70
SLIDE 70

Istio - Security

Automatically secure your services through managed authentication, authorization, and encryption of communication between services.

Traffjc encryption Service auth Access policies Auditing controls

slide-71
SLIDE 71

Demo: Mutual TLS

slide-72
SLIDE 72

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

Policy checks and telemetry

slide-73
SLIDE 73

apiVersion: "authentication.istio.io/v1alpha1" kind: "MeshPolicy" metadata: name: "default" spec: peers:

  • mtls: {}

MeshPolicy

slide-74
SLIDE 74

apiVersion: "networking.istio.io/v1alpha3" kind: "DestinationRule" metadata: name: "default" namespace: "istio-system" spec: host: "*.local" trafficPolicy: tls: mode: ISTIO_MUTUAL

DestinationRule

slide-75
SLIDE 75

Demo: Authorization

slide-76
SLIDE 76

Node Node

Proxy Service A Pilot Galley

Discovery & config data to proxies TLS certs to node agents

Citadel

Istio Control Plane

Mixer

Mesh config to control plane

Injector Service B Proxy Proxy Agent Agent

TLS certs to proxies via Secrets Sidecar configuration to Pods

YAML

Policy checks and telemetry

slide-77
SLIDE 77

apiVersion: "security.istio.io/v1beta1" kind: "AuthorizationPolicy" metadata: name: "currency-policy" namespace: default spec: selector: matchLabels: app: currencyservice rules:

  • from:
  • source:

principals: ["cluster.local/ns/default/sa/frontend-sa"]

AuthorizationPolicy

slide-78
SLIDE 78

Questions?

slide-79
SLIDE 79

DevOps

slide-80
SLIDE 80

DevOps is an organizational and cultural movement that aims to increase sofuware delivery velocity, improve service reliability, and build shared ownership among sofuware stakeholders.

cloud.google.com/devops

slide-81
SLIDE 81

What is DevOps?

build d e s i g n t e s t

DEV OPS

plan release deploy

  • p

e r a t e monitor

slide-82
SLIDE 82

DevOps is an organizational and cultural movement that aims to increase sofuware delivery velocity, improve service reliability, and build shared ownership among sofuware stakeholders.

cloud.google.com/devops

slide-83
SLIDE 83

Velocity: safe rollouts with traffjc splituing. deprecate legacy services with redirects. accelerate the customer feedback loop with A/B testing. Reliability: set SLOs and alerus on generated

  • metrics. use circuit breaking and fault injection

to harden services. Shared ownership: declarative traffjc/security policies in a shared Git repo. scope Istio policies at the namespace level.

DevOps with Istio

slide-84
SLIDE 84

Istio - Traffjc Management

VirtualService, Gateway, DestinationRule, and ServiceEntry

Traffjc splituing Traffjc steering Fault injection Circuit breaking Egress control

slide-85
SLIDE 85

apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: frontend spec: hosts:

  • "frontend.default.svc.cluster.local"

http:

  • route:
  • destination:

host: frontend

VirtualService

slide-86
SLIDE 86

apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: frontend-gateway spec: selector: istio: ingressgateway servers:

  • port:

number: 80 name: http protocol: HTTP hosts:

  • "*"

Gateway

slide-87
SLIDE 87

apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: frontend spec: host: frontend.default.svc.cluster.local subsets:

  • name: v1

labels: version: v1

  • name: v2

labels: version: v2

DestinationRule

slide-88
SLIDE 88

Pods Pods Kubernetes Deployment

slide-89
SLIDE 89

Pods Pods Kubernetes Deployment Kubernetes Service

slide-90
SLIDE 90

Pods Pods Kubernetes Service

v1 v2

Kubernetes Deployment Kubernetes Deployment

slide-91
SLIDE 91

DestinationRule v1 v2

Kubernetes Service Pods Pods

slide-92
SLIDE 92

VirtualService DestinationRule v1 v2

Kubernetes Service Pods Pods

slide-93
SLIDE 93

VirtualService DestinationRule v1 v2

Kubernetes Service Pods Pods

VirtualService DestinationRule v1 v2

Kubernetes Service Pods Pods

slide-94
SLIDE 94

VirtualService DestinationRule v1 v2

Kubernetes Service Pods Pods

VirtualService DestinationRule v1 v2

Kubernetes Service Pods Pods

Gateway

slide-95
SLIDE 95

build d e s i g n t e s t

DEV OPS

plan release deploy

  • p

e r a t e monitor

slide-96
SLIDE 96

build d e s i g n t e s t

DEV OPS

plan release deploy

  • p

e r a t e monitor

slide-97
SLIDE 97

Demo: Service Redirect

slide-98
SLIDE 98

Service Redirect

payments Frontend paymentservice:80

Scenario - we've moved to a faster payments service, coolcash. We want to deprecate paymentservice and redirect calls to coolcash.

coolcash

slide-99
SLIDE 99

build d e s i g n t e s t

DEV OPS

plan release deploy

  • p

e r a t e monitor

slide-100
SLIDE 100

Demo: Canary Deployment

slide-101
SLIDE 101

Canary Deployment

Release new service versions without worrying about ops challenges Goal: progressively direct traffjc to the new frontend v2

v2 v1 v1 v1 80% 20% Loadgen Frontend

slide-102
SLIDE 102

build d e s i g n t e s t

DEV OPS

plan release deploy

  • p

e r a t e monitor

slide-103
SLIDE 103

Demo: A/B Testing

slide-104
SLIDE 104

image source

slide-105
SLIDE 105

A/B Testing

Goal: Determine which frontend layout results in the most revenue Requests with ab-selected:true HTTP reader are routed to v2.

v2 v1

ab-selected: true

loadgen frontend

slide-106
SLIDE 106

http:

  • match: # RULE 1 - ADD HEADER
  • uri:

prefix: "/article/breaking-news" route:

  • destination:

host: articles headers: response: add: no-cache: "true" timeout: 2s

  • match: # RULE 2 - URI REWRITE
  • uri:

prefix: /blog rewrite: uri: /beta/blog route:

  • destination:

host: articles timeout: 2s

  • route: # RULE 3 - DEFAULT / TIMEOUT
  • destination:

host: articles timeout: 2s weight: 100

Combining Traffjc Rules

slide-107
SLIDE 107

Resilience

slide-108
SLIDE 108

Downstream services fail gracefully when an upstream service is unavailable Timeouts and retry logic to prevent a service waiting forever for an upstream Failover policies to another region running the same service

What makes an application resilient?

slide-109
SLIDE 109

⏰ Timeouts and retry logic ⚡ Circuit breaking 🚨 Fault injection 🔁 Client-side load balancing 🌐 Locality load balancing / Regional failover

Istio Resilience Features

slide-110
SLIDE 110

Demo: Circuit Breaking

slide-111
SLIDE 111

image source: Banzai Cloud

slide-112
SLIDE 112

Circuit Breaking

Avoid cascading failures through multiple services Istio circuit breaker: 1. detect x consecutive failures 2. trip the circuit breaker 3. fail immediately for t seconds

Checkout Shipping DestinationRule

slide-113
SLIDE 113

Demo: Fault Injection

slide-114
SLIDE 114

Fault Injection

Chaos testing - detect how downstream services respond when upstream services fail Find weak spots in application code error handling Istio supporus error and timeout faults.

Frontend Recs Fault Injection

฀฀

slide-115
SLIDE 115

Wrap-Up

slide-116
SLIDE 116

Where does Kubernetes fall shoru?

Safe Rollouts Observability Traffjc Encryption Request-level Authorization Resilience

slide-117
SLIDE 117

How can Istio transform your

  • rganization?
slide-118
SLIDE 118

How can Istio transform your organization?

Fast, Safe Releases Complete Observability End-to-end Encryption Request-level Authorization Failure Prediction, Reaction

slide-119
SLIDE 119

⭐ By tracking service dependencies, revealing organizational structure. ⭐ By decoupling the network from your app code. ⭐ By handling noruh-south and east-west traffjc with the same APIs. ⭐ By allowing developers to focus on building features, driving business value. ⭐ By giving you total visibility into service interactions. ⭐ By accelerating the DevOps feedback loop. ⭐ By hardening your applications, reducing the risk of outages.

slide-120
SLIDE 120

Monolith Microservices

How do your developers and operators keep things up and running with explosive growth in number of services?

Number

  • f services

deployed

slide-121
SLIDE 121

By thinking services fjrst: investing in automation, tools, and cultural change.

Size of Ops team Number

  • f services

deployed

Monolith Microservices

slide-122
SLIDE 122

Monolith Microservices

How can Istio transform your organization?

Number

  • f services

deployed

slide-123
SLIDE 123

Through telemetry, uniformity, and automation.

Size of Ops team Number

  • f services

deployed

Monolith Microservices

slide-124
SLIDE 124

Adopting Istio is a journey.

slide-125
SLIDE 125

✅ Who will adopt Istio? (Which product teams? Which services? Will there be phases of adoption across your org?) ✅ What features to adopt? What will come fjrst? ✅ How to confjgure Istio? One cluster per control plane? Multicluster? VMs? ✅ Where will you keep your Istio YAML? How will you roll out policy? ✅ Plan ahead for Istio's costs - time (sidecar latency) and money (CPUs) ✅ How will you upgrade Istio? How many versions behind?

Istio Adoption Checklist

slide-126
SLIDE 126

1. Put an Istio control plane where your applications live. 2. Keep your Istio policies in a Git repo 3. Use istioctl analyze to detect bad confjg 4. Create a "default" ViruualService & DestinationRule for every service 5. Use Kubernetes namespaces for isolation 6. Build / use abstractions on the Istio APIs.

More at: istio.io/docs/ops/best-practices

Best Practices

slide-127
SLIDE 127

VM workloads Multicluster Service mesh vs. API gateway Secure ingress JWT authentication Egress traffjc control New features - istiod, Mixer v2

What we didn't cover

slide-128
SLIDE 128

Resources

istio.io istiobyexample.dev bit.ly/istio-samples

slide-129
SLIDE 129

bit.ly/istio-sacon

slide-130
SLIDE 130

Thank you! ⛵

slide-131
SLIDE 131
slide-132
SLIDE 132

Appendix

slide-133
SLIDE 133
slide-134
SLIDE 134

Marketplace Service Management Managed Operations Google Cloud On-Prem Other Clouds

slide-135
SLIDE 135

Service mesh tool Open Source Istio APIs Prometheus, Grafana, Jaeger Control plane runs on your cluster

Istio

Service mesh tool Google Product Istio APIs Google Cloud Monitoring, Tracing Control plane managed outside your cluster Works on GCP, AWS, on-prem SRE dashboards, alerus built in Security insights + recommendations

Anthos Service Mesh