Linkerd
medium 26 minLinkerd is a service mesh for Kubernetes that aims to be small.
See it run
Joining the mesh, balancing, breaking, detecting, and allowing.
Operations
A pod joins
From an annotation to a certificate.
Step 1 of 5
New pod
Kubernetes asks the injector about the new pod. It carries the annotation.
Step 1: New pod
def start(pod): if pod.annotation("linkerd.io/inject") == "enabled": pod.add(proxy) key = proxy.make_key() cert = identity.sign(key, pod.service_account_token) redirect_tcp_through(proxy)- What it costs
- One restart
- Who does it
- One proxy a pod
The injector works when a pod is created, so restart pods after adding the annotation.
In the real world
The same linkerd doing real jobs. Pick one and step through it.
One client, 900 calls a second, three pods.
Step 1 of 2
Without a mesh
| Pod 1 | Pod 2 | Pod 3 | |
|---|---|---|---|
| plain | 900 | 0 | 0 |
One hot pod
One HTTP/2 connection, so one pod gets everything.
Step 1: Without a mesh
Common mistakes
The bugs interviewers watch for, with the fix beside each.
Forgetting the certificate dates
criticalThe default anchor and issuer end after a year, and then meshed calls fail.
Wronglinkerd install | kubectl apply -f -# and no alertRight# own anchor, cert-manager for the# issuer, alerts at 60 and 30 daysLatency balancing without a breaker
majorA pod that fails quickly looks like the best one.
Wrongannotations: {}Rightbalancer.linkerd.io/failure-accrual: consecutiveServer-first protocol on a normal port
majorDetection waits ten seconds for the client to speak.
Wrongport: 4222Rightport: 4222appProtocol: linkerd.io/opaqueRetrying writes
criticalA payment can be made twice when an answer is lost.
Wrongretry.linkerd.io/http: 5xx# on the whole ServiceRight# on a GET route onlyretry.linkerd.io/http: gateway-errorReading encryption as permission
majormTLS is on, but every caller is still allowed, also in plain text.
Wrong# default policyRightconfig.linkerd.io/default-inbound-policy: audit # then stricter
Interview tips
How to explain it
- A small proxy in each pod.
- Out: balance, retry, break.
- In: permit, limit.
Order of work
- Metrics first.
- Then breakers and timeouts.
- Then audit, then deny.
Reach for it when
- Small team on Kubernetes.
- gRPC is uneven.
- mTLS is required.
Before production
- HA control plane.
- Certificate alerts.
- Edge or vendor build decided.