Skip to content

Commit

Permalink
Add deployment for region michendorf
Browse files Browse the repository at this point in the history
  • Loading branch information
meytin1337 committed Feb 12, 2024
1 parent 13b41c4 commit 830acd2
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 94 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- main
- release/michendorf

jobs:
build-grafana:
Expand All @@ -20,8 +20,8 @@ jobs:
- run: >-
docker build .
-f Dockerfile.grafana
-t ghcr.io/klima-dashboard/data-tools:grafana
- run: docker push ghcr.io/klima-dashboard/data-tools:grafana
-t ghcr.io/klima-dashboard/data-tools:grafana-michendorf
- run: docker push ghcr.io/klima-dashboard/data-tools:grafana-michendorf

build-node-red:
runs-on: ubuntu-latest
Expand All @@ -36,16 +36,16 @@ jobs:
- run: >-
docker build .
-f Dockerfile.node-red
-t ghcr.io/klima-dashboard/data-tools:node-red
- run: docker push ghcr.io/klima-dashboard/data-tools:node-red
-t ghcr.io/klima-dashboard/data-tools:node-red-michendorf
- run: docker push ghcr.io/klima-dashboard/data-tools:node-red-michendorf

deploy:
runs-on: ubuntu-latest
env:
QUANTUM_USER: ${{ secrets.QUANTUM_USER }}
QUANTUM_PASSWORD: ${{ secrets.QUANTUM_PASSWORD }}
QUANTUM_ENDPOINT: "tpwd-klimadashboard"
QUANTUM_STACK: "data-tools"
QUANTUM_STACK: "data-tools-michendorf"
steps:
- uses: actions/checkout@v3
- run: |
Expand All @@ -55,4 +55,4 @@ jobs:
-e QUANTUM_PASSWORD \
-e QUANTUM_ENDPOINT \
--rm r.planetary-quantum.com/quantum-public/cli:2 \
quantum-cli stacks update --create --stack $QUANTUM_STACK --wait
quantum-cli stacks update --create --stack $QUANTUM_STACK --wait
111 changes: 52 additions & 59 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ version: "3.7"

services:
node-red-main:
image: ghcr.io/klima-dashboard/data-tools:node-red
image: ghcr.io/klima-dashboard/data-tools:node-red-michendorf
environment:
- TZ=Europe/Amsterdam
- ADMIN_PASSWORD=$$2b$$08$$v8d1BR/rftGMP6969SHnHO5wWNGirMJxRuKQ28wxPs56nc7A79r0G
- REDIRECT_URI=https://node-red.bad-belzig.klima-daten.de/auth/strategy/callback
- REDIRECT_URI=https://node-red.michendorf.klima-daten.de/auth/strategy/callback
networks:
public:
data-tools:
Expand All @@ -17,23 +17,23 @@ services:
restart_policy:
condition: on-failure
labels:
traefik.http.routers.node-red.rule: Host(`node-red.bad-belzig.klima-daten.de`)
traefik.http.routers.node-red.tls: "true"
traefik.http.routers.node-red.tls.certresolver: default
traefik.http.routers.node-red-michendorf.rule: Host(`node-red.michendorf.klima-daten.de`)
traefik.http.routers.node-red-michendorf.tls: "true"
traefik.http.routers.node-red-michendorf.tls.certresolver: default
traefik.docker.network: public
traefik.http.services.node-red.loadbalancer.server.port: 1880
traefik.http.services.node-red-michendorf.loadbalancer.server.port: 1880
traefik.enable: "true"
secrets:
- node-red-credential-secret
- node-red-keycloak-client-secret
- node-red-credential-secret-michendorf
- node-red-keycloak-client-secret-michendorf


node-red-1:
image: ghcr.io/klima-dashboard/data-tools:node-red
image: ghcr.io/klima-dashboard/data-tools:node-red-michendorf
environment:
- TZ=Europe/Amsterdam
- ADMIN_PASSWORD=$$2b$$08$$v8d1BR/rftGMP6969SHnHO5wWNGirMJxRuKQ28wxPs56nc7A79r0G
- REDIRECT_URI=https://node-red-1.bad-belzig.klima-daten.de/auth/strategy/callback
- REDIRECT_URI=https://node-red-1.michendorf.klima-daten.de/auth/strategy/callback
networks:
public:
data-tools:
Expand All @@ -44,22 +44,22 @@ services:
restart_policy:
condition: on-failure
labels:
traefik.http.routers.node-red-1.rule: Host(`node-red-1.bad-belzig.klima-daten.de`)
traefik.http.routers.node-red-1.tls: "true"
traefik.http.routers.node-red-1.tls.certresolver: default
traefik.http.routers.node-red-1-michendorf.rule: Host(`node-red-1.michendorf.klima-daten.de`)
traefik.http.routers.node-red-1-michendorf.tls: "true"
traefik.http.routers.node-red-1-michendorf.tls.certresolver: default
traefik.docker.network: public
traefik.http.services.node-red-1.loadbalancer.server.port: 1880
traefik.http.services.node-red-1-michendorf.loadbalancer.server.port: 1880
traefik.enable: "true"
secrets:
- node-red-credential-secret
- node-red-keycloak-client-secret
- node-red-credential-secret-michendorf
- node-red-keycloak-client-secret-michendorf

