From b36a6214aa7ff1eaabbd045a2f441976055a1430 Mon Sep 17 00:00:00 2001
From: Mark <mark@openappstack.net>
Date: Fri, 22 Nov 2019 20:07:30 +0100
Subject: [PATCH] Add more values to templates

---
 .../templates/deployment-userbackend.yaml      |  4 ++--
 .../templates/deployment-userfrontend.yaml     | 12 ++++++------
 .../single-sign-on/templates/ingress.yaml      |  9 +++------
 helmchart/single-sign-on/values.yaml           | 18 +++++++++---------
 4 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/helmchart/single-sign-on/templates/deployment-userbackend.yaml b/helmchart/single-sign-on/templates/deployment-userbackend.yaml
index 736ce92..7c87bbb 100644
--- a/helmchart/single-sign-on/templates/deployment-userbackend.yaml
+++ b/helmchart/single-sign-on/templates/deployment-userbackend.yaml
@@ -19,7 +19,7 @@ spec:
           image: postgres:11
           env:
             - name: POSTGRES_PASSWORD
-              value: secret
+              value: {{ .Values.userbackend.postgres.password }}
         - name: {{ .Chart.Name }}-userbackend
           image: "open.greenhost.net:4567/openappstack/user-panel/backend:minimal-frontend"
           imagePullPolicy: Always
@@ -29,7 +29,7 @@ spec:
             - name: DATABASE_USER
               value: postgres
             - name: DATABASE_PASSWORD
-              value: secret
+              value: {{ .Values.userbackend.postgres.password }}
             - name: DATABASE_NAME
               value: postgres
             - name: DATABASE_HOST
diff --git a/helmchart/single-sign-on/templates/deployment-userfrontend.yaml b/helmchart/single-sign-on/templates/deployment-userfrontend.yaml
index 2b0759e..4222a03 100644
--- a/helmchart/single-sign-on/templates/deployment-userfrontend.yaml
+++ b/helmchart/single-sign-on/templates/deployment-userfrontend.yaml
@@ -22,17 +22,17 @@ spec:
             - name: HOST
               value: 0.0.0.0
             - name: BASE_URL
-              value: https://admin.oas.alumnicloud.net
+              value: https://{{ .Values.userpanel.ingress.host }}
             - name: REDIRECT_URL
-              value: https://admin.oas.alumnicloud.net/callback
+              value: https://{{ .Values.userpanel.ingress.host }}/callback
             - name: HYDRA_BASE_URL
-              value: https://sso.oas.alumnicloud.net
+              value: {{ .Values.hydra.hydra.config.urls.self.issuer }}
             - name: AUTHORIZE_URL
-              value: https://sso.oas.alumnicloud.net/oauth2/auth
+              value: {{ .Values.hydra.hydra.config.urls.self.issuer }}/oauth2/auth
             - name: USERINFO_URL
-              value: https://sso.oas.alumnicloud.net/userinfo
+              value: {{ .Values.hydra.hydra.config.urls.self.issuer }}/userinfo
             - name: ACCESS_TOKEN
-              value: https://sso.oas.alumnicloud.net/oauth2/token
+              value: {{ .Values.hydra.hydra.config.urls.self.issuer }}/oauth2/token
             - name: BACKEND_API_URL
               value: http://{{ include "single-sign-on.fullname" . }}-userbackend/graphql
             - name: OAUTH_CLIENT_ID
diff --git a/helmchart/single-sign-on/templates/ingress.yaml b/helmchart/single-sign-on/templates/ingress.yaml
index 47f191b..2041d12 100644
--- a/helmchart/single-sign-on/templates/ingress.yaml
+++ b/helmchart/single-sign-on/templates/ingress.yaml
@@ -8,21 +8,18 @@ metadata:
     kubernetes.io/tls-acme: "true"
 spec:
   rules:
-  - host: {{ .Values.consentProvider.ingress.host }}
+  - host: {{ .Values.hydra.ingress.host }}
     http:
       paths:
       - path: /
         backend:
           serviceName: {{ include "single-sign-on.fullname" . }}-consent
           servicePort: 5001
-  - host: {{ .Values.loginProvider.ingress.host }}
-    http:
-      paths:
-      - path: /
+      - path: /login
         backend:
           serviceName: {{ include "single-sign-on.fullname" . }}-login
           servicePort: 5000
-  - host: {{ .Values.userpanelFrontend.ingress.host }}
+  - host: {{ .Values.userpanel.ingress.host }}
     http:
       paths:
       - path: /
diff --git a/helmchart/single-sign-on/values.yaml b/helmchart/single-sign-on/values.yaml
index 543403c..c8ab91f 100644
--- a/helmchart/single-sign-on/values.yaml
+++ b/helmchart/single-sign-on/values.yaml
@@ -1,15 +1,14 @@
-loginProvider:
-  ingress:
-    host: login.oas.alumnicloud.net
-
-consentProvider:
-  ingress:
-    host: consent.oas.alumnicloud.net
-
-userpanelFrontend:
+userpanel:
   ingress:
     host: admin.oas.alumnicloud.net
 
+userbackend:
+  username: "admin"
+  password: "set admin password here"
+  email: "admin@example.net"
+  postgres:
+    password: "postgres"
+
 hydra:
   hydra:
     dangerousForceHttp: true
@@ -33,6 +32,7 @@ hydra:
       secrets:
         system: "YouReallyNeedToChangeThis"
   ingress:
+    host: sso.oas.alumnicloud.net
     public:
       enabled: true
       annotations:
-- 
GitLab