1 of 36

Istio to the rescue

Techorama 2021�Ricardo Castro

https://mccricardo.com

@mccricardo

2 of 36

Agenda

  • Microservices
  • Service Mesh
  • Istio
    • Traffic Management
    • Security
    • Observability

https://mccricardo.com

@mccricardo

3 of 36

The great transition

Big ball of things

Certainly, some storage

Small thingy

Small thingy

Small thingy

Flashy storage

Flashy storage

Flashy storage

The monolith

The microservices

https://mccricardo.com

@mccricardo

4 of 36

Why do we do it?

  • Maintainability and scalability
  • Loose coupling
  • Deployability independence
  • Organization around business capabilities
  • Small team ownership

https://mccricardo.com

@mccricardo

5 of 36

Is it all sunshine and rainbows?

  • Faster delivery
  • Isolation
  • Scaling
  • Culture
  • Flexibility
  • Service discovery
  • Load balancing
  • Fault tolerance
  • Distributed tracing
  • Metrics
  • Security

https://mccricardo.com

@mccricardo

6 of 36

Mesh what?

A mesh network is a local network topology in which the infrastructure nodes (i.e. bridges, switches and other infrastructure devices) connect directly, dynamically and non-hierarchically to as many other nodes as possible and cooperate with one another to efficiently route data from/to clients.

https://mccricardo.com

@mccricardo

7 of 36

Service Mesh

A service mesh is the connective tissue between our services that adds additional capabilities like traffic control, service discovery, load balancing, resilience, observability, security, and so on.

A service mesh allows applications to offload these capabilities from application-level libraries and allow developers to focus on differentiating business logic.

https://mccricardo.com

@mccricardo

8 of 36

Service Mesh

Service proxy

A service proxy is a proxy on which an application service relies for additional capabilities. The service calls through the service proxy any time it needs to communicate with the outside world (i.e., over the network). The proxy acts as an intermediary or interceptor that can add capabilities like automatic retries, timeouts, circuit breaker, service discovery, security, and more.

Sidecar

A service that is attached to a parent application and provides supporting features for the application. The sidecar also shares the same lifecycle as the parent application, being created and retired alongside the parent. The sidecar pattern is sometimes referred to as the sidekick pattern and is a decomposition pattern.

https://mccricardo.com

@mccricardo

9 of 36

Service Mesh

Image source: https://bit.ly/2HczDpq

https://mccricardo.com

@mccricardo

10 of 36

Istio

Istio provides behavioral insights and operational control over the service mesh as a whole, offering a complete solution to satisfy the diverse requirements of microservice applications.

Istio makes it easy to create a network of deployed services with load balancing, service-to-service authentication, monitoring, and more, with few or no code changes in service code. We add Istio support to services by deploying a special sidecar proxy throughout our environment that intercepts all network communication between microservices, then configure and manage Istio using its control plane functionality.

Istio is designed for extensibility and meets diverse deployment needs.

https://mccricardo.com

@mccricardo

11 of 36

Istio Architecture

Image source: https://bit.ly/3efLlhI

https://mccricardo.com

@mccricardo

12 of 36

Envoy

High-performance proxy developed in C++ to mediate all inbound and outbound traffic for all services in the service mesh.

It’s deployed as a sidecar to the relevant service in the same Kubernetes pod. This deployment allows Istio to extract a wealth of signals about traffic behavior as attributes. Istio can, in turn, use these attributes to enforce policy decisions, and send them to monitoring systems to provide information about the behavior of the entire mesh.

The sidecar proxy model also allows us to add Istio capabilities to an existing deployment with no need to rearchitect or rewrite code.

https://mccricardo.com

@mccricardo

13 of 36

Istiod

Istio control plane.

Istiod provides service discovery, configuration and certificate management.

Istiod converts high level routing rules that control traffic behavior into Envoy-specific configurations, and propagates them to the sidecars at runtime.

https://mccricardo.com

@mccricardo

14 of 36

Traffic Management

Istio has support for traffic rules that allow us to easily control the flow of traffic and API requests between services.

With these type of features there are some traffic-control patterns that can be taken advantage like, canary deployments, dark launches or A/B tests.

Big internet companies like Netflix, Amazon, or Facebook use these patterns frequently.

Concepts: virtual services, destination rules, gateways, service Entries, and network resilience and fault injection.

https://mccricardo.com

@mccricardo

15 of 36

Traffic Management: Virtual Service

https://mccricardo.com

@mccricardo

16 of 36

Traffic Management: Virtual Service

https://mccricardo.com

@mccricardo

17 of 36

Traffic Management: Destination Rule

https://mccricardo.com

@mccricardo

18 of 36

Traffic Management: Gateway

https://mccricardo.com

@mccricardo

19 of 36

Traffic Management: Service Entry

https://mccricardo.com

@mccricardo

20 of 36

Traffic Management: Network Resilience

https://mccricardo.com

@mccricardo

21 of 36

Traffic Management: Fault Injection

https://mccricardo.com

@mccricardo

22 of 36

Security

Image source: https://bit.ly/3nPo0GO

https://mccricardo.com

@mccricardo

23 of 36

Security: Architecture

Image source: https://bit.ly/3nPo0GO

https://mccricardo.com

@mccricardo

24 of 36

Security: Authentication

Istio provides two types of authentication:

  • Peer authentication
  • Request authentication

https://mccricardo.com

@mccricardo

25 of 36

Security: Peer Authentication

https://mccricardo.com

@mccricardo

26 of 36

Security: Request Authentication

https://mccricardo.com

@mccricardo

27 of 36

Security: Authorization

Image source: https://bit.ly/3xKhd5I

https://mccricardo.com

@mccricardo

28 of 36

Security: Authorization Policies

https://mccricardo.com

@mccricardo

29 of 36

Security: Authorization Policies

https://mccricardo.com

@mccricardo

30 of 36

Security: Authorization Policies

https://mccricardo.com

@mccricardo

31 of 36

Observability

Istio generates detailed telemetry for all service communications within a mesh.

It provides observability of service behavior, empowering operators to troubleshoot, maintain, and optimize their applications – without imposing any additional burdens on service developers.

Operators gain a deeper understanding of how services are interacting, both with other services and with the Istio components themselves.

https://mccricardo.com

@mccricardo

32 of 36

Observability: Metrics

Types of metrics:

  • Proxy-level
  • Service-level
  • Control plane

https://mccricardo.com

@mccricardo

33 of 36

Observability: Distributed traces

Image source: https://bit.ly/3efAd4c

https://mccricardo.com

@mccricardo

34 of 36

Observability: Logs

https://mccricardo.com

@mccricardo

35 of 36

And much more...

  • Multicluster mesh
  • Istio CNI plugin
  • VM: service credential distribution
  • WebAssembly extension
  • Request classification
  • Custom Envoy filters
  • DNS proxying
  • ...

https://mccricardo.com

@mccricardo

36 of 36

Thank you!

  • Senior Site Reliability Engineer at Farfetch (We’re hiring)
  • DevOps Porto meetup co-organizer
  • DevOpsDays Portugal conference co-organizer
  • CKAD and CKA by the CNCF
  • Strong believer in culture and teamwork
  • Open source passionate (former Mozilla contributor)
  • Taekwondo amateur
  • Metal lover
  • Where to find me:
    • https://mccricardo.com
    • @mccricardo
    • Linkedin: Ricardo Castro

https://mccricardo.com

@mccricardo