node-red-2:
image: ghcr.io/klima-dashboard/data-tools:node-red
image: ghcr.io/klima-dashboard/data-tools:node-red-michendorf
environment:
- TZ=Europe/Amsterdam
- ADMIN_PASSWORD=$$2b$$08$$v8d1BR/rftGMP6969SHnHO5wWNGirMJxRuKQ28wxPs56nc7A79r0G
- REDIRECT_URI=https://node-red-2.bad-belzig.klima-daten.de/auth/strategy/callback
- REDIRECT_URI=https://node-red-2.michendorf.klima-daten.de/auth/strategy/callback
networks:
public:
data-tools:
Expand All @@ -70,22 +70,22 @@ services:
restart_policy:
condition: on-failure
labels:
traefik.http.routers.node-red-2.rule: Host(`node-red-2.bad-belzig.klima-daten.de`)
traefik.http.routers.node-red-2.tls: "true"
traefik.http.routers.node-red-2.tls.certresolver: default
traefik.http.routers.node-red-2-michendorf.rule: Host(`node-red-2.michendorf.klima-daten.de`)
traefik.http.routers.node-red-2-michendorf.tls: "true"
traefik.http.routers.node-red-2-michendorf.tls.certresolver: default
traefik.docker.network: public
traefik.http.services.node-red-2.loadbalancer.server.port: 1880
traefik.http.services.node-red-2-michendorf.loadbalancer.server.port: 1880
traefik.enable: "true"
secrets:
- node-red-credential-secret
- node-red-keycloak-client-secret
- node-red-credential-secret-michendorf
- node-red-keycloak-client-secret-michendorf

node-red-3:
image: ghcr.io/klima-dashboard/data-tools:node-red
image: ghcr.io/klima-dashboard/data-tools:node-red-michendorf
environment:
- TZ=Europe/Amsterdam
- ADMIN_PASSWORD=$$2b$$08$$v8d1BR/rftGMP6969SHnHO5wWNGirMJxRuKQ28wxPs56nc7A79r0G
- REDIRECT_URI=https://node-red-3.bad-belzig.klima-daten.de/auth/strategy/callback
- REDIRECT_URI=https://node-red-3.michendorf.klima-daten.de/auth/strategy/callback
networks:
public:
data-tools:
Expand All @@ -96,53 +96,53 @@ services:
restart_policy:
condition: on-failure
labels:
traefik.http.routers.node-red-3.rule: Host(`node-red-3.bad-belzig.klima-daten.de`)
traefik.http.routers.node-red-3.tls: "true"
traefik.http.routers.node-red-3.tls.certresolver: default
traefik.http.routers.node-red-3-michendorf.rule: Host(`node-red-3.michendorf.klima-daten.de`)
traefik.http.routers.node-red-3-michendorf.tls: "true"
traefik.http.routers.node-red-3-michendorf.tls.certresolver: default
traefik.docker.network: public
traefik.http.services.node-red-3.loadbalancer.server.port: 1880
traefik.http.services.node-red-3-michendorf.loadbalancer.server.port: 1880
traefik.enable: "true"
secrets:
- node-red-credential-secret
- node-red-keycloak-client-secret
- node-red-credential-secret-michendorf
- node-red-keycloak-client-secret-michendorf


influxdb:
image: influxdb:2.5
command: ["influxd", "--session-length=1440"]
deploy:
labels:
traefik.http.routers.influxdb.rule: Host(`influxdb.bad-belzig.klima-daten.de`)
traefik.http.routers.influxdb.tls: "true"
traefik.http.routers.influxdb.tls.certresolver: default
traefik.http.routers.influxdb-michendorf.rule: Host(`influxdb.michendorf.klima-daten.de`)
traefik.http.routers.influxdb-michendorf.tls: "true"
traefik.http.routers.influxdb-michendorf.tls.certresolver: default
traefik.docker.network: public
traefik.http.services.influxdb.loadbalancer.server.port: 8086
traefik.http.services.influxdb-michendorf.loadbalancer.server.port: 8086
traefik.enable: "true"
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_ORG=smart-village
- DOCKER_INFLUXDB_INIT_BUCKET=node-red
- DOCKER_INFLUXDB_INIT_USERNAME=influxdb-user
- DOCKER_INFLUXDB_INIT_RETENTION=4w
- DOCKER_INFLUXDB_INIT_PASSWORD_FILE=/run/secrets/influxdb-password
- DOCKER_INFLUXDB_INIT_PASSWORD_FILE=/run/secrets/influxdb-password-michendorf
networks:
public:
data-tools:
volumes:
- influxdb-data:/var/lib/influxdb2
secrets:
- influxdb-password
- influxdb-admin-token
- influxdb-password-michendorf
- influxdb-admin-token-michendorf

