From 393cb5a06225d0ab1b25bdfe84b0da5b7b34eafa Mon Sep 17 00:00:00 2001 From: Manuel Ruck Date: Sun, 11 Aug 2024 18:29:13 +0200 Subject: [PATCH] add non-named-votes-ai Signed-off-by: Manuel Ruck --- .../base/main/bundestagio-admin-depl.yaml | 4 +- kustomize/base/main/kustomization.yaml | 1 + kustomize/base/main/non-named-votes-ai.yaml | 50 +++++++++++++++++++ .../internal/configs/kustomization.yaml | 3 ++ .../internal/configs/non-named-votes-ai.env | 4 ++ .../production/configs/kustomization.yaml | 3 ++ .../production/configs/non-named-votes-ai.env | 4 ++ 7 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 kustomize/base/main/non-named-votes-ai.yaml create mode 100644 kustomize/overlays/internal/configs/non-named-votes-ai.env create mode 100644 kustomize/overlays/production/configs/non-named-votes-ai.env diff --git a/kustomize/base/main/bundestagio-admin-depl.yaml b/kustomize/base/main/bundestagio-admin-depl.yaml index 98b6585..c91274b 100644 --- a/kustomize/base/main/bundestagio-admin-depl.yaml +++ b/kustomize/base/main/bundestagio-admin-depl.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: bundestagio-admin - image: democracy/bundestag.io-admin:3.3.0 + image: democracy/bundestag.io-admin:pr-592 env: - name: AI_ACCESS_TOKEN valueFrom: @@ -29,6 +29,8 @@ spec: name: bio-admin-login - secretRef: name: bundestag-result-edit-token + - secretRef: + name: non-named-votes-ai-access-token resources: limits: memory: "200M" diff --git a/kustomize/base/main/kustomization.yaml b/kustomize/base/main/kustomization.yaml index 1232cb1..47927f4 100644 --- a/kustomize/base/main/kustomization.yaml +++ b/kustomize/base/main/kustomization.yaml @@ -6,6 +6,7 @@ resources: - bundestagio-admin-depl.yaml - bundestagio-depl.yaml - votes-ai.yaml + - non-named-votes-ai.yaml - bundestagio-dip-depl.yaml - democracy-api-depl.yaml - democracy-app-depl.yaml diff --git a/kustomize/base/main/non-named-votes-ai.yaml b/kustomize/base/main/non-named-votes-ai.yaml new file mode 100644 index 0000000..0491000 --- /dev/null +++ b/kustomize/base/main/non-named-votes-ai.yaml @@ -0,0 +1,50 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: non-named-votes-ai +spec: + replicas: 1 + selector: + matchLabels: + app: non-named-votes-ai + template: + metadata: + labels: + app: non-named-votes-ai + spec: + containers: + - name: non-named-votes-ai + image: democracy/non-named-votes-ai:pr-592 + imagePullPolicy: Always + ports: + - containerPort: 3005 + protocol: TCP + envFrom: + - configMapRef: + name: non-named-votes-ai-config + - secretRef: + name: non-named-votes-ai-access-token + optional: false + - secretRef: + name: non-named-votes-ai-openai-token + optional: false + resources: + requests: + memory: "150M" + cpu: "50m" + limits: + memory: "200M" + cpu: "300m" +--- +apiVersion: v1 +kind: Service +metadata: + name: non-named-votes-ai-srv +spec: + selector: + app: non-named-votes-ai + ports: + - name: non-named-votes-ai + protocol: TCP + port: 3005 + targetPort: 3005 diff --git a/kustomize/overlays/internal/configs/kustomization.yaml b/kustomize/overlays/internal/configs/kustomization.yaml index 6f42e24..c8c47e2 100644 --- a/kustomize/overlays/internal/configs/kustomization.yaml +++ b/kustomize/overlays/internal/configs/kustomization.yaml @@ -8,6 +8,9 @@ configMapGenerator: - name: ai-votes-config envs: - ai-votes.env + - name: non-named-votes-ai-config + envs: + - non-named-votes-ai.env - name: bio-api-config envs: - bio-api.env diff --git a/kustomize/overlays/internal/configs/non-named-votes-ai.env b/kustomize/overlays/internal/configs/non-named-votes-ai.env new file mode 100644 index 0000000..6be29c3 --- /dev/null +++ b/kustomize/overlays/internal/configs/non-named-votes-ai.env @@ -0,0 +1,4 @@ +PORT=3005 +DB_URL=mongodb://localhost:27017/bundestagio +PINO_LOG_LEVEL=info +ALLOWED_DOMAINS=https://dserver.bundestag.de \ No newline at end of file diff --git a/kustomize/overlays/production/configs/kustomization.yaml b/kustomize/overlays/production/configs/kustomization.yaml index af43868..6562bb2 100644 --- a/kustomize/overlays/production/configs/kustomization.yaml +++ b/kustomize/overlays/production/configs/kustomization.yaml @@ -8,6 +8,9 @@ configMapGenerator: - name: ai-votes-config envs: - ai-votes.env + - name: non-named-votes-ai-config + envs: + - non-named-votes-ai.env - name: bio-api-config envs: - bio-api.env diff --git a/kustomize/overlays/production/configs/non-named-votes-ai.env b/kustomize/overlays/production/configs/non-named-votes-ai.env new file mode 100644 index 0000000..6be29c3 --- /dev/null +++ b/kustomize/overlays/production/configs/non-named-votes-ai.env @@ -0,0 +1,4 @@ +PORT=3005 +DB_URL=mongodb://localhost:27017/bundestagio +PINO_LOG_LEVEL=info +ALLOWED_DOMAINS=https://dserver.bundestag.de \ No newline at end of file