Skip to content

Commit 06e5afe

Browse files
Simon Rüeggunguiculus
authored andcommitted
[keycloak] Add OpenShift route (#18)
Signed-off-by: Simon Rüegg <[email protected]>
1 parent a20d36a commit 06e5afe

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
lines changed

charts/keycloak/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: keycloak
2-
version: 4.12.0
2+
version: 4.13.0
33
appVersion: 5.0.0
44
description: Open Source Identity and Access Management For Modern Applications and Services
55
keywords:

charts/keycloak/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,17 @@ Parameter | Description | Default
9090
`keycloak.ingress.enabled` | if `true`, an ingress is created | `false`
9191
`keycloak.ingress.annotations` | annotations for the ingress | `{}`
9292
`keycloak.ingress.labels` | Additional labels for the Keycloak ingress | `{}`
93-
`keycloak.ingress.path` | if `true`, an ingress is created | `/`
93+
`keycloak.ingress.path` | Path for the ingress | `/`
9494
`keycloak.ingress.hosts` | a list of ingress hosts | `[keycloak.example.com]`
9595
`keycloak.ingress.tls` | a list of [IngressTLS](https://v1-9.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.9/#ingresstls-v1beta1-extensions) items | `[]`
96+
`keycloak.route.enabled` | If `true`, an OpenShift route is created | `false`
97+
`keycloak.route.annotations` | Annotations for the route | `{}`
98+
`keycloak.route.labels` | Additional labels for the Keycloak route | `{}`
99+
`keycloak.route.path` | Path for the route | `/`
100+
`keycloak.route.host` | The host name of the route. If left empty, a name will be generated by OpenShift | `""`
101+
`keycloak.route.tls.enabled` | If `true`, TLS is enabled for the route | `true`
102+
`keycloak.route.tls.insecureEdgeTerminationPolicy` | Insecure edge termination policy of the route. Can be `None`, `Redirect` or `Allow` | `Redirect`
103+
`keycloak.route.tls.termination` | TLS termination of the route. Can be `edge`, `passthrough` or `reencrypt` | `edge`
96104
`keycloak.persistence.deployPostgres` | If true, the PostgreSQL chart is installed | `false`
97105
`keycloak.persistence.existingSecret` | Name of an existing secret to be used for the database password (if `keycloak.persistence.deployPostgres=false`). Otherwise a new secret is created | `""`
98106
`keycloak.persistence.existingSecretKey` | The key for the database password in the existing secret (if `keycloak.persistence.deployPostgres=false`) | `password`
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{{- $route := .Values.keycloak.route -}}
2+
{{- if $route.enabled -}}
3+
apiVersion: route.openshift.io/v1
4+
kind: Route
5+
metadata:
6+
name: {{ template "keycloak.fullname" . }}
7+
{{- with $route.annotations }}
8+
annotations:
9+
{{ toYaml . | indent 4 }}
10+
{{- end }}
11+
labels:
12+
app: {{ template "keycloak.name" . }}
13+
chart: {{ template "keycloak.chart" . }}
14+
heritage: {{ .Release.Service }}
15+
release: {{ .Release.Name }}
16+
{{- with $route.labels }}
17+
{{ toYaml . | indent 4 }}
18+
{{- end }}
19+
spec:
20+
{{- if $route.host }}
21+
host: {{ $route.host }}
22+
{{- end }}
23+
path: {{ $route.path }}
24+
port:
25+
targetPort: http
26+
to:
27+
kind: Service
28+
name: {{ template "keycloak.fullname" $ }}-http
29+
weight: 100
30+
{{- if $route.tls.enabled }}
31+
tls:
32+
insecureEdgeTerminationPolicy: {{ $route.tls.insecureEdgeTerminationPolicy }}
33+
termination: {{ $route.tls.termination }}
34+
{{- end }}
35+
{{- end -}}

charts/keycloak/values.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,29 @@ keycloak:
212212
# - keycloak.example.com
213213
# secretName: tls-keycloak
214214

215+
## OpenShift route configuration.
216+
## ref: https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html
217+
route:
218+
enabled: false
219+
path: /
220+
221+
annotations: {}
222+
# kubernetes.io/tls-acme: "true"
223+
# haproxy.router.openshift.io/disable_cookies: "true"
224+
# haproxy.router.openshift.io/balance: roundrobin
225+
226+
labels: {}
227+
# key: value
228+
229+
# Host name for the route
230+
host:
231+
232+
# TLS configuration
233+
tls:
234+
enabled: true
235+
insecureEdgeTerminationPolicy: Redirect
236+
termination: edge
237+
215238
## Persistence configuration
216239
persistence:
217240
# If true, the Postgres chart is deployed

0 commit comments

Comments
 (0)