From 4be45dec15d4d84f115fe4f95172430552095809 Mon Sep 17 00:00:00 2001
From: Nico Poegel <nico_benjamin.poegel@student.reutlingen-university.de>
Date: Tue, 14 Feb 2023 10:55:10 +0100
Subject: [PATCH] fixed wrong database name and added service for the user-db

---
 .../deployment/myaktion-bank-deployment.yaml          |  2 +-
 .../templates/deployment/myaktion-deployment.yaml     |  2 +-
 .../templates/service/user-db-postgres-service.yml    | 11 +++++++++++
 3 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 helm-msa/templates/service/user-db-postgres-service.yml

diff --git a/helm-msa/templates/deployment/myaktion-bank-deployment.yaml b/helm-msa/templates/deployment/myaktion-bank-deployment.yaml
index 99cf787..0a065d2 100644
--- a/helm-msa/templates/deployment/myaktion-bank-deployment.yaml
+++ b/helm-msa/templates/deployment/myaktion-bank-deployment.yaml
@@ -16,7 +16,7 @@ spec:
     spec:
       containers:
       - name: myaktion-bank
-        image: ginyanote/myaktion-bank:1.0.0
+        image: ginyanote/myaktion-bank:0.1.0
         imagePullPolicy: IfNotPresent
         ports:
         - containerPort: 8082
diff --git a/helm-msa/templates/deployment/myaktion-deployment.yaml b/helm-msa/templates/deployment/myaktion-deployment.yaml
index 58087ff..4af5908 100644
--- a/helm-msa/templates/deployment/myaktion-deployment.yaml
+++ b/helm-msa/templates/deployment/myaktion-deployment.yaml
@@ -22,7 +22,7 @@ spec:
         - containerPort: 8080
         env:
         - name: SPRING_DATASOURCE_URL
-          value: "jdbc:postgresql://myaktion-postgres-db/postgres"
+          value: "jdbc:postgresql://myaktion-postgres-db-service/postgres"
         - name: URL_MYAKTION_MONITOR
           value: "http://myaktion-monitor-service/donations"
         - name: SPRING_REDIS_HOST
diff --git a/helm-msa/templates/service/user-db-postgres-service.yml b/helm-msa/templates/service/user-db-postgres-service.yml
new file mode 100644
index 0000000..d88fa53
--- /dev/null
+++ b/helm-msa/templates/service/user-db-postgres-service.yml
@@ -0,0 +1,11 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: user-db-postgres-service
+spec:
+  selector:
+    app: user-db-postgres
+  ports:
+    - protocol: TCP
+      port: 5432
+      targetPort: 5432
\ No newline at end of file
-- 
GitLab