SlideShare a Scribd company logo
Istio Playground
@adersberger @qaware
Our network today
— Optimize first: Switch network off and on again and
use 5GHz networking
— Plan A: Local installation
— Plan B: Use GKE clusters
— Plan C: Use Katacoda
— Plan D: Steamworks
Workshop Prerequisites
— Bash
— git Client
— Text editor (like VS.Code)
Baby Step: Grab the Code
git clone https://github.com/adersberger/istio-playground
cd istio-playground/code
Baby Step: Install a (local) Kubernetes Cluster
https://www.docker.com/community-edition
— Preferences: enable Kubernetes
— Preferences: increase resource usage to 3 cores and 8
GB memory
The Ultimate Guide to Fix Strange Kubernetes Behavior
Setup Kubernetes Environment
# Switch k8s context
kubectl config use-context docker-for-desktop
# Deploy k8s dashboard
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
# Extract id of default service account token (referred as TOKENID)
kubectl describe serviceaccount default
# Grab token and insert it into k8s Dashboard UI auth dialog
kubectl describe secret TOKENID
# Start local proxy
kubectl proxy --port=8001 &
# Open k8s Dashboard
open http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
Deploy Istio
curl -L https://git.io/getLatestIstio | sh -
cd istio-1.0.1
export PATH=$PWD/bin:$PATH
istioctl version
# deploy Istio
# (demo setting, default deployment is via Helm)
kubectl apply -f install/kubernetes/istio-demo.yaml
kubectl get pods -n istio-system
# label default namespace to be auto-sidecarred
kubectl label namespace default istio-injection=enabled
kubectl get namespace -L istio-injection
Deploy Sample Application (BookInfo)
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl get pods
istioctl create -f samples/bookinfo/networking/bookinfo-gateway.yaml
istioctl get gateways
open http://localhost/productpage
Hands-on
Why?
Istio Playground
Istio Playground
Atomic Architecture
Istio Playground
Istio Playground
Library Bloat
Istio Playground
Istio Playground
Istio Playground
Istio Playground
Se!ing the Sails with Istio 1.0.1
Istio Playground
Istio Abstractions
Sample Application: BookInfo1
1 
Istio BookInfo Sample (https://istio.io/docs/examples/bookinfo)
Istio Playground
Bookinfo: Gateway
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: bookinfo-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
Bookinfo: VirtualService
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bookinfo
spec:
hosts:
- "*"
gateways:
- bookinfo-gateway
http:
- match:
- uri:
exact: /productpage
- uri:
exact: /login
- uri:
exact: /logout
- uri:
prefix: /api/v1/products
route:
- destination:
host: productpage
port:
number: 9080
Bookinfo: DestinationRule
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: productpage
spec:
host: productpage
subsets:
- name: v1
labels:
version: v1
Hands-on: Have a look around
the YAMLs and Dashboard
Expose Istio Observability Tools
#Metrics: Prometheus
kubectl expose deployment prometheus --name=prometheus-expose 
--port=9090 --target-port=9090 --type=LoadBalancer -n=istio-system
#Metrics: Grafana
kubectl expose deployment grafana --name=grafana-expose 
--port=3000 --target-port=3000 --type=LoadBalancer -n=istio-system
open http://localhost:3000/d/1/istio-dashboard
#Tracing: Jaeger
kubectl expose deployment istio-tracing --name=tracing-expose 
--port=16686 --target-port=16686 --type=LoadBalancer -n=istio-system
open http://localhost:16686
#Tracing: ServiceGraph
kubectl expose service servicegraph --name=servicegraph-expose 
--port=8088 --target-port=8088 --type=LoadBalancer -n=istio-system
open http://localhost:8088/force/forcegraph.html
open http://localhost:8088/dotviz
Deploy Missing Observability Feature: Log Analysis
(EFK)
cd .. #go to istio-playground/code
kubectl apply -f logging-stack.yaml
kubectl get pods -n=logging
kubectl expose deployment kibana --name=kibana-expose 
--port=5601 --target-port=5601 --type=LoadBalancer -n=logging
istioctl create -f fluentd-istio.yaml
Deploy Missing Observability Feature: Log Analysis
(EFK)
open http://localhost:5601/app/kibana
— Perform some requests to the BookInfo application
— Use * as the index pattern
— Select @timestamp as the time filter field name
fluentd-istio.yaml (1/3)
# Configuration for logentry instances
apiVersion: "config.istio.io/v1alpha2"
kind: logentry
metadata:
name: newlog
namespace: istio-system
spec:
severity: '"info"'
timestamp: request.time
variables:
source: source.labels["app"] | source.service | "unknown"
user: source.user | "unknown"
destination: destination.labels["app"] | destination.service | "unknown"
responseCode: response.code | 0
responseSize: response.size | 0
latency: response.duration | "0ms"
monitored_resource_type: '"UNSPECIFIED"'
fluentd-istio.yaml (2/3)
# Configuration for a fluentd handler
apiVersion: "config.istio.io/v1alpha2"
kind: fluentd
metadata:
name: handler
namespace: istio-system
spec:
address: "fluentd-es.logging:24224"
fluentd-istio.yaml (3/3)
# Rule to send logentry instances to the fluentd handler
apiVersion: "config.istio.io/v1alpha2"
kind: rule
metadata:
name: newlogtofluentd
namespace: istio-system
spec:
match: "true" # match for all requests
actions:
- handler: handler.fluentd
instances:
- newlog.logentry
Stimulate!
slapper -rate 4 -targets ./target -workers 2 -maxY 15s
Download from: https://github.com/adersberger/slapper/
releases/tag/0.1
Slapper2
in action
2 
Key bindings:
q, ctrl-c - quit
r - reset stats
k - increase rate by 100 RPS
j - decrease rate by 100 RPS
Hands-on
Observability Outlook: Kiali
Observability Outlook: Kiali (macOS setup)
brew install gettext
brew link --force gettext
# follow k8s setup guide: https://www.kiali.io/gettingstarted
kubectl expose deployment kiali --name=kiali-expose 
--port=20001 --target-port=20001 --type=LoadBalancer -n=istio-system
open http://localhost:20001
# login with admin/admin
Release Pa!erns
Sample Application Recap
Sample Desination Rule
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: reviews
spec:
host: reviews
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
- name: v3
labels:
version: v3
Canary Releases: A/B Testing
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- match:
- headers:
end-user:
exact: jason
route:
- destination:
host: reviews
subset: v2
- route:
- destination:
host: reviews
subset: v1
Canary Releases: A/B Testing
cd istio-1.0.1
istioctl create -f samples/bookinfo/networking/virtual-service-all-v1.yaml
istioctl create -f samples/bookinfo/networking/destination-rule-all.yaml
istioctl replace -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
#open BookInfo application and login as user jason (password jason)
open http://localhost/productpage
— login as "jason" / "jason" leads to v2 (black stars)
— anonymous user leads to v1 (no stars)
Canary Releases: Rolling Upgrade
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v1
weight: 50
- destination:
host: reviews
subset: v3
weight: 50
istioctl replace -f samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
Canary Releases: Blue/Green
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v3
istioctl replace -f samples/bookinfo/networking/virtual-service-reviews-v3.yaml
istioctl get routerules
Hands-on
Time to Play!
Traffic Management Resiliency Security Observability
Request Routing Timeouts mTLS Metrics
Load Balancing Circuit Breaker Role-Based Access Control Logs
Traffic Shifting Health Checks (active,
passive)
Workload Identity Traces
Traffic Mirroring Retries Authentication Policies
Service Discovery Rate Limiting CORS Handling
Ingress, Egress Delay & Fault Injection TLS Termination, SNI
API Specification Connection Pooling
Multicluster Mesh
https://istio.io/docs/tasks
https://istio.io/about/feature-stages
Hands-on
Istio Playground
FAQ
Q: How does the Envoy proxy intercept requests?
A: With IPtable rules (alls rules pointing to envoy)
Q: How does the auto-sidecar magic work?
A: With an Istio admission controller enhancing the
deployments
Q: How can I list all Istio custom resource definitions
and commands?
A: kubectl api-resources
Q: I can't see any metrics, logs, traces. What should I do?
A: Restart istio-telemetry Deploment or kubectl replace
-f fluentd-istio.yaml

More Related Content

PDF
Container Network Interface: Network Plugins for Kubernetes and beyond
PDF
Kubernetes Networking
PPT
Docker Multi Host Networking, Rachit Arora, IBM
PPTX
How to Achieve Canary Deployment on Kubernetes
PDF
IP Virtual Server(IPVS) 101
PDF
Driving containerd operations with gRPC
PDF
KubeCon EU 2016: A Practical Guide to Container Scheduling
PPTX
Introduction to CNI (Container Network Interface)
Container Network Interface: Network Plugins for Kubernetes and beyond
Kubernetes Networking
Docker Multi Host Networking, Rachit Arora, IBM
How to Achieve Canary Deployment on Kubernetes
IP Virtual Server(IPVS) 101
Driving containerd operations with gRPC
KubeCon EU 2016: A Practical Guide to Container Scheduling
Introduction to CNI (Container Network Interface)

What's hot (20)

PDF
Load Balancing 101
PDF
Network plugins for kubernetes
PDF
Introduction to CircleCI
PDF
Simplify Networking for Containers
PDF
Kubernetes Networking
PDF
Docker 1.12 networking deep dive
PDF
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
PDF
Containerd: Building a Container Supervisor by Michael Crosby
PDF
Kubernetes Networking - Giragadurai Vallirajan
PDF
DockerDay2015: Docker Networking
PDF
Build Your Own CaaS (Container as a Service)
PDF
Application-Based Routing
PDF
Automatically Renew Certificated In Your Kubernetes Cluster
PDF
Container Performance Analysis
PPTX
Docker Online Meetup #29: Docker Networking is Now GA
PDF
Docker network performance in the public cloud
PDF
Elk for applications on k8s
PDF
Scaling docker with kubernetes
PDF
IPTABLES Introduction
PDF
Kubernetes networking & Security
Load Balancing 101
Network plugins for kubernetes
Introduction to CircleCI
Simplify Networking for Containers
Kubernetes Networking
Docker 1.12 networking deep dive
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
Containerd: Building a Container Supervisor by Michael Crosby
Kubernetes Networking - Giragadurai Vallirajan
DockerDay2015: Docker Networking
Build Your Own CaaS (Container as a Service)
Application-Based Routing
Automatically Renew Certificated In Your Kubernetes Cluster
Container Performance Analysis
Docker Online Meetup #29: Docker Networking is Now GA
Docker network performance in the public cloud
Elk for applications on k8s
Scaling docker with kubernetes
IPTABLES Introduction
Kubernetes networking & Security
Ad

Similar to Istio Playground (20)

PDF
Ports, pods and proxies
PDF
Cloud-native applications with Java and Kubernetes - Yehor Volkov
PDF
Gluster Containerized Storage for Cloud Applications
PDF
Gluster Contenarized Storage for Cloud Applications
PDF
Web scale infrastructures with kubernetes and flannel
PPTX
Kubernetes walkthrough
PDF
DevOpSec_KubernetesOperatorUsingJava.pdf
PDF
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
PDF
Istio By Example (extended version)
PDF
Istio by Example (extended version)
PPTX
Dayta AI Seminar - Kubernetes, Docker and AI on Cloud
PPTX
k8s practice 2023.pptx
PPTX
Orchestration with Kubernetes
PDF
Istio Playground
PDF
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
PPTX
TechUG - Kubernetes 101 - May 2020
PDF
kubernetes for beginners
PDF
Prometheus on NKS
PPTX
The Challenges of Becoming Cloud Native
PDF
Shakr - Container CI/CD with Google Cloud Platform
Ports, pods and proxies
Cloud-native applications with Java and Kubernetes - Yehor Volkov
Gluster Containerized Storage for Cloud Applications
Gluster Contenarized Storage for Cloud Applications
Web scale infrastructures with kubernetes and flannel
Kubernetes walkthrough
DevOpSec_KubernetesOperatorUsingJava.pdf
OpenShift Meetup - Tokyo - Service Mesh and Serverless Overview
Istio By Example (extended version)
Istio by Example (extended version)
Dayta AI Seminar - Kubernetes, Docker and AI on Cloud
k8s practice 2023.pptx
Orchestration with Kubernetes
Istio Playground
Node Interactive: Node.js Performance and Highly Scalable Micro-Services
TechUG - Kubernetes 101 - May 2020
kubernetes for beginners
Prometheus on NKS
The Challenges of Becoming Cloud Native
Shakr - Container CI/CD with Google Cloud Platform
Ad

More from QAware GmbH (20)

PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
PDF
Frontends mit Hilfe von KI entwickeln.pdf
PDF
Mit ChatGPT Dinosaurier besiegen - Möglichkeiten und Grenzen von LLM für die ...
PDF
50 Shades of K8s Autoscaling #JavaLand24.pdf
PDF
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
PPTX
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
PDF
Down the Ivory Tower towards Agile Architecture
PDF
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
PDF
Make Developers Fly: Principles for Platform Engineering
PDF
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
PDF
Was kommt nach den SPAs
PDF
Cloud Migration mit KI: der Turbo
PDF
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
PDF
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
PDF
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
PDF
Kubernetes with Cilium in AWS - Experience Report!
PDF
50 Shades of K8s Autoscaling
PDF
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
PDF
Service Mesh Pain & Gain. Experiences from a client project.
PDF
50 Shades of K8s Autoscaling
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
Frontends mit Hilfe von KI entwickeln.pdf
Mit ChatGPT Dinosaurier besiegen - Möglichkeiten und Grenzen von LLM für die ...
50 Shades of K8s Autoscaling #JavaLand24.pdf
Make Agile Great - PM-Erfahrungen aus zwei virtuellen internationalen SAFe-Pr...
Fully-managed Cloud-native Databases: The path to indefinite scale @ CNN Mainz
Down the Ivory Tower towards Agile Architecture
"Mixed" Scrum-Teams – Die richtige Mischung macht's!
Make Developers Fly: Principles for Platform Engineering
Der Tod der Testpyramide? – Frontend-Testing mit Playwright
Was kommt nach den SPAs
Cloud Migration mit KI: der Turbo
Migration von stark regulierten Anwendungen in die Cloud: Dem Teufel die See...
Aus blau wird grün! Ansätze und Technologien für nachhaltige Kubernetes-Cluster
Endlich gute API Tests. Boldly Testing APIs Where No One Has Tested Before.
Kubernetes with Cilium in AWS - Experience Report!
50 Shades of K8s Autoscaling
Kontinuierliche Sicherheitstests für APIs mit Testkube und OWASP ZAP
Service Mesh Pain & Gain. Experiences from a client project.
50 Shades of K8s Autoscaling

Recently uploaded (20)

PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPT
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
PPT
Reliability_Chapter_ presentation 1221.5784
PPT
Quality review (1)_presentation of this 21
PDF
Foundation of Data Science unit number two notes
PPTX
Moving the Public Sector (Government) to a Digital Adoption
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PPTX
Major-Components-ofNKJNNKNKNKNKronment.pptx
PPTX
Introduction to Knowledge Engineering Part 1
PDF
Lecture1 pattern recognition............
PPTX
Computer network topology notes for revision
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
CEE 2 REPORT G7.pptxbdbshjdgsgjgsjfiuhsd
PPT
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Data_Analytics_and_PowerBI_Presentation.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
STUDY DESIGN details- Lt Col Maksud (21).pptx
Chapter 3 METAL JOINING.pptnnnnnnnnnnnnn
Reliability_Chapter_ presentation 1221.5784
Quality review (1)_presentation of this 21
Foundation of Data Science unit number two notes
Moving the Public Sector (Government) to a Digital Adoption
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
Major-Components-ofNKJNNKNKNKNKronment.pptx
Introduction to Knowledge Engineering Part 1
Lecture1 pattern recognition............
Computer network topology notes for revision
Galatica Smart Energy Infrastructure Startup Pitch Deck
Miokarditis (Inflamasi pada Otot Jantung)
CEE 2 REPORT G7.pptxbdbshjdgsgjgsjfiuhsd
Chapter 2 METAL FORMINGhhhhhhhjjjjmmmmmmmmm
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb

Istio Playground

  • 2. Our network today — Optimize first: Switch network off and on again and use 5GHz networking — Plan A: Local installation — Plan B: Use GKE clusters — Plan C: Use Katacoda — Plan D: Steamworks
  • 3. Workshop Prerequisites — Bash — git Client — Text editor (like VS.Code)
  • 4. Baby Step: Grab the Code git clone https://github.com/adersberger/istio-playground cd istio-playground/code
  • 5. Baby Step: Install a (local) Kubernetes Cluster https://www.docker.com/community-edition — Preferences: enable Kubernetes — Preferences: increase resource usage to 3 cores and 8 GB memory
  • 6. The Ultimate Guide to Fix Strange Kubernetes Behavior
  • 7. Setup Kubernetes Environment # Switch k8s context kubectl config use-context docker-for-desktop # Deploy k8s dashboard kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml # Extract id of default service account token (referred as TOKENID) kubectl describe serviceaccount default # Grab token and insert it into k8s Dashboard UI auth dialog kubectl describe secret TOKENID # Start local proxy kubectl proxy --port=8001 & # Open k8s Dashboard open http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login
  • 8. Deploy Istio curl -L https://git.io/getLatestIstio | sh - cd istio-1.0.1 export PATH=$PWD/bin:$PATH istioctl version # deploy Istio # (demo setting, default deployment is via Helm) kubectl apply -f install/kubernetes/istio-demo.yaml kubectl get pods -n istio-system # label default namespace to be auto-sidecarred kubectl label namespace default istio-injection=enabled kubectl get namespace -L istio-injection
  • 9. Deploy Sample Application (BookInfo) kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml kubectl get pods istioctl create -f samples/bookinfo/networking/bookinfo-gateway.yaml istioctl get gateways open http://localhost/productpage
  • 11. Why?
  • 22. Se!ing the Sails with Istio 1.0.1
  • 25. Sample Application: BookInfo1 1  Istio BookInfo Sample (https://istio.io/docs/examples/bookinfo)
  • 27. Bookinfo: Gateway apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: bookinfo-gateway spec: selector: istio: ingressgateway # use istio default controller servers: - port: number: 80 name: http protocol: HTTP hosts: - "*"
  • 28. Bookinfo: VirtualService apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: bookinfo spec: hosts: - "*" gateways: - bookinfo-gateway http: - match: - uri: exact: /productpage - uri: exact: /login - uri: exact: /logout - uri: prefix: /api/v1/products route: - destination: host: productpage port: number: 9080
  • 29. Bookinfo: DestinationRule apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: productpage spec: host: productpage subsets: - name: v1 labels: version: v1
  • 30. Hands-on: Have a look around the YAMLs and Dashboard
  • 31. Expose Istio Observability Tools #Metrics: Prometheus kubectl expose deployment prometheus --name=prometheus-expose --port=9090 --target-port=9090 --type=LoadBalancer -n=istio-system #Metrics: Grafana kubectl expose deployment grafana --name=grafana-expose --port=3000 --target-port=3000 --type=LoadBalancer -n=istio-system open http://localhost:3000/d/1/istio-dashboard #Tracing: Jaeger kubectl expose deployment istio-tracing --name=tracing-expose --port=16686 --target-port=16686 --type=LoadBalancer -n=istio-system open http://localhost:16686 #Tracing: ServiceGraph kubectl expose service servicegraph --name=servicegraph-expose --port=8088 --target-port=8088 --type=LoadBalancer -n=istio-system open http://localhost:8088/force/forcegraph.html open http://localhost:8088/dotviz
  • 32. Deploy Missing Observability Feature: Log Analysis (EFK) cd .. #go to istio-playground/code kubectl apply -f logging-stack.yaml kubectl get pods -n=logging kubectl expose deployment kibana --name=kibana-expose --port=5601 --target-port=5601 --type=LoadBalancer -n=logging istioctl create -f fluentd-istio.yaml
  • 33. Deploy Missing Observability Feature: Log Analysis (EFK) open http://localhost:5601/app/kibana — Perform some requests to the BookInfo application — Use * as the index pattern — Select @timestamp as the time filter field name
  • 34. fluentd-istio.yaml (1/3) # Configuration for logentry instances apiVersion: "config.istio.io/v1alpha2" kind: logentry metadata: name: newlog namespace: istio-system spec: severity: '"info"' timestamp: request.time variables: source: source.labels["app"] | source.service | "unknown" user: source.user | "unknown" destination: destination.labels["app"] | destination.service | "unknown" responseCode: response.code | 0 responseSize: response.size | 0 latency: response.duration | "0ms" monitored_resource_type: '"UNSPECIFIED"'
  • 35. fluentd-istio.yaml (2/3) # Configuration for a fluentd handler apiVersion: "config.istio.io/v1alpha2" kind: fluentd metadata: name: handler namespace: istio-system spec: address: "fluentd-es.logging:24224"
  • 36. fluentd-istio.yaml (3/3) # Rule to send logentry instances to the fluentd handler apiVersion: "config.istio.io/v1alpha2" kind: rule metadata: name: newlogtofluentd namespace: istio-system spec: match: "true" # match for all requests actions: - handler: handler.fluentd instances: - newlog.logentry
  • 37. Stimulate! slapper -rate 4 -targets ./target -workers 2 -maxY 15s Download from: https://github.com/adersberger/slapper/ releases/tag/0.1
  • 38. Slapper2 in action 2  Key bindings: q, ctrl-c - quit r - reset stats k - increase rate by 100 RPS j - decrease rate by 100 RPS
  • 41. Observability Outlook: Kiali (macOS setup) brew install gettext brew link --force gettext # follow k8s setup guide: https://www.kiali.io/gettingstarted kubectl expose deployment kiali --name=kiali-expose --port=20001 --target-port=20001 --type=LoadBalancer -n=istio-system open http://localhost:20001 # login with admin/admin
  • 44. Sample Desination Rule apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: name: reviews spec: host: reviews subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 - name: v3 labels: version: v3
  • 45. Canary Releases: A/B Testing apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - match: - headers: end-user: exact: jason route: - destination: host: reviews subset: v2 - route: - destination: host: reviews subset: v1
  • 46. Canary Releases: A/B Testing cd istio-1.0.1 istioctl create -f samples/bookinfo/networking/virtual-service-all-v1.yaml istioctl create -f samples/bookinfo/networking/destination-rule-all.yaml istioctl replace -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml #open BookInfo application and login as user jason (password jason) open http://localhost/productpage — login as "jason" / "jason" leads to v2 (black stars) — anonymous user leads to v1 (no stars)
  • 47. Canary Releases: Rolling Upgrade apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - route: - destination: host: reviews subset: v1 weight: 50 - destination: host: reviews subset: v3 weight: 50 istioctl replace -f samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  • 48. Canary Releases: Blue/Green apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - route: - destination: host: reviews subset: v3 istioctl replace -f samples/bookinfo/networking/virtual-service-reviews-v3.yaml istioctl get routerules
  • 50. Time to Play! Traffic Management Resiliency Security Observability Request Routing Timeouts mTLS Metrics Load Balancing Circuit Breaker Role-Based Access Control Logs Traffic Shifting Health Checks (active, passive) Workload Identity Traces Traffic Mirroring Retries Authentication Policies Service Discovery Rate Limiting CORS Handling Ingress, Egress Delay & Fault Injection TLS Termination, SNI API Specification Connection Pooling Multicluster Mesh https://istio.io/docs/tasks https://istio.io/about/feature-stages
  • 53. FAQ Q: How does the Envoy proxy intercept requests? A: With IPtable rules (alls rules pointing to envoy) Q: How does the auto-sidecar magic work? A: With an Istio admission controller enhancing the deployments Q: How can I list all Istio custom resource definitions and commands? A: kubectl api-resources Q: I can't see any metrics, logs, traces. What should I do? A: Restart istio-telemetry Deploment or kubectl replace -f fluentd-istio.yaml