Skip to content

Commit

Permalink
Support optimized start
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Růžička <[email protected]>
  • Loading branch information
mruzicka committed Apr 23, 2024
1 parent 58a318a commit c11ffce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions charts/keycloakx/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,15 @@ 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 $ }}
{{ else }}
- name: KC_HTTP_RELATIVE_PATH
value: {{ tpl .Values.http.relativePath $ | trimSuffix "/" }}
{{- end }}
{{- end }}
{{- if eq .Values.cache.stack "default" }}
- name: KC_CACHE
value: "ispn"
Expand All @@ -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 }}
Expand All @@ -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"
Expand All @@ -134,6 +139,7 @@ spec:
- name: KC_HEALTH_ENABLED
value: "true"
{{- end }}
{{- end }}
{{- with .Values.extraEnv }}
{{- tpl . $ | nindent 12 }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/keycloakx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c11ffce

Please sign in to comment.