blob: 626cfa855525041cde9cb2800bf6fc0dc5bef9e4 [file] [log] [blame]
{{- if or .Values.keycloak.cli.enabled .Values.keycloak.startupScripts -}}
{{- $highAvailability := gt (int .Values.keycloak.replicas) 1 -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "keycloak.fullname" . }}-startup
labels:
{{- include "keycloak.commonLabels" . | nindent 4 }}
data:
keycloak.cli: |
embed-server {{- if $highAvailability }} --server-config=standalone-ha.xml{{ end }} --std-out=echo
batch
{{- if ne .Values.keycloak.basepath "auth" }}
# Changes the base path to be /keycloak.basepath instead of /auth
/subsystem=keycloak-server:write-attribute(name=web-context,value={{ if eq .Values.keycloak.basepath "" }}ROOT{{ else }}{{ .Values.keycloak.basepath }}{{ end }})
{{- if eq .Values.keycloak.basepath "" }}
/subsystem=undertow/server=default-server/host=default-host:write-attribute(name=default-web-module,value=keycloak-server.war)
{{- end }}
{{ end }}
{{- with .Values.keycloak.cli }}
{{- tpl .nodeIdentifier $ | nindent 4 }}
{{- tpl .logging $ | nindent 4 }}
{{- tpl .datasource $ | nindent 4 }}
{{- if $highAvailability }}
{{- tpl .ha $ | nindent 4 }}
{{- end }}
{{- with .custom }}
{{- tpl . $ | nindent 4 }}
{{- end }}
{{- end }}
run-batch
stop-embedded-server
{{- with .Values.keycloak.startupScripts }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end -}}