ben ebsworth
Service Mesh

Istio "Service Mesh" Topologies

Overview of some common Istio Service Mesh topologies and configuration examples and diagrams

#technology#kubernetes#service mesh#istio

Ingress

Istio ingress flow background
Step 1 / 6

Istio Service Mesh

Given a Kubernetes Namespace has been configured to allow for Istio sidecar injection, then services deployed into this namespace with be accompanied by an Envoy Sidecar Proxy. In this way the service will be augmented into the Service Mesh.

kubectl get pods
NAME                              READY   STATUS    RESTARTS   AGE
api-auth-5f74b8c466-4fcl6         2/2     Running   0          1h
api-information-bdc664c59-dtscd   2/2     Running   0          1h

The 2/2 signifies that the given Pod has two containers, one being the microservice application and the other being the sidecar proxy.

Egress - Basic

Istio egress flow (basic, sidecar direct) background
Step 1 / 4

Service Mesh Egress - Sidecar Direct

An Istio service mesh will operate as a whitelist filter for all traffic egressing from the mesh. Consequently we need to add ServiceEntry resources to effectively allow traffic out of the service mesh. There is a mechanism to break out of this default behavior, where we can enable certain subnets to bypass the Envoy sidecar when making extern/upstream requests. It is enabled by add the following annotation to your Deployment resource as follows:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: microservice-without-istio-egress
spec:
  replicas: 1
  selector:
    matchLabels:
      app: microservice-without-istio-egress
  template:
    metadata:
      ...
      annotations:
        ...
        traffic.sidecar.istio.io/excludeOutboundIPRanges: 0.0.0.0/0
        ...
      ...

Egress - Advanced

Istio egress flow (advanced, egress gateway) background
Step 1 / 8

ServiceMesh - Egress Gateways

A more complex service mesh topology can be deployed which facilitates enabling more robust security boundaries. By having a egressgateway service act as a "gateway" out of the mesh, it is possible to enforce traffic flows via NetworkPolicy to only allow egress from the egressgateway service. This prevents a malicious actor bypassing the default routing behavior that services within the mesh will use.