Skip to content

Commit

Permalink
Allow manual override fo KC_HOSTNAME_URL and KC_ADMIN_HOSTNAME_URL
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Elsocht <jason@tinkercloud.be>
  • Loading branch information
djas19 committed Jul 25, 2024
1 parent 450fa38 commit 11838bb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bitnami/keycloak/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ maintainers:
name: keycloak
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/keycloak
version: 21.7.5
version: 21.7.6
4 changes: 3 additions & 1 deletion bitnami/keycloak/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ As an alternative, you can use of the preset configurations for pod affinity, po
| `ingress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` |
| `ingress.hostname` | Default host for the ingress record (evaluated as template) | `keycloak.local` |
| `ingress.path` | Default path for the ingress record (evaluated as template) | `""` |
| `ingress.hostnameUrl` | Hostname url to pass to the keycloak service. | `""` |
| `ingress.servicePort` | Backend service port to use | `http` |
| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
| `ingress.labels` | Additional labels for the Ingress resource. | `{}` |
Expand All @@ -484,6 +485,7 @@ As an alternative, you can use of the preset configurations for pod affinity, po
| `adminIngress.apiVersion` | Force Ingress API version (automatically detected if not set) | `""` |
| `adminIngress.hostname` | Default host for the admin ingress record (evaluated as template) | `keycloak.local` |
| `adminIngress.path` | Default path for the admin ingress record (evaluated as template) | `""` |
| `adminIngress.hostnameUrl` | Admin hostname url to pass to the keycloak service. | `""` |
| `adminIngress.servicePort` | Backend service port to use | `http` |
| `adminIngress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
| `adminIngress.labels` | Additional labels for the Ingress resource. | `{}` |
Expand Down Expand Up @@ -802,4 +804,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
27 changes: 14 additions & 13 deletions bitnami/keycloak/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,23 +218,24 @@ spec:
{{- if and .Values.adminIngress.enabled .Values.adminIngress.hostname }}
- name: KC_HOSTNAME_ADMIN_URL
value: |-
{{ ternary "https://" "http://" ( or .Values.adminIngress.tls (eq .Values.proxy "edge") (not (empty .Values.proxyHeaders)) ) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.hostname "context" $) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.path "context" $) }}
{{ if .Values.adminIngress.hostnameUrl }}
{{- .Values.adminIngress.path }}
{{- else }}
{{- ternary "https://" "http://" ( or .Values.adminIngress.tls (eq .Values.proxy "edge") (not (empty .Values.proxyHeaders)) ) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.hostname "context" $) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.adminIngress.path "context" $) }}
{{- end }}
{{- end }}
{{- if and .Values.ingress.enabled .Values.ingress.hostname }}
- name: KC_HOSTNAME_URL
value: |-
{{ ternary "https://" "http://" ( or .Values.ingress.tls (eq .Values.proxy "edge") (not (empty .Values.proxyHeaders)) ) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.hostname "context" $) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.path "context" $) }}
{{- end }}
{{- if .Values.adminRealm }}
- name: KC_SPI_ADMIN_REALM
value: "{{ .Values.adminRealm }}"
{{- end }}
{{- if .Values.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
{{ if .Values.ingress.hostnameUrl -}}
{{- .Values.ingress.hostnameUrl }}
{{- else -}}
{{- ternary "https://" "http://" ( or .Values.ingress.tls (eq .Values.proxy "edge") (not (empty .Values.proxyHeaders)) ) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.hostname "context" $) -}}
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.path "context" $) }}
{{- end -}}
{{- end }}
envFrom:
- configMapRef:
Expand Down
8 changes: 8 additions & 0 deletions bitnami/keycloak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@ ingress:
hostname: keycloak.local
## @param ingress.path [string] Default path for the ingress record (evaluated as template)
##
hostnameUrl: ""
## @param ingress.hostnameUrl [string] Hostname url to pass to the keycloak service.
## Default this will be automatically constructed with ingress.hostname and ingress.path
##
path: "{{ .Values.httpRelativePath }}"
## @param ingress.servicePort Backend service port to use
## Default is http. Alternative is https.
Expand Down Expand Up @@ -732,6 +736,10 @@ adminIngress:
hostname: keycloak.local
## @param adminIngress.path [string] Default path for the admin ingress record (evaluated as template)
##
hostnameUrl: ""
## @param adminIngress.hostnameUrl [string] Admin hostname url to pass to the keycloak service.
## Default this will be automatically constructed with adminIngress.hostname and adminIngress.path
##
path: "{{ .Values.httpRelativePath }}"
## @param adminIngress.servicePort Backend service port to use
## Default is http. Alternative is https.
Expand Down

0 comments on commit 11838bb

Please sign in to comment.