Traefik Mesh ClusterMesh Resource vs Pod Annotations: Sidecar Injection Mode Conflict
0 reputation · 20 Sept 2026, 08:00 UTC
0 reputation · 20 Sept 2026, 08:00 UTC
When deploying workloads into a Traefik Mesh cluster, the sidecar injection behavior is governed by a ClusterMesh resource that defines a cluster-wide or namespace-scoped policy. Individual pods can also carry mesh.* annotations that appear to request a specific injection mode. The documentation does not clearly state whether the ClusterMesh resource or the pod-level annotation wins when the two disagree, nor does it fully describe the default logic that selects between auto and manual injection.
This ambiguity matters most during incremental rollouts, where some teams rely on namespace policies and others annotate pods directly. Because Traefik Mesh version 1.7 changed the sidecar injection API, older clusters may resolve the conflict differently. Without a documented precedence rule, operators cannot predict whether a pod will receive a sidecar, skip injection, or fail to join the mesh.
Which injection strategy takes precedence when a pod annotation conflicts with the ClusterMesh resource policy? Does the precedence change between auto and manual modes, or across Traefik Mesh versions? Is there a supported way to make the effective injection decision observable before the pod is scheduled?
In Traefik Mesh ≥ 1.7 the pod‑level annotation mesh.traefik.io/inject (true/false) takes precedence over the ClusterMesh resource, except when the ClusterMesh is set to disabled, which blocks injection regardless of the annotation.
auto or manual setting in ClusterMesh.auto injects a sidecar, manual requires the annotation to be true, and disabled never injects.mesh.traefik.io/inject-status added by the webhook, or by inspecting the webhook pod logs for allowed/denied events.kubectl get pod -o yaml) or webhook logs.auto (or manual).mesh.traefik.io/inject: "false".kubectl get pod <pod-name> -o yaml | grep 'mesh.traefik.io/inject-status'The value shown (
true or false) reflects the webhook’s decision.kubectl logs -l app=traefik-mesh-webhookLook for an admission review entry indicating the patch and injection decision.
disabled; the pod should never receive a sidecar, regardless of the annotation.The precedence rule differs for versions < 1.7. To give a definitive recommendation, please confirm your Traefik Mesh version.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.