refactor(consul): 将服务配置中的meta字段迁移为tags格式

统一将Consul服务配置中的traefik相关元数据从meta字段迁移到tags数组格式
新增entrypoints配置以明确指定web入口点
This commit is contained in:
fanfpy 2025-07-01 17:00:31 +08:00
parent da3f845591
commit 302fbbc11b
6 changed files with 30 additions and 24 deletions

View File

@ -7,10 +7,11 @@
"timeout": "5s" "timeout": "5s"
}, },
"id": "data-service-1", "id": "data-service-1",
"meta": { "tags": [
"traefik_enable": "true", "traefik.enable=true",
"traefik_http_routers_data_service_rule": "PathPrefix('/api/data')" "traefik.http.routers.data-service.rule=PathPrefix('/api/data')",
}, "traefik.http.routers.data-service.entrypoints=web"
],
"name": "data-service", "name": "data-service",
"port": 8000 "port": 8000
} }

View File

@ -7,10 +7,11 @@
"timeout": "5s" "timeout": "5s"
}, },
"id": "emotion-service-1", "id": "emotion-service-1",
"meta": { "tags": [
"traefik_enable": "true", "traefik.enable=true",
"traefik_http_routers_emotion_service_rule": "PathPrefix('/api/emotion')" "traefik.http.routers.emotion-service.rule=PathPrefix('/api/emotion')",
}, "traefik.http.routers.emotion-service.entrypoints=web"
],
"name": "emotion-service", "name": "emotion-service",
"port": 8002 "port": 8002
} }

View File

@ -7,10 +7,11 @@
"timeout": "5s" "timeout": "5s"
}, },
"id": "frontend-1", "id": "frontend-1",
"meta": { "tags": [
"traefik_enable": "true", "traefik.enable=true",
"traefik_http_routers_frontend_rule": "PathPrefix('/')" "traefik.http.routers.frontend.rule=PathPrefix('/')",
}, "traefik.http.routers.frontend.entrypoints=web"
],
"name": "frontend", "name": "frontend",
"port": 80 "port": 80
} }

View File

@ -7,10 +7,11 @@
"timeout": "5s" "timeout": "5s"
}, },
"id": "quant-service-1", "id": "quant-service-1",
"meta": { "tags": [
"traefik_enable": "true", "traefik.enable=true",
"traefik_http_routers_quant_service_rule": "PathPrefix('/api/quant')" "traefik.http.routers.quant-service.rule=PathPrefix('/api/quant')",
}, "traefik.http.routers.quant-service.entrypoints=web"
],
"name": "quant-service", "name": "quant-service",
"port": 8001 "port": 8001
} }

View File

@ -7,10 +7,11 @@
"timeout": "5s" "timeout": "5s"
}, },
"id": "recommend-service-1", "id": "recommend-service-1",
"meta": { "tags": [
"traefik_enable": "true", "traefik.enable=true",
"traefik_http_routers_recommend_service_rule": "PathPrefix('/api/recommend')" "traefik.http.routers.recommend-service.rule=PathPrefix('/api/recommend')",
}, "traefik.http.routers.recommend-service.entrypoints=web"
],
"name": "recommend-service", "name": "recommend-service",
"port": 8003 "port": 8003
} }

View File

@ -7,10 +7,11 @@
"timeout": "5s" "timeout": "5s"
}, },
"id": "user-service-1", "id": "user-service-1",
"meta": { "tags": [
"traefik_enable": "true", "traefik.enable=true",
"traefik_http_routers_user_service_rule": "PathPrefix('/api/user')" "traefik.http.routers.user-service.rule=PathPrefix('/api/user')",
}, "traefik.http.routers.user-service.entrypoints=web"
],
"name": "user-service", "name": "user-service",
"port": 8004 "port": 8004
} }