SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
Managing Microservices with Istio 1.0 on GKE
SERVICE MESH DEEP DIVE
• We Participate in CNCF K8s & Istio’s Meetings
Used to be in System
Used to be a developer
A devops Engineer
An amateur pianist
> WHOAMI
AGENDA – we’re not going to cover it all
Introduction
Service Mesh Concept
Istio & it’s Architecture
Installation
Request Routing
Resiliency
Monitoring Mesh services
OpenTracing & App changes
Visualizing
Kiali
Integ. With Stackdriver
Traffic director
Mutual TLS Authentication
End-User Authentication
Authorization
Observability Multicluster/ Mesh Exp.
Traffic management Security
Integ. With Stackdriver
Traffic director
GCP Specifics
What’s a Service Mesh
…network of microservices and the interactions between them…
…As it grows in size and complexity, it becomes harder to understand and manage. Its requirements
can include discovery, load balancing, failure recovery, metrics, and monitoring…
…more complex operational requirements, like A/B testing, canary releases, rate limiting, access
control, and end-to-end authentication.
A service mesh solution is a configurable layer that
attends these requirements, in secure, usable way
…usually implemented by providing a proxy sidecar…
Istio
• Backed by Google, IBM & Lyft
• The best-known service solution mesh today (Poor LinkerD/Conduit).
• Supported natively on Kubernetes
• First version, 0.1 – may 2017 (Checked heavily, by many)
• Current version 1.0.2 (1.0 is the 1st GA, Production Ready version)
• Leverages the sidecar model
• Uses Envoy for its ambassador proxies
• Means A messenger, Ambassador
• High-performance L4/L7 proxy written in C++, designed for observability
• Support HTTP/2 & gRPC
• Mediates all inbound/outbound traffic for services inside the Istio mesh
• Istio (pilot in particular) leverages many of Envoy’s features
• Injected as a sidecar container in a the service’s kubernetes pod.
• Part of the CNCF
• Current v1.8 (1.9-dev)
Envoy – The Dataplane
Why use Istio?
• Enjoy features without application code changes
• Supports HTTP, HTTP2, gRPC, Webscokets, MongoDB
• Zone & Region aware load-balancing
• Service-2-service mTLS authentication & authorization
• Smart traffic routing & many resiliency features e.g. circuit breaking
• Automatic metrics/app monitoring, logging & tracing
• Mesh expansions and multiuser features.
Control-plane Architecture
• Pilot (Service Discovery for envoys, Traffic management, Resiliency)
• Converts high level rules to envoy specifics
• Decouples service discovery platform specifics
• Mixer (Enforcement, Telemetry)
• Enforces access control & policies
• Collects telemetry from proxies and other services
• Citadel (Security)
• Provides mTLS with service/user-2-service authentication
• Manages credentials and identity at scale
• Manages certificates lifecycle for workloads
• Use helm for production installation – Helm install / Helm template
• Helm can be used for easy low level customization of Istio’s components and feature
• Setups scalable control plane by default
• Helm 2.10+ will make life easier (manually create CRDs and remove)
• Provides ansible playbooks for installing on a VMs or Openshift
• Sidecar Injection can be done manually with istioctl (kube-inject)
• Or automatically with the side-car-injector (controlled then with policy and annotations)
Istio Setup & Sidecar Injection
Bookinfo app
• Pilot manages the Envoys & configures rules for routing traffic between the Envoys
• Envoys are propagated with rules in an eventual consistency way.
• Istio uses concept of service versions – a sub division of service instances
• Routing to versions according to headers, weights, tags of source/dest. and more
• Common scenarios: A/B Testing, Canary deployments, %-splits, Community features
• Mirroring production traffic
Traffic Management – Request Routing
• Istio’s supports zone-aware load balancing modes: (envoy supports more)
• Round-robin, random, weighted least request (Zone-aware)
• Envoys use Pilot’s service disc. Interface to update load balancing pools.
• Envoy distributes traffic to instances in its pool.
• Envoy periodically checks health of upstream service instances.
• Envoy ejects/return instances to the pool with the circuit breaker pattern
• Kubernetes built-in load balancing is bypassed.
Traffic Management – Load Balancing
• Istio & Envoy provide recovery & resiliency features:
• Timeouts
• Retries
• Concurrent connections and request rate limits
• Active periodic health checks on load balancing members
• Passive health checks with outlier detection (from real resonses)
• Active & passive health checks minimize the chances for unhealthy pod to receive traffic
• Combination of all reduce request failure and impact on latency to minimum.
• Override with x-envoy-upstream-rq-timeout-ms & x-envoy-max-retries
• Fault Injection – Simulate failures & loaded downstream services
Traffic Management – Handling failures
• Ingress traffic to the mesh should also flow through an envoy
• Make traffic mgmt. enabled for front microservices.
• Gateway+Ingress Gateway is Istio’s replacement for k8s Ingress
• Unlike K8s Ingress, Istio Ingress support L4-L7
• Support UDP, HTTP/2, gRPC, Webscoekts
• Ingress Gateway is an Envoy proxy, in an Edge mode
• Can use Ingress Gateway as an API manager.
• Egress: By default, external services are unavailable for mesh services
• Set ServiceEntry for allowing access to external hosts from within the Mesh
• By default, mesh external hosts are not registered as services in the mesh – you get 404
Traffic Management – Ingress/Egress
• 4 API resources: VirtualService, DestinationRule, ServiceEntry, Gateway
• VirtualService – Rules as for how request is routed to a service
• DestinationRule – Which Policies to set once VirtualService routing occurred
• ServiceEntry – Enable requests to services outside the Mesh
• Gateway – HTTP/2/TCP edge LoadBalancer for ingress traffic for an application
Traffic Management – Configuration
Traffic Management – Subsets
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
- reviews.default.svc...
- reviews.other-ns.svc...
http:
- route:
- destination:
host: reviews
subset: v1
weight: 75
- destination:
host: reviews
subset: v2
weight: 25
timeout: 10s
retries:
attempts: 3
perTryTimeout: 2s
kind: DestinationRule
metadata:
name: reviews
spec:
host: reviews
trafficPolicy:
loadBalancer:
simple: RANDOM
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
Review Pods
Label:
Version=v1
Review Pods
Label:
Version=v2
75% 25%
random Round_robin
100 max conn.
All microservices
In k8s, percentage is controlled with physical replicas
Traffic Management – Conditional Rules
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- match:
- sourceLabels:
- version: v1
- app: productpage
- (uri/method/headers/
port, headers…)
route:
- destination:
host: reviews
subset: v2
weight: 25
- route
- destination:
host: reviews
subset: v1
weight: 75
kind: DestinationRule
metadata:
name: reviews
spec:
host: reviews
trafficPolicy:
loadBalancer:
simple: RANDOM
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
Review Pods
Label:
Version=v1
Review Pods
Label:
Version=v2
75% 25%
random Round_robin
Product page
Pods
Label:
Version=v1
Demo
Rest of the
microservices
Traffic Management – Timeouts, Retries, CircuitBreaking
kind: DestinationRule
metadata:
name: httpbin
spec:
host: httpbin
trafficPolicy:(portLevelSettings)
connectionPool:
tcp:
maxConnections: 1
http:
http1MaxPendingRequests: 1
maxRequestsPerConnection: 1
http2MaxRequest: 1
outlierDetection:
consecutiveErrors: 5
interval: 1s
baseEjectionTime: 3m
maxEjectionPercent: 100
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v1
weight: 100
timeout: 1s
retries:
attempts: 2
perTryTimeout: 1s
Traffic Management – Mesh external services
kind: VirtualService
metadata:
name: google
spec:
hosts:
- www.google.com
tls:
- match:
- port: 443
sni_hosts:
- www.google.com
route:
- destination:
host: www.google.com
port:
number: 443
weight: 100
timeout: 1s
kind: ServiceEntry
metadata:
name: google
spec:
hosts:
- www.google.com
ports:
- number: 80
name: https
protocol: HTTPS
resolution: DNS
location: MESH_EXTERNAL
kind: DestinationRule
metadata:
name: google
spec:
host:www.google.com
trafficPolicy:
connectionPool:
http:
http1MaxPendingRequests: 10
maxRequestsPerConnection: 10
Traffic Management – Gateways & Ingress
kind: Gateway
metadata:
name: example-apps
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- ”*.example.com"
kind: VirtualService
metadata:
name: httpbin
spec:
hosts:
- ”great-app.example.com"
gateways:
- example-apps
http:
- match:
- uri:
prefix: /status
- port: 80
route:
- destination:
port:
number: 8000
host: ”great.default"
Show Gateway
kind: VirtualService
metadata:
name: httpbin
spec:
hosts:
- ”amazing-app.example.com"
gateways:
- example-apps
http:
- match:
- uri:
prefix: /catalog
- port: 80
rewrite
uri: /newcatalog
route:
- destination:
port:
number: 8000
host: ”great.default"
Traffic Management – Mirroring
• Send a copy of live traffic to a mirrored service
• Test production with minimum risk with real live traffic
• Occurs out of band of the production service - not impact on latency
kind: VirtualService
metadata:
name: httpbin
spec:
hosts:
- httpbin
http:
- route:
- destination:
host: httpbin
subset: v1
weight: 100
mirror:
host: httpbin
subset: v2
Security – Microservices
• Microservices require:
• Defense against man in the middle
• A way to provide identify to microservices, so it can provide access control
• Auditing – who access what and when
• Istio provides that at scale while:
• No change needs to be made to app code
• Integrate with existing security systems
• Build security on top of untrusted networks
Security – Identity in Istio
• Identity is fundamental in any security infrastructure
• Citadel manages identities with certificates in SPIFFE format
• SPIFFE – open-standard for identities in cloud native domain
• https://www.slideshare.net/prabathsiriwardena/cloud-native-identity-with-spiffe
• Istio uses SPIRE – an implementation of SPIFFE
• In k8s, the SPIFFE identity is in the form of spiffe://cluster.local/ns/<namespace>/sa/<serviceAcctName>
• e.g spiffe://cluster.local/ns/default/sa/a-microservice
• Citadel automates key & certificate rotation at scale
Security – Identity Lifecycle on K8s
K8s API Server
watch for SAs
1. Citadel watches k8s api for ServiceAccounts, then generates cert. & key-pairs
2. Citadel mounts the relevant cert. & key pair with a k8s secret to the Pod
3. Citadel watches the certificates and rotates them by re-writing the k8s secret
4. Pilot generates map of which identity is authorized to run what services
Products Microservice Pod
SA
products
Gen/Rotate cert/KP for
products microservices
certs the Istio-proxy
Envoy container App container
SA products
secret
Istio-certs
secret
Secure naming
products <-> SPIFFE://clus..
Security – Microservices authentication
• Service-to-service authentication with citadel generated certificates – upgrades channel to be encrypted
• Pilot watches Policies & DestinationRules, and updates the proxies with how to perform authentication
• Mutual TLS – In addition, called microservice validates the caller client certificates
• App can be http, while mTLS auth. occurs transparently - no handling of certificates in code
• End-user authentication enable proxies to validate user’s JWT tokens before reaching the app
Security – AuthenticationPolicy & DestinationRule
kind: "DestinationRule"
metadata:
name: ”a-microservice"
spec:
host: a-microservice.bar.svc.cluster.local
trafficPolicy:
tls:
mode: DISABLE
portLevelSettings:
- port:
number: 8080
tls:
mode: ISTIO_MUTUAL
kind: "Policy"
metadata:
name: ”a-microservice"
spec:
targets:
- name: a-microservice.bar…
ports:
- number: 8080
peers:
- mtls: {}
DEMO
Currently, Istio supports only mTLS is, thus
DestinationRules must be used if AuthPolicy
requires mTLS
Security – End User Authentication
kind: "Policy"
metadata:
name: "jwt-example"
spec:
targets:
- name: httpbin
origins:
- jwt:
issuer: "testing@secure.istio.io"
jwksUri: "https://...” <– jwt web key set to verify the token
principalBinding: USE_ORIGIN
JWKS is a set of keys containing the public keys that should be used to verify any JWT
Security – Microservices Authorization
• Toggle with RbacConfig singleton API resource instasnce
• Configure with ServiceRole & ServiceRoleBinding
• ServiceRole defines the permission e.g. Service names, HTTP methods
• ServiceRoleBinding can refer a user, group or service
• In mTLS, caller microservice validates server identity is authorized to run it
• Istio Authorization is like WAF, while NetworkPolicy is on L3-L4
• End-user authorization – Istio refer JWT claims in Istio RBAC role bindings
kind: ServiceRole
metadata:
name: books-review-reader
namespace: default
spec:
rules:
- services: [”a-microservice.ns"]
paths: ["*/reviews"]
methods: ["GET”,”HEAD”]
constratins:
- key: destaintion.labels[“version”]
value: [“v1”,”v2”]
(- key: ip/port/namespace/user/headers)
kind: ServiceRoleBinding
metadata:
name: allow-reviews-to-product-ms
namespace: default
spec:
subjects:
- user: "service-account-a"
roleRef:
kind: ServiceRole
name: books-review-reader
Security – Microservices Authorization
kind: ServiceRole
metadata:
name: reviews-reader
namespace: default
spec:
rules:
- services: [”reviews.ns"]
paths: ["*/reviews"]
methods: ["GET”,”HEAD”]
constratins:
- key: destaintion.labels[“version”]
value: [“v1”,”v2”]
(- key: ip/port/namespace/user/headers)
kind: ServiceRoleBinding
metadata:
name: allow-reviews-to-product
namespace: default
spec:
subjects:
- user: ”product-service-account"
roleRef:
kind: ServiceRole
name: reviews-reader
Observability – Polcies & Telemetry
• Mixer provides telemetry collection and policy enforcement
• Policies such as Rate limits & black/white listing
• Envoy checks Mixer for policies for each requests (with cache)
• Envoy buffers telemetry on requests, and deliver to Mixer
• Like Pilot, Mixer abstracts away policy & telemetry infra backends
• Mixer holds a shared cache in case external backends are unavailable
• Telemetry collected from Envoys is attribute based.
Observability - Monitoring
Microservice Pod
Envoy container
kind: prometheus
metadata:
name: handler
namespace: istio-system
spec:
metrics:
- name: request_total
instance_name: requestcount.metric.istio-system
kind: COUNTER
label_names:
- destination_service
- response_code
Handler def.
Who scrape what
from mixer
kind: metric
metadata:
name: requestcount
namespace: istio-system
spec:
dimensions:
destination_service: destination.service.host
.
.
response_code: response.code | 200
value: "1"
What to report Mixer
Bind handler to metric
According to Rule
kind: rule
metadata:
name: promhttp
namespace: istio-system
spec:
actions:
- handler: handler.prometheus
instances:
- requestcount.metric
match: context.protocol == "http"
Envoy request attributes
Handlers e.g. Fluentd, denier…
Observability - Tracing
• Tracing is usually based on aggregating spans - when and where the request was in the microservices path
• Envoy supports Zipkin (or Zipkin compatible e.g. Jaeger) and Lightstep – Both OpenTracing API based
• Istio comes with Jaeger (ingest & visualize) as default
• Envoy sidecars generate and propagate B3 Headers and send them to Jaeger
• It is the Application responsibility to propagate these headers (OpenTracing instrumentation)
• In SpringBoot2 you can import opentracing-spring-jaeger-cloud-starter
• NodeJs npm install jaeger-client | npm install zipkin / zipkin-instrumentation-express
• Some do all the work for you / in other you need to build a tracer that propagates/sends B3 Headers
Observability – Monitoring & Tracing
App
container
Sidecar
µService A Pod (HTTP/s Service)
Mixer
Scape
Visualize
Report
metrics
App
container
Sidecar
µService A Pod (HTTP/s Service)
App
container
Sidecar
µService A Pod (TCP Service)
Telemetry
Sidecar span
App. component span
Aggregated
view
Report
opentracing
spans
Observability – A Word about Kiali
Service Mesh Observability
Observability – Debugging the mesh
• istioctl proxy-status - Pilot & Envoys sync status
• Istioctl proxy-status <pod-name> - Envoy | Pilot configuration diff
• istioctl authn tls-check – debugging mTLS authentication
• Istioctl proxy-config cluster / endpoint – show services and their endpoints in envoys config
• Istioctl proxy-config route – route configuration of envoy
Multicluster MESH
K
Hosting K8s Cluster
Multicluster – Separate meetup
Istio-system
Istio Cont. plane
exposed with I/LBs
Root CA
K
Hosting K8s Cluster
Istio-system
Istio-remote
K
Hosting K8s Cluster
Istio-system
Istio-remote
VM /
Bare metal
Envoy
Sign certificates
Mesh expansion
Register Sidecar
Mesh expansion / Multicluster requires Pods ips available outside the cluster. E.g. aws_vpc_cni, gke native clusters
Google Cloud & Istio
• Integration with Stackdriver for metrics and logging
• Traffic Director – Multicloud/Hybrid managed Istio Service Mesh
• Integration with Google Cloud Endpoints
Thank you

Weitere ähnliche Inhalte

Was ist angesagt?

linkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Meshlinkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service MeshDario Simonetti
 
Multi-Cloud Orchestration for Kubernetes with Cloudify
Multi-Cloud Orchestration for Kubernetes with CloudifyMulti-Cloud Orchestration for Kubernetes with Cloudify
Multi-Cloud Orchestration for Kubernetes with CloudifyCloudify Community
 
Service mesh with istio
Service mesh with istioService mesh with istio
Service mesh with istioWisnuPrabowo20
 
Microservices:
 The phantom menace
. Istio Service Mesh: 
the new hope
Microservices:
 The phantom menace
. Istio Service Mesh: 
the new hopeMicroservices:
 The phantom menace
. Istio Service Mesh: 
the new hope
Microservices:
 The phantom menace
. Istio Service Mesh: 
the new hopeSergii Bishyr
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service MeshLew Tucker
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service MeshLuke Marsden
 
Cloud Solution Day 2016: Service Mesh for Kubernetes
Cloud Solution Day 2016: Service Mesh for KubernetesCloud Solution Day 2016: Service Mesh for Kubernetes
Cloud Solution Day 2016: Service Mesh for KubernetesAWS Vietnam Community
 
Managing traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshopManaging traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshopOpsta
 
Application Rollout - Istio
Application Rollout - Istio Application Rollout - Istio
Application Rollout - Istio Mandar Jog
 
Istio: Using nginMesh as the service proxy
Istio: Using nginMesh as the service proxyIstio: Using nginMesh as the service proxy
Istio: Using nginMesh as the service proxyLee Calcote
 
Stop reinventing the wheel with Istio by Mete Atamel (Google)
Stop reinventing the wheel with Istio by Mete Atamel (Google)Stop reinventing the wheel with Istio by Mete Atamel (Google)
Stop reinventing the wheel with Istio by Mete Atamel (Google)Codemotion
 
Istio - A Service Mesh for Microservices as Scale
Istio - A Service Mesh for Microservices as ScaleIstio - A Service Mesh for Microservices as Scale
Istio - A Service Mesh for Microservices as ScaleRam Vennam
 
Istio By Example (extended version)
Istio By Example (extended version)Istio By Example (extended version)
Istio By Example (extended version)Josef Adersberger
 
Container world hybridnetworking_rev2
Container world hybridnetworking_rev2Container world hybridnetworking_rev2
Container world hybridnetworking_rev2Prem Sankar Gopannan
 
WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh? WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh? Anton Weiss
 

Was ist angesagt? (20)

linkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Meshlinkerd: The Cloud Native Service Mesh
linkerd: The Cloud Native Service Mesh
 
Multi-Cloud Orchestration for Kubernetes with Cloudify
Multi-Cloud Orchestration for Kubernetes with CloudifyMulti-Cloud Orchestration for Kubernetes with Cloudify
Multi-Cloud Orchestration for Kubernetes with Cloudify
 
Service mesh with istio
Service mesh with istioService mesh with istio
Service mesh with istio
 
Service mesh
Service meshService mesh
Service mesh
 
Microservices:
 The phantom menace
. Istio Service Mesh: 
the new hope
Microservices:
 The phantom menace
. Istio Service Mesh: 
the new hopeMicroservices:
 The phantom menace
. Istio Service Mesh: 
the new hope
Microservices:
 The phantom menace
. Istio Service Mesh: 
the new hope
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service Mesh
 
Istio on Kubernetes
Istio on KubernetesIstio on Kubernetes
Istio on Kubernetes
 
Istio Service Mesh
Istio Service MeshIstio Service Mesh
Istio Service Mesh
 
Cloud Solution Day 2016: Service Mesh for Kubernetes
Cloud Solution Day 2016: Service Mesh for KubernetesCloud Solution Day 2016: Service Mesh for Kubernetes
Cloud Solution Day 2016: Service Mesh for Kubernetes
 
Managing traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshopManaging traffic routing with istio and envoy workshop
Managing traffic routing with istio and envoy workshop
 
Application Rollout - Istio
Application Rollout - Istio Application Rollout - Istio
Application Rollout - Istio
 
Istio: Using nginMesh as the service proxy
Istio: Using nginMesh as the service proxyIstio: Using nginMesh as the service proxy
Istio: Using nginMesh as the service proxy
 
Cinder Updates - Liberty Edition
Cinder Updates - Liberty Edition Cinder Updates - Liberty Edition
Cinder Updates - Liberty Edition
 
Stop reinventing the wheel with Istio by Mete Atamel (Google)
Stop reinventing the wheel with Istio by Mete Atamel (Google)Stop reinventing the wheel with Istio by Mete Atamel (Google)
Stop reinventing the wheel with Istio by Mete Atamel (Google)
 
Istio - A Service Mesh for Microservices as Scale
Istio - A Service Mesh for Microservices as ScaleIstio - A Service Mesh for Microservices as Scale
Istio - A Service Mesh for Microservices as Scale
 
Istio By Example (extended version)
Istio By Example (extended version)Istio By Example (extended version)
Istio By Example (extended version)
 
Container world hybridnetworking_rev2
Container world hybridnetworking_rev2Container world hybridnetworking_rev2
Container world hybridnetworking_rev2
 
Microservices based VNF
Microservices based VNFMicroservices based VNF
Microservices based VNF
 
Kubernetes + netflix oss
Kubernetes + netflix ossKubernetes + netflix oss
Kubernetes + netflix oss
 
WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh? WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh?
 

Ähnlich wie Managing Microservices With The Istio Service Mesh on Kubernetes

Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Ram Vennam
 
Open Source Networking Days- Service Mesh
Open Source Networking Days- Service MeshOpen Source Networking Days- Service Mesh
Open Source Networking Days- Service MeshCloudOps2005
 
Managing microservices with Istio Service Mesh
Managing microservices with Istio Service MeshManaging microservices with Istio Service Mesh
Managing microservices with Istio Service MeshRafik HARABI
 
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 Deep Dive
ISTIO Deep DiveISTIO Deep Dive
ISTIO Deep DiveYong Feng
 
Service mesh on Kubernetes - Istio 101
Service mesh on Kubernetes - Istio 101Service mesh on Kubernetes - Istio 101
Service mesh on Kubernetes - Istio 101Huy Vo
 
OpenStack Summit Fall 2018: LBaaS
OpenStack Summit Fall 2018: LBaaSOpenStack Summit Fall 2018: LBaaS
OpenStack Summit Fall 2018: LBaaSPraveen Yalagandula
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Rick Hightower
 
Hyperledger Fabric update Meetup 20181101
Hyperledger Fabric update Meetup 20181101Hyperledger Fabric update Meetup 20181101
Hyperledger Fabric update Meetup 20181101Arnaud Le Hors
 
Using Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your ServicesUsing Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your ServicesAlcide
 
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
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon Web Services Korea
 
Introducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.comIntroducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.comIvan Kruglov
 
Microservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eurekaMicroservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eurekaBinit Pathak
 
Cloud Automation Manager
Cloud Automation ManagerCloud Automation Manager
Cloud Automation ManagerNithin Babu
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Tony Erwin
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.pptShivaangiKrish
 
Kubernetes And Istio and Azure AKS DevOps
Kubernetes And Istio and Azure AKS DevOpsKubernetes And Istio and Azure AKS DevOps
Kubernetes And Istio and Azure AKS DevOpsOfir Makmal
 

Ähnlich wie Managing Microservices With The Istio Service Mesh on Kubernetes (20)

Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019
 
Open Source Networking Days- Service Mesh
Open Source Networking Days- Service MeshOpen Source Networking Days- Service Mesh
Open Source Networking Days- 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
 
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 Deep Dive
ISTIO Deep DiveISTIO Deep Dive
ISTIO Deep Dive
 
Service mesh on Kubernetes - Istio 101
Service mesh on Kubernetes - Istio 101Service mesh on Kubernetes - Istio 101
Service mesh on Kubernetes - Istio 101
 
OpenStack Summit Fall 2018: LBaaS
OpenStack Summit Fall 2018: LBaaSOpenStack Summit Fall 2018: LBaaS
OpenStack Summit Fall 2018: LBaaS
 
Designing microservices
Designing microservicesDesigning microservices
Designing microservices
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
 
Hyperledger Fabric update Meetup 20181101
Hyperledger Fabric update Meetup 20181101Hyperledger Fabric update Meetup 20181101
Hyperledger Fabric update Meetup 20181101
 
Using Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your ServicesUsing Istio to Secure & Monitor Your Services
Using Istio to Secure & Monitor Your Services
 
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
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
 
Introducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.comIntroducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.com
 
Microservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eurekaMicroservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eureka
 
Cloud Automation Manager
Cloud Automation ManagerCloud Automation Manager
Cloud Automation Manager
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
 
web services-May 25.ppt
web services-May 25.pptweb services-May 25.ppt
web services-May 25.ppt
 
Kubernetes And Istio and Azure AKS DevOps
Kubernetes And Istio and Azure AKS DevOpsKubernetes And Istio and Azure AKS DevOps
Kubernetes And Istio and Azure AKS DevOps
 

Kürzlich hochgeladen

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Kürzlich hochgeladen (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Managing Microservices With The Istio Service Mesh on Kubernetes

  • 1. Managing Microservices with Istio 1.0 on GKE SERVICE MESH DEEP DIVE
  • 2. • We Participate in CNCF K8s & Istio’s Meetings
  • 3. Used to be in System Used to be a developer A devops Engineer An amateur pianist > WHOAMI
  • 4. AGENDA – we’re not going to cover it all Introduction Service Mesh Concept Istio & it’s Architecture Installation Request Routing Resiliency Monitoring Mesh services OpenTracing & App changes Visualizing Kiali Integ. With Stackdriver Traffic director Mutual TLS Authentication End-User Authentication Authorization Observability Multicluster/ Mesh Exp. Traffic management Security Integ. With Stackdriver Traffic director GCP Specifics
  • 5. What’s a Service Mesh …network of microservices and the interactions between them… …As it grows in size and complexity, it becomes harder to understand and manage. Its requirements can include discovery, load balancing, failure recovery, metrics, and monitoring… …more complex operational requirements, like A/B testing, canary releases, rate limiting, access control, and end-to-end authentication. A service mesh solution is a configurable layer that attends these requirements, in secure, usable way …usually implemented by providing a proxy sidecar…
  • 6. Istio • Backed by Google, IBM & Lyft • The best-known service solution mesh today (Poor LinkerD/Conduit). • Supported natively on Kubernetes • First version, 0.1 – may 2017 (Checked heavily, by many) • Current version 1.0.2 (1.0 is the 1st GA, Production Ready version) • Leverages the sidecar model • Uses Envoy for its ambassador proxies
  • 7. • Means A messenger, Ambassador • High-performance L4/L7 proxy written in C++, designed for observability • Support HTTP/2 & gRPC • Mediates all inbound/outbound traffic for services inside the Istio mesh • Istio (pilot in particular) leverages many of Envoy’s features • Injected as a sidecar container in a the service’s kubernetes pod. • Part of the CNCF • Current v1.8 (1.9-dev) Envoy – The Dataplane
  • 8. Why use Istio? • Enjoy features without application code changes • Supports HTTP, HTTP2, gRPC, Webscokets, MongoDB • Zone & Region aware load-balancing • Service-2-service mTLS authentication & authorization • Smart traffic routing & many resiliency features e.g. circuit breaking • Automatic metrics/app monitoring, logging & tracing • Mesh expansions and multiuser features.
  • 9. Control-plane Architecture • Pilot (Service Discovery for envoys, Traffic management, Resiliency) • Converts high level rules to envoy specifics • Decouples service discovery platform specifics • Mixer (Enforcement, Telemetry) • Enforces access control & policies • Collects telemetry from proxies and other services • Citadel (Security) • Provides mTLS with service/user-2-service authentication • Manages credentials and identity at scale • Manages certificates lifecycle for workloads
  • 10. • Use helm for production installation – Helm install / Helm template • Helm can be used for easy low level customization of Istio’s components and feature • Setups scalable control plane by default • Helm 2.10+ will make life easier (manually create CRDs and remove) • Provides ansible playbooks for installing on a VMs or Openshift • Sidecar Injection can be done manually with istioctl (kube-inject) • Or automatically with the side-car-injector (controlled then with policy and annotations) Istio Setup & Sidecar Injection
  • 12. • Pilot manages the Envoys & configures rules for routing traffic between the Envoys • Envoys are propagated with rules in an eventual consistency way. • Istio uses concept of service versions – a sub division of service instances • Routing to versions according to headers, weights, tags of source/dest. and more • Common scenarios: A/B Testing, Canary deployments, %-splits, Community features • Mirroring production traffic Traffic Management – Request Routing
  • 13. • Istio’s supports zone-aware load balancing modes: (envoy supports more) • Round-robin, random, weighted least request (Zone-aware) • Envoys use Pilot’s service disc. Interface to update load balancing pools. • Envoy distributes traffic to instances in its pool. • Envoy periodically checks health of upstream service instances. • Envoy ejects/return instances to the pool with the circuit breaker pattern • Kubernetes built-in load balancing is bypassed. Traffic Management – Load Balancing
  • 14. • Istio & Envoy provide recovery & resiliency features: • Timeouts • Retries • Concurrent connections and request rate limits • Active periodic health checks on load balancing members • Passive health checks with outlier detection (from real resonses) • Active & passive health checks minimize the chances for unhealthy pod to receive traffic • Combination of all reduce request failure and impact on latency to minimum. • Override with x-envoy-upstream-rq-timeout-ms & x-envoy-max-retries • Fault Injection – Simulate failures & loaded downstream services Traffic Management – Handling failures
  • 15. • Ingress traffic to the mesh should also flow through an envoy • Make traffic mgmt. enabled for front microservices. • Gateway+Ingress Gateway is Istio’s replacement for k8s Ingress • Unlike K8s Ingress, Istio Ingress support L4-L7 • Support UDP, HTTP/2, gRPC, Webscoekts • Ingress Gateway is an Envoy proxy, in an Edge mode • Can use Ingress Gateway as an API manager. • Egress: By default, external services are unavailable for mesh services • Set ServiceEntry for allowing access to external hosts from within the Mesh • By default, mesh external hosts are not registered as services in the mesh – you get 404 Traffic Management – Ingress/Egress
  • 16. • 4 API resources: VirtualService, DestinationRule, ServiceEntry, Gateway • VirtualService – Rules as for how request is routed to a service • DestinationRule – Which Policies to set once VirtualService routing occurred • ServiceEntry – Enable requests to services outside the Mesh • Gateway – HTTP/2/TCP edge LoadBalancer for ingress traffic for an application Traffic Management – Configuration
  • 17. Traffic Management – Subsets kind: VirtualService metadata: name: reviews spec: hosts: - reviews - reviews.default.svc... - reviews.other-ns.svc... http: - route: - destination: host: reviews subset: v1 weight: 75 - destination: host: reviews subset: v2 weight: 25 timeout: 10s retries: attempts: 3 perTryTimeout: 2s kind: DestinationRule metadata: name: reviews spec: host: reviews trafficPolicy: loadBalancer: simple: RANDOM subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 trafficPolicy: loadBalancer: simple: ROUND_ROBIN Review Pods Label: Version=v1 Review Pods Label: Version=v2 75% 25% random Round_robin 100 max conn. All microservices In k8s, percentage is controlled with physical replicas
  • 18. Traffic Management – Conditional Rules kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - match: - sourceLabels: - version: v1 - app: productpage - (uri/method/headers/ port, headers…) route: - destination: host: reviews subset: v2 weight: 25 - route - destination: host: reviews subset: v1 weight: 75 kind: DestinationRule metadata: name: reviews spec: host: reviews trafficPolicy: loadBalancer: simple: RANDOM subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 trafficPolicy: loadBalancer: simple: ROUND_ROBIN Review Pods Label: Version=v1 Review Pods Label: Version=v2 75% 25% random Round_robin Product page Pods Label: Version=v1 Demo Rest of the microservices
  • 19. Traffic Management – Timeouts, Retries, CircuitBreaking kind: DestinationRule metadata: name: httpbin spec: host: httpbin trafficPolicy:(portLevelSettings) connectionPool: tcp: maxConnections: 1 http: http1MaxPendingRequests: 1 maxRequestsPerConnection: 1 http2MaxRequest: 1 outlierDetection: consecutiveErrors: 5 interval: 1s baseEjectionTime: 3m maxEjectionPercent: 100 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - route: - destination: host: reviews subset: v1 weight: 100 timeout: 1s retries: attempts: 2 perTryTimeout: 1s
  • 20. Traffic Management – Mesh external services kind: VirtualService metadata: name: google spec: hosts: - www.google.com tls: - match: - port: 443 sni_hosts: - www.google.com route: - destination: host: www.google.com port: number: 443 weight: 100 timeout: 1s kind: ServiceEntry metadata: name: google spec: hosts: - www.google.com ports: - number: 80 name: https protocol: HTTPS resolution: DNS location: MESH_EXTERNAL kind: DestinationRule metadata: name: google spec: host:www.google.com trafficPolicy: connectionPool: http: http1MaxPendingRequests: 10 maxRequestsPerConnection: 10
  • 21. Traffic Management – Gateways & Ingress kind: Gateway metadata: name: example-apps spec: selector: istio: ingressgateway servers: - port: number: 80 name: http protocol: HTTP hosts: - ”*.example.com" kind: VirtualService metadata: name: httpbin spec: hosts: - ”great-app.example.com" gateways: - example-apps http: - match: - uri: prefix: /status - port: 80 route: - destination: port: number: 8000 host: ”great.default" Show Gateway kind: VirtualService metadata: name: httpbin spec: hosts: - ”amazing-app.example.com" gateways: - example-apps http: - match: - uri: prefix: /catalog - port: 80 rewrite uri: /newcatalog route: - destination: port: number: 8000 host: ”great.default"
  • 22. Traffic Management – Mirroring • Send a copy of live traffic to a mirrored service • Test production with minimum risk with real live traffic • Occurs out of band of the production service - not impact on latency kind: VirtualService metadata: name: httpbin spec: hosts: - httpbin http: - route: - destination: host: httpbin subset: v1 weight: 100 mirror: host: httpbin subset: v2
  • 23. Security – Microservices • Microservices require: • Defense against man in the middle • A way to provide identify to microservices, so it can provide access control • Auditing – who access what and when • Istio provides that at scale while: • No change needs to be made to app code • Integrate with existing security systems • Build security on top of untrusted networks
  • 24. Security – Identity in Istio • Identity is fundamental in any security infrastructure • Citadel manages identities with certificates in SPIFFE format • SPIFFE – open-standard for identities in cloud native domain • https://www.slideshare.net/prabathsiriwardena/cloud-native-identity-with-spiffe • Istio uses SPIRE – an implementation of SPIFFE • In k8s, the SPIFFE identity is in the form of spiffe://cluster.local/ns/<namespace>/sa/<serviceAcctName> • e.g spiffe://cluster.local/ns/default/sa/a-microservice • Citadel automates key & certificate rotation at scale
  • 25. Security – Identity Lifecycle on K8s K8s API Server watch for SAs 1. Citadel watches k8s api for ServiceAccounts, then generates cert. & key-pairs 2. Citadel mounts the relevant cert. & key pair with a k8s secret to the Pod 3. Citadel watches the certificates and rotates them by re-writing the k8s secret 4. Pilot generates map of which identity is authorized to run what services Products Microservice Pod SA products Gen/Rotate cert/KP for products microservices certs the Istio-proxy Envoy container App container SA products secret Istio-certs secret Secure naming products <-> SPIFFE://clus..
  • 26. Security – Microservices authentication • Service-to-service authentication with citadel generated certificates – upgrades channel to be encrypted • Pilot watches Policies & DestinationRules, and updates the proxies with how to perform authentication • Mutual TLS – In addition, called microservice validates the caller client certificates • App can be http, while mTLS auth. occurs transparently - no handling of certificates in code • End-user authentication enable proxies to validate user’s JWT tokens before reaching the app
  • 27. Security – AuthenticationPolicy & DestinationRule kind: "DestinationRule" metadata: name: ”a-microservice" spec: host: a-microservice.bar.svc.cluster.local trafficPolicy: tls: mode: DISABLE portLevelSettings: - port: number: 8080 tls: mode: ISTIO_MUTUAL kind: "Policy" metadata: name: ”a-microservice" spec: targets: - name: a-microservice.bar… ports: - number: 8080 peers: - mtls: {} DEMO Currently, Istio supports only mTLS is, thus DestinationRules must be used if AuthPolicy requires mTLS
  • 28. Security – End User Authentication kind: "Policy" metadata: name: "jwt-example" spec: targets: - name: httpbin origins: - jwt: issuer: "testing@secure.istio.io" jwksUri: "https://...” <– jwt web key set to verify the token principalBinding: USE_ORIGIN JWKS is a set of keys containing the public keys that should be used to verify any JWT
  • 29. Security – Microservices Authorization • Toggle with RbacConfig singleton API resource instasnce • Configure with ServiceRole & ServiceRoleBinding • ServiceRole defines the permission e.g. Service names, HTTP methods • ServiceRoleBinding can refer a user, group or service • In mTLS, caller microservice validates server identity is authorized to run it • Istio Authorization is like WAF, while NetworkPolicy is on L3-L4 • End-user authorization – Istio refer JWT claims in Istio RBAC role bindings kind: ServiceRole metadata: name: books-review-reader namespace: default spec: rules: - services: [”a-microservice.ns"] paths: ["*/reviews"] methods: ["GET”,”HEAD”] constratins: - key: destaintion.labels[“version”] value: [“v1”,”v2”] (- key: ip/port/namespace/user/headers) kind: ServiceRoleBinding metadata: name: allow-reviews-to-product-ms namespace: default spec: subjects: - user: "service-account-a" roleRef: kind: ServiceRole name: books-review-reader
  • 30. Security – Microservices Authorization kind: ServiceRole metadata: name: reviews-reader namespace: default spec: rules: - services: [”reviews.ns"] paths: ["*/reviews"] methods: ["GET”,”HEAD”] constratins: - key: destaintion.labels[“version”] value: [“v1”,”v2”] (- key: ip/port/namespace/user/headers) kind: ServiceRoleBinding metadata: name: allow-reviews-to-product namespace: default spec: subjects: - user: ”product-service-account" roleRef: kind: ServiceRole name: reviews-reader
  • 31. Observability – Polcies & Telemetry • Mixer provides telemetry collection and policy enforcement • Policies such as Rate limits & black/white listing • Envoy checks Mixer for policies for each requests (with cache) • Envoy buffers telemetry on requests, and deliver to Mixer • Like Pilot, Mixer abstracts away policy & telemetry infra backends • Mixer holds a shared cache in case external backends are unavailable • Telemetry collected from Envoys is attribute based.
  • 32. Observability - Monitoring Microservice Pod Envoy container kind: prometheus metadata: name: handler namespace: istio-system spec: metrics: - name: request_total instance_name: requestcount.metric.istio-system kind: COUNTER label_names: - destination_service - response_code Handler def. Who scrape what from mixer kind: metric metadata: name: requestcount namespace: istio-system spec: dimensions: destination_service: destination.service.host . . response_code: response.code | 200 value: "1" What to report Mixer Bind handler to metric According to Rule kind: rule metadata: name: promhttp namespace: istio-system spec: actions: - handler: handler.prometheus instances: - requestcount.metric match: context.protocol == "http" Envoy request attributes Handlers e.g. Fluentd, denier…
  • 33. Observability - Tracing • Tracing is usually based on aggregating spans - when and where the request was in the microservices path • Envoy supports Zipkin (or Zipkin compatible e.g. Jaeger) and Lightstep – Both OpenTracing API based • Istio comes with Jaeger (ingest & visualize) as default • Envoy sidecars generate and propagate B3 Headers and send them to Jaeger • It is the Application responsibility to propagate these headers (OpenTracing instrumentation) • In SpringBoot2 you can import opentracing-spring-jaeger-cloud-starter • NodeJs npm install jaeger-client | npm install zipkin / zipkin-instrumentation-express • Some do all the work for you / in other you need to build a tracer that propagates/sends B3 Headers
  • 34. Observability – Monitoring & Tracing App container Sidecar µService A Pod (HTTP/s Service) Mixer Scape Visualize Report metrics App container Sidecar µService A Pod (HTTP/s Service) App container Sidecar µService A Pod (TCP Service) Telemetry Sidecar span App. component span Aggregated view Report opentracing spans
  • 35. Observability – A Word about Kiali Service Mesh Observability
  • 36. Observability – Debugging the mesh • istioctl proxy-status - Pilot & Envoys sync status • Istioctl proxy-status <pod-name> - Envoy | Pilot configuration diff • istioctl authn tls-check – debugging mTLS authentication • Istioctl proxy-config cluster / endpoint – show services and their endpoints in envoys config • Istioctl proxy-config route – route configuration of envoy
  • 37. Multicluster MESH K Hosting K8s Cluster Multicluster – Separate meetup Istio-system Istio Cont. plane exposed with I/LBs Root CA K Hosting K8s Cluster Istio-system Istio-remote K Hosting K8s Cluster Istio-system Istio-remote VM / Bare metal Envoy Sign certificates Mesh expansion Register Sidecar Mesh expansion / Multicluster requires Pods ips available outside the cluster. E.g. aws_vpc_cni, gke native clusters
  • 38. Google Cloud & Istio • Integration with Stackdriver for metrics and logging • Traffic Director – Multicloud/Hybrid managed Istio Service Mesh • Integration with Google Cloud Endpoints