grafana:
image: ghcr.io/klima-dashboard/data-tools:grafana
image: ghcr.io/klima-dashboard/data-tools:grafana-michendorf
deploy:
labels:
traefik.http.routers.grafana.rule: Host(`grafana.bad-belzig.klima-daten.de`)
traefik.http.routers.grafana.tls: "true"
traefik.http.routers.grafana.tls.certresolver: default
traefik.http.routers.grafana-michendorf.rule: Host(`grafana.michendorf.klima-daten.de`)
traefik.http.routers.grafana-michendorf.tls: "true"
traefik.http.routers.grafana-michendorf.tls.certresolver: default
traefik.docker.network: public
traefik.http.services.grafana.loadbalancer.server.port: 3000
traefik.http.services.grafana-michendorf.loadbalancer.server.port: 3000
traefik.enable: "true"
environment:
- GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/grafana-admin-password
Expand All @@ -152,38 +152,31 @@ services:
volumes:
- grafana-data:/var/lib/grafana
secrets:
- grafana-admin-password
- grafana-keycloak-client-secret
- grafana-admin-password-michendorf
- grafana-keycloak-client-secret-michendorf

volumes:
node-red-data:
external: true
node-red-1-data:
external: true
node-red-2-data:
external: true
node-red-3-data:
external: true
influxdb-data:
external: true
grafana-data:
external: true
secrets:
influxdb-password:
influxdb-password-michendorf:
external: true
influxdb-admin-token:
influxdb-admin-token-michendorf:
external: true
grafana-admin-password:
grafana-admin-password-michendorf:
external: true
node-red-credential-secret:
node-red-credential-secret-michendorf:
external: true
node-red-keycloak-client-secret:
node-red-keycloak-client-secret-michendorf:
external: true
grafana-keycloak-client-secret:
grafana-keycloak-client-secret-michendorf:
external: true

networks:
public:
external: true
data-tools:
external: true
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

cp /settings.js /data/settings.js
export NODE_RED_CREDENTIAL_SECRET=$(cat /run/secrets/node-red-credential-secret)
export CLIENT_SECRET=$(cat /run/secrets/node-red-keycloak-client-secret)
export NODE_RED_CREDENTIAL_SECRET=$(cat /run/secrets/node-red-credential-secret-michendorf)
export CLIENT_SECRET=$(cat /run/secrets/node-red-keycloak-client-secret-michendorf)
cd /data
npm i node-red-contrib-influxdb node-red-contrib-loop-processing node-red-contrib-zip
cd
Expand Down
8 changes: 4 additions & 4 deletions grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ client_id = grafana
client_secret = $__file{/run/secrets/grafana-keycloak-client-secret}
scopes = openid profile email offline_access roles
empty_scopes = false
auth_url = https://keycloak.klima-daten.de/realms/klima-dashboard/protocol/openid-connect/auth
token_url = https://keycloak.klima-daten.de/realms/klima-dashboard/protocol/openid-connect/token
api_url = https://keycloak.klima-daten.de/realms/klima-dashboard/protocol/openid-connect/userinfo
auth_url = https://keycloak.michendorf.klima-daten.de/realms/klima-dashboard/protocol/openid-connect/auth
token_url = https://keycloak.michendorf.klima-daten.de/realms/klima-dashboard/protocol/openid-connect/token
api_url = https://keycloak.michendorf.klima-daten.de/realms/klima-dashboard/protocol/openid-connect/userinfo
allow_sign_up = true
email_attribute_path = email
login_attribute_path = username
name_attribute_path = full_name
use_pkce = true
role_attribute_path = contains(resource_access.grafana.roles[*], 'admin') && 'Admin' || contains(resource_access.grafana.roles[*], 'editor') && 'Editor' || 'Viewer'
[server]
root_url=https://grafana.bad-belzig.klima-daten.de
root_url=https://grafana.michendorf.klima-daten.de
[security]
allow_embedding = true
[auth.anonymous]
Expand Down
Loading

0 comments on commit 830acd2

Please sign in to comment.