diff --git a/src/main/resources/keycloak/configmap.yaml b/src/main/resources/keycloak/configmap.yaml new file mode 100644 index 0000000..659dbf7 --- /dev/null +++ b/src/main/resources/keycloak/configmap.yaml @@ -0,0 +1,15 @@ +# TODO: Make generate-configmap function +apiVersion: v1 +kind: ConfigMap +metadata: + name: keycloak-env + namespace: NAMESPACE +data: + KC_HTTPS_CERTIFICATE_FILE: /etc/certs/tls.crt + KC_HTTPS_CERTIFICATE_KEY_FILE: /etc/certs/tls.key + KC_HOSTNAME: FQDN + KC_PROXY: edge + DB_VENDOR: POSTGRES + DB_ADDR: postgresql-service + DB_SCHEMA: public + DB_DATABASE: postgres diff --git a/src/main/resources/keycloak/deployment.yaml b/src/main/resources/keycloak/deployment.yaml index 5fc1ae0..20d2d52 100644 --- a/src/main/resources/keycloak/deployment.yaml +++ b/src/main/resources/keycloak/deployment.yaml @@ -25,46 +25,11 @@ spec: - name: keycloak-cert mountPath: /etc/certs readOnly: true - env: - - name: KC_HTTPS_CERTIFICATE_FILE - value: /etc/certs/tls.crt - - name: KC_HTTPS_CERTIFICATE_KEY_FILE - value: /etc/certs/tls.key - - name: KC_HOSTNAME - value: FQDN - - name: KC_PROXY - value: edge - - name: DB_VENDOR - value: POSTGRES - - name: DB_ADDR - value: postgresql-service - - name: DB_SCHEMA - value: public - - name: DB_DATABASE - valueFrom: - configMapKeyRef: - name: postgres-config - key: postgres-db - - name: DB_USER - valueFrom: - secretKeyRef: - name: postgres-secret - key: postgres-user - - name: DB_PASSWORD - valueFrom: - secretKeyRef: - name: postgres-secret - key: postgres-password - - name: KEYCLOAK_ADMIN - valueFrom: - secretKeyRef: + envFrom: + - configMapRef: + name: keycloak-env + - secretRef: name: keycloak-secret - key: keycloak-user - - name: KEYCLOAK_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: keycloak-secret - key: keycloak-password ports: - name: http containerPort: 8080 diff --git a/src/main/resources/keycloak/secret.yaml b/src/main/resources/keycloak/secret.yaml index b214355..e10e2df 100644 --- a/src/main/resources/keycloak/secret.yaml +++ b/src/main/resources/keycloak/secret.yaml @@ -1,3 +1,4 @@ +# TODO: Update generate-secret function apiVersion: v1 kind: Secret metadata: @@ -5,5 +6,7 @@ metadata: namespace: NAMESPACE type: Opaque data: - keycloak-user: admin - keycloak-password: admin + DB_USER: DBUSER + DB_PASSWORD: DBPW + KEYCLOAK_ADMIN: ADMIN_USER + KEYCLOAK_ADMIN_PASSWORD: ADMIN_PASS