Skip to content

Commit

Permalink
keycloak data volume
Browse files Browse the repository at this point in the history
  • Loading branch information
andrevtg committed Oct 22, 2020
1 parent 0b2939c commit 1756b48
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 11 deletions.
2 changes: 2 additions & 0 deletions charts/vkpr/templates/keycloak-data-volume.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.keycloak.enabled -}}
{{- if eq .Values.keycloak.postgresql.enabled false -}}
# apenas para h2
apiVersion: v1
kind: PersistentVolumeClaim
Expand All @@ -11,3 +12,4 @@ spec:
requests:
storage: 1Gi
{{- end -}}
{{- end -}}
11 changes: 8 additions & 3 deletions charts/vkpr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ graylog:

keycloak:
enabled: false
keycloak:
persistence:
dbVendor: h2
# postgresql - enables subchart
# keep disabled to use external database (like RDS) - this is the recommended option
# https://artifacthub.io/packages/helm/codecentric/keycloak
# Keycloak will fallback to H2 local file-based DB if no `DB_VENDOR` is informed
# H2 located at "/opt/jboss/keycloak/standalone/data"
# Mounting it into a PVC can be done, but it should only be ok for single instance.
postgresql:
enabled: false

vault:
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion examples/keycloak/realm.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"realm": "example",
"realm": "vkpr",
"enabled": true,
"sslRequired": "external",
"registrationAllowed": true,
Expand Down
37 changes: 30 additions & 7 deletions examples/local/values-local-keycloak.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
#
# Valores para testes locais com o k3d.
#
# O que executa:
# - Ingress controller (ingress-nginx)
# - Aplicação "whoami"
# - Keycloak
#
# kubectl create secret generic vkpr-realm-secret --from-file=examples/keycloak/realms/realm.json
# helm upgrade -i vkpr --skip-crds -f examples/local/values-local-keycloak.yaml ./charts/vkpr
#
# Coloque as seguintes entradas no /etc/hosts :
# 127.0.0.1 keycloak.localdomain
#
# Abrir a seguinte URL no browser:
#
#
#

#
# INGRESS STACK
#
ingress-nginx:
enabled: true
# http: 32080

external-dns:
enabled: false
Expand Down Expand Up @@ -43,10 +60,8 @@ keycloak:
enabled: true
rbac:
create: true
username: keycloak
password: vert1234
postgresql:
enabled: true
enabled: false
ingress:
enabled: true
tls: []
Expand All @@ -55,14 +70,22 @@ keycloak:
rules:
- host: "keycloak.localdomain"
paths: ["/"]
# mounts realm.json as secret
# mounts volume as H2 database (when no postgres is used)
extraVolumes: |
- name: realm-secret
- name: vkpr-realm-secret
secret:
secretName: realm-secret
secretName: vkpr-realm-secret
- name: keycloak-data
persistentVolumeClaim:
claimName: keycloak-data-volume
extraVolumeMounts: |
- name: realm-secret
- name: vkpr-realm-secret
mountPath: "/realm/"
readOnly: true
- name: keycloak-data
mountPath: "/opt/jboss/keycloak/standalone/data"
readOnly: false
extraEnv: |
- name: KEYCLOAK_IMPORT
value: /realm/realm.json
Expand Down

0 comments on commit 1756b48

Please sign in to comment.