Skip to content

Commit 17ce575

Browse files
committed
sticky
1 parent 23b5131 commit 17ce575

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

services/docker-compose.yml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -872,36 +872,16 @@ services:
872872
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.entrypoints=http
873873
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.priority=6
874874
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_retry
875-
# Sticky cookie only for specific endpoints
876-
- traefik.http.middlewares.${SWARM_STACK_NAME}_webserver_sticky_cookie.sticky.cookie=true
877-
- traefik.http.middlewares.${SWARM_STACK_NAME}_webserver_sticky_cookie.sticky.cookie.samesite=lax
878-
- traefik.http.middlewares.${SWARM_STACK_NAME}_webserver_sticky_cookie.sticky.cookie.httponly=true
879-
- traefik.http.middlewares.${SWARM_STACK_NAME}_webserver_sticky_cookie.sticky.cookie.secure=true
880-
# Per-endpoint routers for sticky cookie
881-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects.rule=Path(`/v0/projects`)
882-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects.entrypoints=http
883-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects.service=${SWARM_STACK_NAME}_webserver
884-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_sticky_cookie, ${SWARM_STACK_NAME}_webserver_retry
885-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects_clone.rule=Path(`/v0/projects:clone`)
886-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects_clone.entrypoints=http
887-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects_clone.service=${SWARM_STACK_NAME}_webserver
888-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_projects_clone.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_sticky_cookie, ${SWARM_STACK_NAME}_webserver_retry
889-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_project_node_stop.rule=PathRegexp(`^/v0/projects/[0-9a-fA-F-]+/nodes/[0-9a-fA-F-]+:stop`)
890-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_project_node_stop.entrypoints=http
891-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_project_node_stop.service=${SWARM_STACK_NAME}_webserver
892-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_project_node_stop.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_sticky_cookie, ${SWARM_STACK_NAME}_webserver_retry
893-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_size.rule=PathRegexp(`^/v0/storage/locations/[0-9]+/paths/.+:size`)
894-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_size.entrypoints=http
895-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_size.service=${SWARM_STACK_NAME}_webserver
896-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_size.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_sticky_cookie, ${SWARM_STACK_NAME}_webserver_retry
897-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_batch_delete.rule=PathRegexp(`^/v0/storage/locations/[0-9]+/-/paths:batchDelete`)
898-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_batch_delete.entrypoints=http
899-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_batch_delete.service=${SWARM_STACK_NAME}_webserver
900-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_batch_delete.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_sticky_cookie, ${SWARM_STACK_NAME}_webserver_retry
901-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_export_data.rule=PathRegexp(`^/v0/storage/locations/[0-9]+/export-data`)
902-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_export_data.entrypoints=http
903-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_export_data.service=${SWARM_STACK_NAME}_webserver
904-
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky_storage_export_data.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_sticky_cookie, ${SWARM_STACK_NAME}_webserver_retry
875+
# Create a dedicated sticky service for specific endpoints
876+
- traefik.http.services.${SWARM_STACK_NAME}_webserver_sticky.loadbalancer.server.port=8080
877+
- traefik.http.services.${SWARM_STACK_NAME}_webserver_sticky.loadbalancer.sticky.cookie.secure=true
878+
- traefik.http.services.${SWARM_STACK_NAME}_webserver_sticky.loadbalancer.sticky.cookie.httpOnly=true
879+
- traefik.http.services.${SWARM_STACK_NAME}_webserver_sticky.loadbalancer.sticky.cookie.sameSite=lax
880+
# Single consolidated router for all sticky endpoints
881+
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky.rule=Path(`/v0/projects`) || Path(`/v0/projects:clone`) || PathRegexp(`^/v0/projects/[0-9a-fA-F-]+/nodes/[0-9a-fA-F-]+:stop`) || PathRegexp(`^/v0/storage/locations/[0-9]+/paths/.+:size`) || PathRegexp(`^/v0/storage/locations/[0-9]+/-/paths:batchDelete`) || PathRegexp(`^/v0/storage/locations/[0-9]+/export-data`)
882+
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky.entrypoints=http
883+
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky.service=${SWARM_STACK_NAME}_webserver_sticky
884+
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_sticky.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_retry
905885
networks: &webserver_networks
906886
- default
907887
- interactive_services_subnet

0 commit comments

Comments
 (0)