AlgoViz

Istio

hard 29 min

Istio is a service mesh: proxies beside or below your services carry every call, and one control plane, istiod, gives them routes, limits, identities and access rules.

See it run

Rules, identity, canaries, retries and the ambient path.

Operations

A rule travels

From a file to every proxy.

Step 1 of 5

Apply

Our systemOperatoristiodnew routeProxy of webold rulesProxy of ordersold rules

The operator applies a route. Kubernetes stores it and istiod sees it.

Step 1: Apply

def reconcile(event):    config = read(kubernetes)    for proxy in connected:        part = compute(config, proxy)        push(proxy, part)
What it costs
Seconds, not instant
Where it happens
Control plane

istioctl proxy-status shows which proxies are not in step with istiod.

In the real world

The same istio doing real jobs. Pick one and step through it.

istiod fails for an hour.

Step 1 of 3

Calls go on

Our systemOperatoristioddownProxy of weblast rulesProxy of orderslast rules

Traffic works

Both proxies use their last configuration.

Step 1: Calls go on

Common mistakes

The bugs interviewers watch for, with the fix beside each.

  • No timeout

    critical

    HTTP timeouts are off by default. One slow service holds every caller.

    Wrong
    route: ratings# no timeout
    Right
    timeout: 2sroute: ratings
  • Retries everywhere

    critical

    They multiply along the chain and finish off a service in trouble.

    Wrong
    attempts: 5   # in every service
    Right
    attempts: 1   # one layerperTryTimeout: 800ms
  • Permissive forever

    major

    The mesh accepts plain text and policies by identity cannot see who called.

    Wrong
    mode: PERMISSIVE
    Right
    mode: STRICT   # namespace by namespace
  • HTTP rule without a waypoint

    major

    In ambient mode ztunnel cannot read methods. With a selector the rule turns into DENY.

    Wrong
    selector: {app: orders}methods: [GET]
    Right
    targetRefs: Service ordersmethods: [GET]
  • One service account for all

    major

    Identity comes from the service account. If all share one, no rule can tell them apart.

    Wrong
    serviceAccountName: default
    Right
    serviceAccountName: orders

Interview tips

  • How to explain it

    • Proxies carry, istiod writes.
    • Identity by certificate.
    • Rules as resources.
  • Choosing a mode

    • Ambient: little cost, L7 by choice.
    • Sidecar: every feature, own keys.
    • Both can mix.
  • Rollout

    • One namespace first.
    • Permissive, look, strict.
    • Timeouts on day one.
  • Before production

    • Two istiod replicas or more.
    • Revisions for upgrades.
    • An owner with time.