Skip to content

Commit 67fb6c7

Browse files
authored
Merge pull request #31 from GoodRxOSS/feat/external-db-support
feat(lifecycle-keycloak): add support for external database connection
2 parents ef035b6 + b15fdd4 commit 67fb6c7

File tree

5 files changed

+39
-5
lines changed

5 files changed

+39
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ A collection of Helm charts primarily used for **Lifecycle** application deploym
88
| :--- | :--- | :--- | :--- |
99
| [keycloak-operator](./charts/keycloak-operator) | `0.1.0` | `26.4.7` | Helm chart for Keycloak operator based on the [official manifests](https://www.keycloak.org/operator/installation#_installing_by_using_kubectl_without_operator_lifecycle_manager) |
1010
| [lifecycle](./charts/lifecycle) | `0.6.0` | `0.1.11` | A Helm umbrella chart for full Lifecycle stack |
11-
| [lifecycle-keycloak](./charts/lifecycle-keycloak) | `0.6.0` | `0.0.0` | Keycloak instance for Lifecycle stack with automated Operator-driven setup and imports |
11+
| [lifecycle-keycloak](./charts/lifecycle-keycloak) | `0.7.0` | `0.0.0` | Keycloak instance for Lifecycle stack with automated Operator-driven setup and imports |
1212
| [lifecycle-ui](./charts/lifecycle-ui) | `0.3.0` | `0.1.2` | A Helm chart for Lifecycle UI (Next.js) |

charts/lifecycle-keycloak/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ apiVersion: v2
1616
name: lifecycle-keycloak
1717
description: Keycloak instance for Lifecycle stack with automated Operator-driven setup and imports
1818
type: application
19-
version: 0.6.0
19+
version: 0.7.0
2020
appVersion: 0.0.0
2121
home: https://goodrxoss.github.io/helm-charts/charts/lifecycle-keycloak/
2222

@@ -29,4 +29,4 @@ dependencies:
2929
alias: keycloakPostgres
3030
version: 15.5.19
3131
repository: "https://charts.bitnami.com/bitnami"
32-
condition: postgres.enabled
32+
condition: keycloakPostgres.enabled

charts/lifecycle-keycloak/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# lifecycle-keycloak
22

3-
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)
3+
![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)
44

55
Keycloak instance for Lifecycle stack with automated Operator-driven setup and imports
66

@@ -128,7 +128,7 @@ This chart uses the `KeycloakRealmImport` resource for the initial setup.
128128
```shell
129129
helm upgrade -i lifecycle-keycloak \
130130
oci://ghcr.io/goodrxoss/helm-charts/lifecycle-keycloak \
131-
--version 0.6.0 \
131+
--version 0.7.0 \
132132
-f values.yaml \
133133
-n lifecycle-keycloak \
134134
--create-namespace
@@ -152,6 +152,14 @@ helm upgrade -i lifecycle-keycloak \
152152
| companyIdp.enabled | bool | `true` | |
153153
| companyIdp.jwksUrl | string | `nil` | |
154154
| companyIdp.tokenUrl | string | `nil` | |
155+
| externalDatabase.database | string | `"keycloak"` | |
156+
| externalDatabase.enabled | bool | `false` | |
157+
| externalDatabase.host | string | `nil` | |
158+
| externalDatabase.password.secretKeyRef.key | string | `nil` | |
159+
| externalDatabase.password.secretKeyRef.name | string | `nil` | |
160+
| externalDatabase.port | int | `5432` | |
161+
| externalDatabase.username | string | `"keycloak"` | |
162+
| externalDatabase.vendor | string | `"postgres"` | |
155163
| extraLabels | object | `{}` | |
156164
| fullnameOverride | string | `""` | |
157165
| githubIdp.clientId.secretKeyRef.key | string | `nil` | |

charts/lifecycle-keycloak/templates/keycloak-instance.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ spec:
2929
user:
3030
secret: {{ include "lifecycle-keycloak.bootstrapAdminSecretName" . | quote }}
3131
db:
32+
{{- if .Values.externalDatabase.enabled }}
33+
vendor: {{ .Values.externalDatabase.vendor | quote }}
34+
host: {{ .Values.externalDatabase.host | quote }}
35+
port: {{ .Values.externalDatabase.port }}
36+
database: {{ .Values.externalDatabase.database | quote }}
37+
passwordSecret:
38+
name: {{ .Values.externalDatabase.password.secretKeyRef.name | quote }}
39+
key: {{ .Values.externalDatabase.password.secretKeyRef.key | quote }}
40+
{{- else }}
3241
vendor: postgres
3342
host: {{ include "lifecycle-keycloak.postgresSvcPrefix" . | quote }}
3443
port: 5432
@@ -39,6 +48,7 @@ spec:
3948
passwordSecret:
4049
name: {{ include "lifecycle-keycloak.postgresSecretName" . | quote }}
4150
key: POSTGRES_USER_PASSWORD
51+
{{- end }}
4252

4353
http:
4454
httpEnabled: true
@@ -49,6 +59,10 @@ spec:
4959
backchannelDynamic: false
5060

5161
additionalOptions:
62+
{{- if .Values.externalDatabase.enabled }}
63+
- name: db-username
64+
value: {{ .Values.externalDatabase.username | quote }}
65+
{{- end }}
5266
- name: hostname-strict-backchannel
5367
value: "false"
5468
- name: proxy-headers

charts/lifecycle-keycloak/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ ingress:
8484
className: nginx
8585
tls: false
8686

87+
externalDatabase:
88+
enabled: false
89+
vendor: postgres
90+
host:
91+
port: 5432
92+
database: keycloak
93+
username: keycloak
94+
password:
95+
secretKeyRef:
96+
name:
97+
key:
98+
8799
secrets:
88100
bootstrapAdmin:
89101
enabled: true

0 commit comments

Comments
 (0)