From 5342ed08b38c001ac31011db1f4224b9aa1947f0 Mon Sep 17 00:00:00 2001 From: Teck Meng Date: Sun, 2 Jun 2024 09:47:11 +0800 Subject: [PATCH] Refactor traefik.yml to add placement constraint for postgres service --- swarm/services.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swarm/services.yml b/swarm/services.yml index c203ec5..fa2123a 100644 --- a/swarm/services.yml +++ b/swarm/services.yml @@ -51,6 +51,9 @@ services: networks: - traefik-public deploy: + placement: + constraints: + - node.labels.postgres.postgres_data == true labels: - traefik.enable=true - traefik.docker.network=traefik-public