[stable/keycloak] option to set realm using start param (#5950)

* option to set realm using start param

* expose postStartScript

* increment chart versions

* don't change incubator

* remove readme change to incubator

* remove postStartScript and provide example for realm import

* extra clarification

* rename extraParams to extraArgs

* Update README.md
This commit is contained in:
Ryan Dawson
2018-06-11 03:13:26 -07:00
committed by k8s-ci-robot
parent 4222677fc8
commit 3beb68d94c
4 changed files with 32 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: keycloak
version: 1.1.1
version: 1.2.0
appVersion: 3.4.3.Final
description: Open Source Identity and Access Management For Modern Applications and Services
keywords:
+27 -2
View File
@@ -62,6 +62,7 @@ Parameter | Description | Default
`keycloak.tolerations` | Node taints to tolerate | `[]`
`keycloak.securityContext` | Security context for the pod | `{runAsUser: 1000, fsGroup: 1000, runAsNonRoot: true}`
`keycloak.preStartScript` | Custom script to run before Keycloak starts up | ``
`keycloak.extraArgs` | Additional arguments to the start command | ``
`keycloak.livenessProbe.initialDelaySeconds` | Liveness Probe `initialDelaySeconds` | `120`
`keycloak.livenessProbe.timeoutSeconds` | Liveness Probe `timeoutSeconds` | `5`
`keycloak.readinessProbe.initialDelaySeconds` | Readiness Probe `initialDelaySeconds` | `30`
@@ -149,11 +150,11 @@ See also:
keycloak:
extraEnv:
- name: KEYCLOAK_LOGLEVEL
value: : DEBUG
value: DEBUG
- name: WILDFLY_LOGLEVEL
value: DEBUG
- name: CACHE_OWNERS:
value"3"
value: "3"
```
### Providing a Custom Theme
@@ -196,6 +197,30 @@ keycloak:
- name: theme
emptyDir: {}
```
### Setting a Custom Realm
A realm can be added by creating a secret or configmap for the realm json file and then supplying this into the chart.
It could be mounted using `extraVolumeMounts` and then specified in `extraArgs` using `-Dimport`.
First we could create a Secret from a json file using `kubectl create secret generic realm-secret --from-file=realm.json` which we need to reference in `values.yaml`:
```yaml
keycloak:
extraVolumes:
- name: realm-secret
secret:
secretName: realm-secret
extraVolumeMounts:
- name: realm-secret
mountPath: "/realm/"
readOnly: true
extraArgs: -Dkeycloak.import=/realm/realm.json
```
Alternatively, the file could be added to a custom image (set in `keycloak.image`) and then referenced by `-Dimport`.
After startup the web admin console for the realm should be available on the path /auth/admin/\<realm name>/console/
### WildFly Configuration
+1 -1
View File
@@ -21,7 +21,7 @@ data:
{{ . | indent 4 }}
{{- end }}
exec /opt/jboss/docker-entrypoint.sh -b 0.0.0.0 {{- if $highAvailability }} --server-config standalone-ha.xml{{ end }}
exec /opt/jboss/docker-entrypoint.sh -b 0.0.0.0 {{ .Values.keycloak.extraArgs }}{{- if $highAvailability }} --server-config standalone-ha.xml{{ end }}
exit "$?"
keycloak.cli: |
+3
View File
@@ -29,6 +29,9 @@ keycloak:
## Custom script that is run before Keycloak is started.
preStartScript:
## Additional arguments to start command e.g. -Dkeycloak.import= to load a realm
extraArgs:
## Username for the initial Keycloak admin user
username: keycloak