Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛⚗️: Traefik V3 syntax fixes #6257

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_dynamic_proxy_spec(
f"traefik.http.services.{scheduler_data.proxy_service_name}.loadbalancer.server.port": "80",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.entrypoints": "http",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.priority": "10",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.rule": f"hostregexp(`{scheduler_data.node_uuid}.services.{{host:.+}}`)",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.rule": f"HostRegexp(`{scheduler_data.node_uuid}\\.services\\.`)",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.middlewares": f"{dynamic_services_scheduler_settings.SWARM_STACK_NAME}_gzip@swarm, {scheduler_data.proxy_service_name}-security-headers",
"dynamic_type": "dynamic-sidecar", # tagged as dynamic service
}
Expand Down
2 changes: 1 addition & 1 deletion services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_modern_services_catchall.priority=3
- traefik.http.routers.${SWARM_STACK_NAME}_modern_services_catchall.entrypoints=http
# in theory the pattern should be uuid.services.OSPARC_DOMAIN, but anything could go through.. so let's catch everything
- traefik.http.routers.${SWARM_STACK_NAME}_modern_services_catchall.rule=hostregexp(`{node_uuid:.+}.services.{host:.+}`)
- traefik.http.routers.${SWARM_STACK_NAME}_modern_services_catchall.rule=HostRegexp(`(?i)[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\.services\.`)
# this tricks traefik into a 502 (bad gateway) since the service does not exist on this port
- traefik.http.services.${SWARM_STACK_NAME}_modern_services_catchall.loadbalancer.server.port=0
# this tricks traefik into returning a 503 (service unavailable) since the healthcheck will always return false
Expand Down
Loading