Istio
hard 29 minIstio 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
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
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
criticalHTTP timeouts are off by default. One slow service holds every caller.
Wrongroute: ratings# no timeoutRighttimeout: 2sroute: ratingsRetries everywhere
criticalThey multiply along the chain and finish off a service in trouble.
Wrongattempts: 5 # in every serviceRightattempts: 1 # one layerperTryTimeout: 800msPermissive forever
majorThe mesh accepts plain text and policies by identity cannot see who called.
Wrongmode: PERMISSIVERightmode: STRICT # namespace by namespaceHTTP rule without a waypoint
majorIn ambient mode ztunnel cannot read methods. With a selector the rule turns into DENY.
Wrongselector: {app: orders}methods: [GET]RighttargetRefs: Service ordersmethods: [GET]One service account for all
majorIdentity comes from the service account. If all share one, no rule can tell them apart.
WrongserviceAccountName: defaultRightserviceAccountName: 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.