Traefik Mesh mTLS enforcement after partial Docker Swarm upgrade
0 reputation · 25 Mar 2024, 18:15 UTC
0 reputation · 25 Mar 2024, 18:15 UTC
Traefik Mesh enforces service-to-service mTLS using certificates issued by the mesh control plane and routing rules carried on Docker Swarm service labels. Enabling or disabling mTLS requires changes to both the static configuration and the relevant service labels, and the mesh does not automatically convert existing plaintext traffic to encrypted traffic during an upgrade.
If an upgrade fails partway, some mesh proxy tasks may run the new control-plane policy while others continue with the previous configuration. Because label changes apply only after tasks restart, the cluster can temporarily enforce mTLS on some service paths and allow plaintext on others, producing TLS handshake failures. The control plane and data plane must also remain version-compatible, and mismatched versions may silently reject configuration.
Assuming a Traefik Mesh release where mTLS is controlled through static configuration and Docker labels, what is the correct sequence for upgrading control-plane and data-plane components so that mTLS policy becomes effective consistently? Must every mesh-enabled service task be restarted before the new mTLS setting is considered active? How should operators confirm that all service paths are enforcing the same mTLS state after a partial upgrade?
36775 reputation · 25 Mar 2024, 18:44 UTC
Upgrade the control plane and data plane to one version-compatible target release while leaving the mTLS setting unchanged. Only after every mesh task is running the target image digest should you change the static mTLS setting and the mTLS label on each mesh-enabled service, then restart all mesh proxy or data-plane tasks and every mesh-enabled service task. Enable enforcement last. Yes—every mesh-enabled service task must be restarted or replaced before the new mTLS setting is active cluster-wide.
Handshake failures after a partial upgrade are usually a mixed enforcement state: some proxy tasks enforce the new mTLS policy while neighboring tasks still accept plaintext, or mismatched control-plane and data-plane versions silently reject configuration. Docker Swarm label edits do not reach running tasks, so old tasks can keep serving plaintext after new tasks require TLS.
Assumption: the target release supports a single mTLS on-or-off state without a transitional permissive mode. If it supports warn-only mode, the cutover can be safer; request that detail if you want to use it.
docker service ps.docker service ps for the mesh control-plane service, the mesh proxy or data-plane service, and each mesh-enabled service. Require identical target image digest, no failed tasks, and current state running.Does the target release support a permissive or warn-only mTLS mode, and what are the exact static-config key and label name? If yes, you can stage mTLS in warn-only mode before enforcing; if not, stage the configuration but do not enable enforcement until every task has restarted.
Uncertainty: exact key and label names and permissive-mode support are release-specific. Confirm them against the installed Traefik Mesh release before production changes.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.