Skip to main content
Networking & service meshLesson 7 of 11

Service Mesh ① Sidecars and Mutual Authentication

This lesson uses Istio, a popular service mesh, as the example. Turn on one setting for a namespace, and without changing app code, traffic becomes encrypted, identity-checked, and recorded. Follow what happens behind the scenes.

EncryptionNone (plaintext)
Peer identity checkApp does it
ObservabilityPer app
shop namespaceweb appCallerProxyEnvoyProxyEnvoyapi appReceiveristiodConfig · certsOperatorkubectl · KialiKialiTraffic graphUnmeshed podNo sidecarPlaintext
RequestResponse / reportWatchAppears in a later step

What you will learn

  • Istio injection is a per-namespace setting that applies to new pods
  • All traffic passes through sidecar proxies
  • The different roles of istiod (control plane) and proxies (data plane)
  • How mTLS encrypts and verifies identity without app code changes
  • The gap when talking to pods without a sidecar

Try it yourself​

kubectl label namespace shop istio-injection=enabled # Enable automatic sidecar injection
kubectl get namespace -L istio-injection # Which namespaces have it on
kubectl rollout restart deployment -n shop # Recreate existing pods to attach sidecars
kubectl get pods -n shop # READY 2/2 means the proxy is attached
kubectl get peerauthentication -A # mTLS mode (PERMISSIVE, STRICT)

Check yourself

  1. You labelled the shop namespace with istio-injection=enabled, but its running pods still show READY 1/1. Why?
  2. Which statement matches how Istio splits its work?
  3. Pods in a namespace without the injection label call into the mesh. What happens by default, and what changes with STRICT?

Further reading: Istio concepts · Istio security (mTLS) · Istio observability · Kiali · Blocking and Allowing Traffic (NetworkPolicy)