Skip to content
Snippets Groups Projects
Commit 220edf43 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5238 Added keycloak referneces in deployment

parent e4a9c008
Branches
Tags
No related merge requests found
...@@ -43,3 +43,19 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} ...@@ -43,3 +43,19 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- define "app.ozgcloudEnvironment" -}} {{- define "app.ozgcloudEnvironment" -}}
{{- required "Environment muss angegeben sein" (.Values.ozgcloud).environment -}} {{- required "Environment muss angegeben sein" (.Values.ozgcloud).environment -}}
{{- end -}} {{- end -}}
{{- define "app.ssoRealm" -}}
{{ printf "%s-%s-%s" (include "app.ozgcloudBundesland" .) ( include "app.ozgcloudBezeichner" . ) ( include "app.ozgcloudEnvironment" . ) | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{- define "app.ssoClientName" -}}
{{- if (.Values.sso).client_name -}}
{{ printf "%s" (.Values.sso).client_name }}
{{- else -}}
{{ printf "administration" }}
{{- end -}}
{{- end -}}
{{- define "app.ssoServerUrl" -}}
{{- required "sso.serverUrl muss angegeben sein" (.Values.sso).serverUrl -}}
{{- end -}}
\ No newline at end of file
...@@ -62,6 +62,12 @@ spec: ...@@ -62,6 +62,12 @@ spec:
- name: spring_profiles_active - name: spring_profiles_active
value: {{ include "app.envSpringProfiles" . }} value: {{ include "app.envSpringProfiles" . }}
{{- if not (.Values.database).useExternal }} {{- if not (.Values.database).useExternal }}
- name: keycloak_realm
value: {{ include "app.ssoRealm" . }}
- name: keycloak_resource
value: {{ include "app.ssoClientName" . }}
- name: keycloak_auth-server-url
value: {{ include "app.ssoServerUrl" . }}
- name: spring_data_mongodb_uri - name: spring_data_mongodb_uri
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
......
#
# Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den
# Ministerpräsidenten des Landes Schleswig-Holstein
# Staatskanzlei
# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
#
# Lizenziert unter der EUPL, Version 1.2 oder - sobald
# diese von der Europäischen Kommission genehmigt wurden -
# Folgeversionen der EUPL ("Lizenz");
# Sie dürfen dieses Werk ausschließlich gemäß
# dieser Lizenz nutzen.
# Eine Kopie der Lizenz finden Sie hier:
#
# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
#
# Sofern nicht durch anwendbare Rechtsvorschriften
# gefordert oder in schriftlicher Form vereinbart, wird
# die unter der Lizenz verbreitete Software "so wie sie
# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
# ausdrücklich oder stillschweigend - verbreitet.
# Die sprachspezifischen Genehmigungen und Beschränkungen
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
suite: test deployment
release:
name: administration
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
baseUrl: test.company.local
ozgcloud:
environment: test
bundesland: sh
bezeichner: helm
sso:
serverUrl: https://sso.company.local
tests:
- it: check default values
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].env
content:
name: keycloak_realm
value: sh-helm-test
- contains:
path: spec.template.spec.containers[0].env
content:
name: keycloak_resource
value: administration
- contains:
path: spec.template.spec.containers[0].env
content:
name: keycloak_auth-server-url
value: https://sso.company.local
- it: check realm with long namespace
set:
ozgcloud:
bezeichner: eins-zwei-drei
environment: dev
bundesland: sh
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].env
content:
name: keycloak_realm
value: sh-eins-zwei-drei-dev
- it: check different client name
set:
sso:
client_name: different-client
serverUrl: https://sso.company.local
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].env
content:
name: keycloak_resource
value: different-client
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment