File tree Expand file tree Collapse file tree 6 files changed +102
-2
lines changed Expand file tree Collapse file tree 6 files changed +102
-2
lines changed Original file line number Diff line number Diff line change 55## Related PR/s
66
77## Checklist
8-
98- [ ] I tested and it works
9+
10+ <!-- Extra checks based on use case -->
11+
12+ <!-- New Stack Introduction
13+ - [ ] The Stack has been included in CI Workflow
14+ -->
15+
16+ <!-- New Service Introduction
17+ - [ ] Service has resource limits and reservations
18+ - [ ] Service has placement constraints or is global
19+ - [ ] Service is restartable
20+ - [ ] The restart is zero-downtime
21+ - [ ] Service is not bound to one specific node (e.g. via files or volumes)
22+ - [ ] Relevant OPS E2E Test for this stack were added
23+ -->
Original file line number Diff line number Diff line change @@ -132,7 +132,11 @@ services:
132132 - traefik.http.middlewares.ops_ratelimit.ratelimit.average=${TRAEFIK_RATELIMIT_AVG}
133133 - traefik.http.middlewares.ops_ratelimit.ratelimit.burst=${TRAEFIK_RATELIMIT_BURST}
134134 - traefik.http.middlewares.ops_ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=1
135-
135+ # Platform user auth: Use this middleware to enforce only authenticated users
136+ # https://doc.traefik.io/traefik/middlewares/http/forwardauth
137+ - traefik.http.middlewares.authenticated_platform_user.forwardauth.address=http://${WEBSERVER_HOST}:${WEBSERVER_PORT}/v0/auth:check
138+ - traefik.http.middlewares.authenticated_platform_user.forwardauth.trustForwardHeader=true
139+ - traefik.http.middlewares.authenticated_platform_user.forwardauth.authResponseHeaders=Set-Cookie,osparc-sc2
136140 networks:
137141 public: null
138142 monitored: null
Original file line number Diff line number Diff line change @@ -34,3 +34,6 @@ OPS_TRAEFIK_LOGLEVEL=${OPS_TRAEFIK_LOGLEVEL}
3434
3535PUBLIC_NETWORK = ${ PUBLIC_NETWORK }
3636MONITORED_NETWORK = ${ MONITORED_NETWORK }
37+
38+ WEBSERVER_HOST = ${ WEBSERVER_HOST }
39+ WEBSERVER_PORT = ${ WEBSERVER_PORT }
Original file line number Diff line number Diff line change 1+ .DEFAULT_GOAL := help
2+
3+ # Internal VARIABLES ------------------------------------------------
4+ # STACK_NAME defaults to name of the current directory. Should not to be changed if you follow GitOps operating procedures.
5+ STACK_NAME = $(notdir $(shell pwd) )
6+ TEMP_COMPOSE =.stack.${STACK_NAME}.yaml
7+ REPO_BASE_DIR := $(shell git rev-parse --show-toplevel)
8+
9+ # TARGETS --------------------------------------------------
10+ include ${REPO_BASE_DIR}/scripts/common.Makefile
11+
12+ .PHONY : up # # Deploys stack
13+ up : ${TEMP_COMPOSE} .init .env
14+ docker stack deploy --with-registry-auth --prune --compose-file $< ${STACK_NAME}
15+
16+ .PHONY : up-dalco # # Deploys stack for Dalco Cluster
17+ up-dalco : up
18+
19+ .PHONY : up-aws
20+ up-aws : up
21+
22+ .PHONY : up-master # # Deploys stack on master cluster
23+ up-master : up
24+
25+ .PHONY : up-public # # Deploys stack on public cluster
26+ up-public : up
27+
28+ .PHONY : up-local # # Deploys stack on local deployment
29+ up-local : up
30+
31+ # Helpers -------------------------------------------------
32+
33+ .PHONY : ${TEMP_COMPOSE}
34+ ${TEMP_COMPOSE} : docker-compose.yml .env
35+ ${REPO_BASE_DIR} /scripts/docker-stack-config.bash -e .env $< > $@
Original file line number Diff line number Diff line change 1+ version : " 3.7"
2+
3+ services :
4+ manual :
5+ image : ${VENDOR_MANUAL_IMAGE}
6+ init : true
7+ hostname : " {{.Node.Hostname}}-{{.Task.Slot}}"
8+ deploy :
9+ replicas : ${VENDOR_MANUAL_REPLICAS}
10+ placement :
11+ constraints :
12+ - node.labels.simcore==true
13+ resources :
14+ limits :
15+ cpus : " 1"
16+ memory : 2G
17+ reservations :
18+ cpus : " 0.5"
19+ memory : 1G
20+ update_config :
21+ parallelism : 1
22+ order : start-first
23+ failure_action : continue
24+ delay : 10s
25+ labels :
26+ - traefik.enable=true
27+ - traefik.docker.network=${PUBLIC_NETWORK}
28+ - traefik.http.services.vendor_manual.loadbalancer.server.port=${VENDOR_MANUAL_PORT}
29+ - traefik.http.routers.vendor_manual.entrypoints=https
30+ - traefik.http.routers.vendor_manual.tls=true
31+ - traefik.http.routers.vendor_manual.rule=Host(`${VENDOR_MANUAL_DOMAIN}`)
32+ - traefik.http.routers.vendor_manual.middlewares=ops_gzip@swarm, authenticated_platform_user@swarm
33+ networks :
34+ - public
35+
36+ networks :
37+ public :
38+ external : true
39+ name : ${PUBLIC_NETWORK}
Original file line number Diff line number Diff line change 1+ VENDOR_MANUAL_IMAGE = ${ VENDOR_MANUAL_IMAGE }
2+ VENDOR_MANUAL_REPLICAS = ${ VENDOR_MANUAL_REPLICAS }
3+ VENDOR_MANUAL_DOMAIN = ${ VENDOR_MANUAL_DOMAIN }
4+ VENDOR_MANUAL_PORT = ${ VENDOR_MANUAL_PORT }
5+ PUBLIC_NETWORK = ${ PUBLIC_NETWORK }
You can’t perform that action at this time.
0 commit comments