From 302fbbc11bae972e74475126f192771d1a76b77c Mon Sep 17 00:00:00 2001 From: fanfpy Date: Tue, 1 Jul 2025 17:00:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor(consul):=20=E5=B0=86=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=B8=AD=E7=9A=84meta=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E4=B8=BAtags=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一将Consul服务配置中的traefik相关元数据从meta字段迁移到tags数组格式 新增entrypoints配置以明确指定web入口点 --- consul/config/data-service.json | 9 +++++---- consul/config/emotion-service.json | 9 +++++---- consul/config/frontend.json | 9 +++++---- consul/config/quant-service.json | 9 +++++---- consul/config/recommend-service.json | 9 +++++---- consul/config/user-service.json | 9 +++++---- 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/consul/config/data-service.json b/consul/config/data-service.json index 437bd59..a70e02d 100644 --- a/consul/config/data-service.json +++ b/consul/config/data-service.json @@ -7,10 +7,11 @@ "timeout": "5s" }, "id": "data-service-1", - "meta": { - "traefik_enable": "true", - "traefik_http_routers_data_service_rule": "PathPrefix('/api/data')" - }, + "tags": [ + "traefik.enable=true", + "traefik.http.routers.data-service.rule=PathPrefix('/api/data')", + "traefik.http.routers.data-service.entrypoints=web" + ], "name": "data-service", "port": 8000 } diff --git a/consul/config/emotion-service.json b/consul/config/emotion-service.json index 5d91c51..fa6e12a 100644 --- a/consul/config/emotion-service.json +++ b/consul/config/emotion-service.json @@ -7,10 +7,11 @@ "timeout": "5s" }, "id": "emotion-service-1", - "meta": { - "traefik_enable": "true", - "traefik_http_routers_emotion_service_rule": "PathPrefix('/api/emotion')" - }, + "tags": [ + "traefik.enable=true", + "traefik.http.routers.emotion-service.rule=PathPrefix('/api/emotion')", + "traefik.http.routers.emotion-service.entrypoints=web" + ], "name": "emotion-service", "port": 8002 } diff --git a/consul/config/frontend.json b/consul/config/frontend.json index a2df057..50825fb 100644 --- a/consul/config/frontend.json +++ b/consul/config/frontend.json @@ -7,10 +7,11 @@ "timeout": "5s" }, "id": "frontend-1", - "meta": { - "traefik_enable": "true", - "traefik_http_routers_frontend_rule": "PathPrefix('/')" - }, + "tags": [ + "traefik.enable=true", + "traefik.http.routers.frontend.rule=PathPrefix('/')", + "traefik.http.routers.frontend.entrypoints=web" + ], "name": "frontend", "port": 80 } diff --git a/consul/config/quant-service.json b/consul/config/quant-service.json index 88b2e83..faff493 100644 --- a/consul/config/quant-service.json +++ b/consul/config/quant-service.json @@ -7,10 +7,11 @@ "timeout": "5s" }, "id": "quant-service-1", - "meta": { - "traefik_enable": "true", - "traefik_http_routers_quant_service_rule": "PathPrefix('/api/quant')" - }, + "tags": [ + "traefik.enable=true", + "traefik.http.routers.quant-service.rule=PathPrefix('/api/quant')", + "traefik.http.routers.quant-service.entrypoints=web" + ], "name": "quant-service", "port": 8001 } diff --git a/consul/config/recommend-service.json b/consul/config/recommend-service.json index 9818eda..b277a6f 100644 --- a/consul/config/recommend-service.json +++ b/consul/config/recommend-service.json @@ -7,10 +7,11 @@ "timeout": "5s" }, "id": "recommend-service-1", - "meta": { - "traefik_enable": "true", - "traefik_http_routers_recommend_service_rule": "PathPrefix('/api/recommend')" - }, + "tags": [ + "traefik.enable=true", + "traefik.http.routers.recommend-service.rule=PathPrefix('/api/recommend')", + "traefik.http.routers.recommend-service.entrypoints=web" + ], "name": "recommend-service", "port": 8003 } diff --git a/consul/config/user-service.json b/consul/config/user-service.json index a94219e..37c25a8 100644 --- a/consul/config/user-service.json +++ b/consul/config/user-service.json @@ -7,10 +7,11 @@ "timeout": "5s" }, "id": "user-service-1", - "meta": { - "traefik_enable": "true", - "traefik_http_routers_user_service_rule": "PathPrefix('/api/user')" - }, + "tags": [ + "traefik.enable=true", + "traefik.http.routers.user-service.rule=PathPrefix('/api/user')", + "traefik.http.routers.user-service.entrypoints=web" + ], "name": "user-service", "port": 8004 }