From c11ffce22bbec268942d8d0df03fdf1990ec5581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20R=C5=AF=C5=BEi=C4=8Dka?= Date: Tue, 23 Apr 2024 12:06:29 +0200 Subject: [PATCH] Support optimized start MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Růžička --- charts/keycloakx/templates/statefulset.yaml | 6 ++++++ charts/keycloakx/values.yaml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/charts/keycloakx/templates/statefulset.yaml b/charts/keycloakx/templates/statefulset.yaml index 84eaeb9f..87e39fd2 100644 --- a/charts/keycloakx/templates/statefulset.yaml +++ b/charts/keycloakx/templates/statefulset.yaml @@ -86,6 +86,7 @@ spec: {{- tpl . $ | nindent 12 }} {{- end }} env: + {{- if not .Values.optimized }} {{- if and (.Values.http.relativePath) (eq .Values.http.relativePath "/") }} - name: KC_HTTP_RELATIVE_PATH value: {{ tpl .Values.http.relativePath $ }} @@ -93,6 +94,7 @@ spec: - name: KC_HTTP_RELATIVE_PATH value: {{ tpl .Values.http.relativePath $ | trimSuffix "/" }} {{- end }} + {{- end }} {{- if eq .Values.cache.stack "default" }} - name: KC_CACHE value: "ispn" @@ -103,10 +105,12 @@ spec: - name: KC_PROXY value: {{ .Values.proxy.mode }} {{- end }} + {{- if not .Values.optimized }} {{- if .Values.database.vendor }} - name: KC_DB value: {{ .Values.database.vendor }} {{- end }} + {{- end }} {{- if .Values.database.hostname }} - name: KC_DB_URL_HOST value: {{ .Values.database.hostname }} @@ -126,6 +130,7 @@ spec: {{- if or .Values.database.password .Values.database.existingSecret -}} {{- include "keycloak.databasePasswordEnv" . | nindent 12 }} {{- end }} + {{- if not .Values.optimized }} {{- if .Values.metrics.enabled }} - name: KC_METRICS_ENABLED value: "true" @@ -134,6 +139,7 @@ spec: - name: KC_HEALTH_ENABLED value: "true" {{- end }} + {{- end }} {{- with .Values.extraEnv }} {{- tpl . $ | nindent 12 }} {{- end }} diff --git a/charts/keycloakx/values.yaml b/charts/keycloakx/values.yaml index 385b9166..b187daa3 100644 --- a/charts/keycloakx/values.yaml +++ b/charts/keycloakx/values.yaml @@ -110,6 +110,9 @@ command: [] ## Overrides the default args for the Keycloak container args: [] +# Whether the optimized start is used. When set to true, then environment variables specifying build-time options are not set to avoid warnings. +optimized: false + # Additional environment variables for Keycloak extraEnv: "" # - name: KC_LOG_LEVEL