What is Istio?

What is Istio?

Istio started as a collaboration among three companies, Google, IBM, and Lyft to develop an open cloud service to connect, secure, manage and monitor a network of microservices regardless of platform, source or vendor.

In this blog, you will learn what Istio is, why it is used, and the problems it solves like traffic management, security, observability, and service-to-service communication in Kubernetes.

What is Istio?

Containerization has made microservices deployments simple and easier and the adoption of microservices is increasing day by day. Microservices architecture allows the developers to decouple a big application into smaller units and these smaller units talk to each other using API's.

Also, each microservice can be deployed by teams individually rather than waiting for the whole application to be developed for deployment.

Managing these microservice on a large scale poses the following challenges

  1. Discovering services - Finding a healthy service to route the traffic
  2. Balancing the request load - Evenly distribute the traffic across services
  3. Security - Ensuring the communication is encrypted and that the allowed services only communicate.
  4. Controlling Traffic - Routing traffic to new services using methods such as Canary.
  5. Handling Failures - Controlling retries for the failed requests and preventing failures.
  6. Monitoring - Tracking the performance and failures by logs, metrics, and traces.

Here is where Istio comes in to play.

Istio helps us solve the difficulties by acting as an infrastructure layer to manage the communication between services. You can call it a service mesh.

💡
A service mesh is a dedicated infrastructure layer within the platform that manages service-to-service communication.

Istio works very closely with the services using lightweight proxies to handle the traffic.

💡
The original Istio architecture is Sidecar, which means a proxy runs alongside each pod. Recently, they have introduced a new method called Ambient Mode which does not run as sidecar.

Also, the only supported platform for Istio is Kubernetes.

Core Features of Istio

The following are some of the important features of Istio.

1. Traffic Control

Istio has the Custom Resource Definitions (CRDs) to configure the settings to define how the traffic should flow.

The routing rules in Istio are configured using the Virtual Service Custom Resource.

In Virtual Service, we can control the traffic based on.

  1. Host
  2. Path
  3. Headers
  4. Labels

We can even split the traffic between different service versions to perform Canary or A/B testing, which means we can control how much traffic should be routed to each service.

💡
We can perform chaos engineering using Istio's fault injection. This allows us to add intentional delays and errors in requests to validate the stability and resilience of our system.

Another Custom Resource of the Istio is the Destination Rule, which allows us to configure the following settings.

  1. Timeout - How long should we wait for a request to resolve
  2. Retries - How many times does a request need to be retried for a failed request
  3. Circuit Breaking - What should you do if a service endpoint is unhealthy.
  4. Connection Pooling - How much traffic should be routed on a service.

2. Security

Istio uses strong cryptographic identities to ensure secure and encrypted communication between the services. (Follows SPIFFE framework and X.509 certificates)

Here, the Control Plane (Istiod) acts as a Certificate Authority (CA) to generate and manage the certificates. The data planes perform the mTLS handshake to ensure the identity.

Authorization Policy is another CRD that defines who should access the services.

  • We can define Authentication rules to cluster scoped or namespace scoped and
  • Allow or deny the authorization based on identity, source namespace, source IP, request method (GET, POST), headers, and JWT.

For authentication, Istio uses the following:

  • Validate the JWT tokens on the Ingress gateway or the services themselves.
  • Istio even works with the external OIDC providers like Keycloak, Auth0, etc.

3. Observability

Istio has built-in configurations to generate the telemetry of the traffic flow.

Istio will generate the following:

  1. Metrics
  2. Traces
  3. Logs

We can observe these using tools like Prometheus and Grafana.

Istio Real World Case Studies

Istio or service mesh is not new, a lot of organizations already use them. The following are some of the real case studies.

  1. Rappi initially built its own service mesh, though when the services increased to thousands of containers, it moved to Istio to manage it.
  2. Atlassian used to use Envoy proxy for the communication, but for the benefits of Istio Daemon, they have moved to Istio.
  3. eBay has thousands of running containers. To ensure network communication and security during the scaling, they have started using Istio.

There are more case studies available that you can refer to here.

How to get started with Istio

You can get started with Istio from here (sidecar mode)

You can also get started with Istio Ambient Mode Setup.

You can play around with a sample book info application from here

If you are interested in Service mesh tools, look at the list of best service mesh tools for microservices.

Also, you can look at linkerd a similar project by Cloud Native Computing Foundation which offers support for mesosphere DCOS.

About the author
devopscube

devopscube

Since 2014, we're a thriving DevOps community dedicated to helping DevOps Engineers grow with high-quality, in-depth articles, comprehensive learning paths, expert insights, and practical resources.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to DevOpsCube – Easy DevOps, SRE Guides & Reviews.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.