Linkerd
medium 26 minLinkerd is a service mesh for Kubernetes that aims to be small.
Video lesson · Chapter 1 of 5
Give a parcel service a verifiable sender
Linkerd in 90 seconds
1:30Reel coming soon
Theory
Read or listen first. About 2 min.
What it is
Linkerd (say "linker-dee") is a service mesh: proxies on the path of every call, and a control plane that tells them where to send it and who may call whom. It is open source under the Apache License 2.0 and a graduated project of the Cloud Native Computing Foundation.
Its data plane is a micro-proxy written in Rust for this one job, placed as a sidecar in each pod. Its control plane has three main parts: the destination service, the identity service and the proxy injector.
It works with no configuration for the basics: add an annotation, restart the pods, and traffic between meshed pods is encrypted, balanced and measured.
Why it exists
Calls between microservices fail and slow down in ways nobody sees. The first need is usually plain: how many requests, how many fail, how slow, and from whom? The second is encryption with identity.
A general mesh such as Istio can do more and asks for more. Linkerd leaves features out on purpose, so that a small team can run it.
A short history
2016
Buoyant creates Linkerd, the first service mesh project. It joins the CNCF in January 2017.
September 2018
Linkerd 2.0, a complete rewrite: a Rust proxy and a control plane in Go, for Kubernetes.
July 2021
Linkerd becomes the first service mesh to graduate in the CNCF.
February 2024
With 2.15 the open source project stops publishing stable releases. Edge releases continue; stable ones come from vendors.
June 2026
Linkerd 2.20: balancing that reacts to rate limit answers, native sidecars as the default, and a smaller control plane.
Words to know
- Meshed pod
- A pod that has the Linkerd proxy.
- Outbound proxy
- The caller's side: discovery, balancing, retries, timeouts, circuit breaking.
- Inbound proxy
- The called side: checks authorization, limits rates.
- EWMA
- Exponentially weighted moving average, here of an endpoint's latency.
- Trust anchor
- The root certificate that all proxies trust.
- Issuer certificate
- The intermediate certificate with which the control plane signs proxy certificates.
- Opaque port
- A port whose traffic is passed on as plain TCP, without looking for HTTP.
- Golden metrics
- Success rate, requests per second, and latency.
- Edge release
- The project's own build, published about every week.
How it works
Step through the idea, or press Play.
Inject. An annotation adds the proxy to the pod
Understand it
Start here
A small bell on every door
Imagine a street with three workshops. Customers come and go, and nobody knows how many, how long they wait, or who they are. What is the smallest thing you could add to each door?
A bell is not a doorkeeper with a rule book. It is light, and that is the point.
The idea
What you get, and when
| Feature | Without configuration | Switched on by |
|---|---|---|
| mTLS between meshed pods | Yes | Nothing |
| Golden metrics | Yes | Nothing; the Viz extension shows them |
| Balancing per request by latency | Yes | Nothing |
| Retries and timeouts | No | Annotations on a Service or route |
| Circuit breaking | No | Annotations on a Service |
| Traffic split and header routes | No | HTTPRoute, GRPCRoute |
| Access rules | No: all is allowed | Policy resources, default policy |
| Local rate limits | No | HTTPLocalRateLimitPolicy |
Small proxy
Rust, made only to be a mesh sidecar. Memory safety removes a class of bugs.
On by default
Encryption and metrics need no rules, so they are not forgotten.
Latency-aware
Requests move away from slow pods within moments.
Kubernetes style
Gateway API routes, annotations, service accounts.
Fewer knobs
Less to learn, and less that can be set wrongly.
Clusters joined
Services of another cluster appear as local ones.
The ideas have their own pages: circuit breaker, retries, timeouts, service discovery, monitoring. Here we see how this product does them on Kubernetes.
Inside
Three parts and many proxies
Control plane and data plane
The control plane
| Part | Answers the question |
|---|---|
| Destination | Where are the endpoints, which identity must they show, and which policies and routes apply? |
| Identity | Is this proxy who it says? Then here is its certificate |
| Proxy injector | Does this new pod carry the annotation? Then add the proxy |
A pod joins the mesh
Since 2.20 the proxy is a native sidecar by default. Kubernetes starts it before the application and stops it after, which solves two old problems: calls that failed at start because the proxy was not ready, and jobs that never ended because the proxy ran on.
Request
Who does what on one call
web calls orders
| Outbound (caller) | Inbound (called) |
|---|---|
| Finds endpoints | Checks authorization |
| Balances each request | Limits the rate, per pod |
| Retries, timeouts, circuit breaking | Passes to the app |
| Counts | Counts |
Balancing
Send it where it is quick now
Kubernetes balances connections. HTTP/2 and gRPC keep one connection open, so all requests of a client end up on one pod. Linkerd balances requests, over all endpoints of the Service, and prefers those with a low moving average of latency.
The moving average
Two limits. For plain TCP it can only balance connections. And calls to a pod address, or to a headless Service, are not balanced, because the caller has already chosen the pod. With 2.20 the balancer can also turn away from endpoints that answer 429 or RESOURCE_EXHAUSTED.
Resilience
Retries, timeouts, breakers
apiVersion: gateway.networking.k8s.io/v1kind: HTTPRoutemetadata: name: ratings-read namespace: shop annotations: retry.linkerd.io/http: gateway-error # 502, 503, 504 retry.linkerd.io/limit: "1" retry.linkerd.io/timeout: 300ms timeout.linkerd.io/request: 1sspec: parentRefs: - kind: Service group: "" name: ratings port: 80 rules: - matches: - method: GET path: {type: PathPrefix, value: /ratings}---apiVersion: v1kind: Servicemetadata: name: ratings namespace: shop annotations: balancer.linkerd.io/failure-accrual: consecutivespec: selector: {app: ratings} ports: - {port: 80, targetPort: 8080, appProtocol: http}Defaults, once switched on
| Setting | Default |
|---|---|
| Retries per request | 1 |
| Bodies that can be retried | Up to 64 KiB |
| Request timeout | None; when reached it is final, not retried |
| Retry timeout | None; when reached the try is cancelled and repeated |
| Failures in a row before a break | 7 |
| First penalty, longest penalty | 1 second, 1 minute |
| Jitter on penalties | Ratio 0.5 |
One endpoint's breaker
If all endpoints are out, requests fail with 503, or another backend of the route is used. The second policy, unified, also breaks when the success rate falls below 80% in 10 seconds and at least 5 answers came; those settings still carry alpha names.
Why failures in a row can miss a sick pod
Security
mTLS on, policy off
- 1
Trust anchor
The root. The one made by a default install ends after 365 days, and replacing it by hand takes care.
- 2
Issuer
Signed by the anchor, kept as a Kubernetes Secret that only identity can read. Also one year by default.
- 3
Proxy certificate
Bound to the pod's service account, 24 hours, renewed by the proxy.
- 4
Handshake
TLS 1.3 with a hybrid post-quantum key exchange, ML-KEM-768 with X25519.
By default the policy is all-unauthenticated: meshed traffic is encrypted, and plain text from outside the mesh is still accepted. Stricter defaults are all-authenticated, cluster-authenticated and deny. The audit mode allows and logs what would be refused: use it first.
apiVersion: policy.linkerd.io/v1beta3kind: Servermetadata: name: orders-http namespace: shopspec: podSelector: matchLabels: {app: orders} port: http proxyProtocol: HTTP/1 accessPolicy: audit # later: deny---apiVersion: policy.linkerd.io/v1alpha1kind: MeshTLSAuthenticationmetadata: name: web namespace: shopspec: identityRefs: - kind: ServiceAccount name: web---apiVersion: policy.linkerd.io/v1alpha1kind: AuthorizationPolicymetadata: name: orders-from-web namespace: shopspec: targetRef: group: policy.linkerd.io kind: Server name: orders-http requiredAuthenticationRefs: - group: policy.linkerd.io kind: MeshTLSAuthentication name: webProbes are allowed automatically as long as no route is attached to the Server; then you must allow them yourself. Pods that skip the proxy are not protected: high availability mode refuses to start annotated pods without it.
Protocols
HTTP, TCP and the ten seconds
The proxy looks at the first bytes to see whether a connection is HTTP. If it is not, or if the application already uses TLS, it passes the bytes on as TCP: still mTLS between proxies, but no requests, routes or retries.
What is this connection?
Telemetry
Counting the rings
linkerd check --pre # is the cluster ready?# Gateway API resources must be installed firstlinkerd install --crds | kubectl apply -f -linkerd install --ha | kubectl apply -f - # three replicas of the control planelinkerd checkkubectl annotate namespace shop linkerd.io/inject=enabledkubectl -n shop rollout restart deploy # pods get the proxy at creationlinkerd viz install | kubectl apply -f -linkerd viz stat-outbound -n shop deploy/web # before and after retrieslinkerd viz tap -n shop deploy/web # live samples of requestsOutbound numbers are shown per route, after retries, and per backend, before them. A route at 100% over a backend at 90% means that retries hide a problem. Linkerd measures what it sees from outside: it cannot look into the service, and application traces need the application to pass on headers.
Clusters
More than one cluster
A mirrored service through a gateway
| Mode | Path | Use it when |
|---|---|---|
| Hierarchical | Through a gateway in the target cluster | Only the gateway address is reachable |
| Flat (since 2.14) | Pod to pod | Clusters share a network; keeps the caller's identity |
| Federated | One service name over all clusters, pod to pod | Active-active copies of a service |
All clusters must share a trust anchor, so the default install of each, with its own anchor, cannot be joined.
Failure
What breaks how
| Failure | Effect | Preparation |
|---|---|---|
| Destination is down | Proxies use what they know; new targets cannot be found | High availability mode, three replicas |
| Identity is down | Nothing at first; after up to 24 hours certificates end | Alert early |
| Injector is down | HA: pods wait. Otherwise: pods start without a proxy | Choose on purpose; exempt kube-system |
| One proxy fails | Its pod is cut off | Replicas, resource requests |
| Anchor ended | All meshed calls fail | Rotate early; practise once |
Releases
Which build do you run?
The project publishes edge releases about every week; each 2.x version has a matching edge build (2.20 is edge-26.6.3). They are generally considered production ready, may change, and a few are marked as not recommended. Stable builds are made by vendors. The best known is Buoyant Enterprise for Linkerd: free to try, free in production for companies with fewer than 50 employees, paid above that. Read the terms before you choose.
Decide
When to choose it, and when not
Choose Linkerd when
- You run Kubernetes and want mTLS and metrics with little to learn
- gRPC load is uneven
- A small team will operate it
- Latency and memory of the proxy matter
- Sensible defaults are better than many options
Look elsewhere when
- You want a mesh without sidecars: Istio ambient or Cilium
- You need Envoy filters, fault injection of many kinds or WebAssembly plugins
- Most workloads are virtual machines
- You need free stable builds from the project itself
- Only traffic from outside matters: use a gateway
Neighbours
| Product | Alike | Different |
|---|---|---|
| Istio | mTLS, routes, policy | Envoy, sidecar or ambient, many more features and settings |
| Envoy | A proxy for services | General-purpose, in C++, needs a control plane |
| Consul | Discovery and mesh | Own registry, strong outside Kubernetes |
| Client libraries | Retries and breakers | In every language again, but no extra hop |
| API gateway | Limits, routes | For callers outside; works well in front of the mesh |
Summary
The whole topic in one minute.
Linkerd adds a small proxy to each pod. Encryption, per-request balancing by latency and metrics come at once; retries, timeouts, breakers, rate limits and access rules are annotations or resources that you add.
Know its edges: Kubernetes first, sidecars only, clients must be meshed for client-side features, plain text from outside is accepted until you forbid it, and certificates of the default installation end after a year. Stable builds come from vendors.
- A Rust micro-proxy per pod; mTLS, balancing and metrics at once.
- Outbound does balancing, retries and breakers; inbound does policy and limits.
- Balancing per request by latency; pair it with a breaker.
- Plain text is accepted until you set a policy; certificates of a default install end after a year.
- Edge builds from the project, stable builds from vendors.
Sources
- Linkerd: architecture
- Linkerd: automatic mTLS
- Linkerd: load balancing
- Linkerd: circuit breaking reference
- Linkerd: retries reference
- Linkerd: authorization policy
- Linkerd: protocol detection
- Linkerd: multi-cluster
- Linkerd: releases and versions
- Linkerd 2.20 announcement
- CNCF: Linkerd graduation
- Buoyant: pricing