From 11838bbb7c184694bc81124a284da8ad0890ee9c Mon Sep 17 00:00:00 2001 From: Jason Elsocht Date: Thu, 25 Jul 2024 15:33:31 +0200 Subject: [PATCH] Allow manual override fo KC_HOSTNAME_URL and KC_ADMIN_HOSTNAME_URL Signed-off-by: Jason Elsocht --- bitnami/keycloak/Chart.yaml | 2 +- bitnami/keycloak/README.md | 4 ++- bitnami/keycloak/templates/statefulset.yaml | 27 +++++++++++---------- bitnami/keycloak/values.yaml | 8 ++++++ 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/bitnami/keycloak/Chart.yaml b/bitnami/keycloak/Chart.yaml index 61c3b47fa6bbfe..0a1e0350f6032a 100644 --- a/bitnami/keycloak/Chart.yaml +++ b/bitnami/keycloak/Chart.yaml @@ -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 diff --git a/bitnami/keycloak/README.md b/bitnami/keycloak/README.md index 008eee739d5f46..b1c51739e7b870 100644 --- a/bitnami/keycloak/README.md +++ b/bitnami/keycloak/README.md @@ -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. | `{}` | @@ -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. | `{}` | @@ -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. \ No newline at end of file +limitations under the License. diff --git a/bitnami/keycloak/templates/statefulset.yaml b/bitnami/keycloak/templates/statefulset.yaml index 6d036a174c0db1..24a1f2fbf8b643 100644 --- a/bitnami/keycloak/templates/statefulset.yaml +++ b/bitnami/keycloak/templates/statefulset.yaml @@ -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: diff --git a/bitnami/keycloak/values.yaml b/bitnami/keycloak/values.yaml index 8b8297b23046eb..7874f9a4a3ea24 100644 --- a/bitnami/keycloak/values.yaml +++ b/bitnami/keycloak/values.yaml @@ -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. @@ -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.