Skip to content

Commit

Permalink
Use correct Kong service port for ingress based on TLS settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hamadodene committed Jan 16, 2025
1 parent 31f5d62 commit 715bed8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions charts/kubernetes-dashboard/templates/networking/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
{{- if and .Values.app.ingress.enabled (eq .Values.app.mode "dashboard")}}
{{- include "kubernetes-dashboard.validate.ingressIssuerScope" $ }}


# Determine the service port to use for the ingress configuration
# If TLS is enabled in the ingress configuration, use the TLS service port.
# Otherwise, fall back to the HTTP service port.
{{- $servicePort := (ternary $.Values.kong.proxy.tls.servicePort $.Values.kong.proxy.http.servicePort $.Values.app.ingress.tls.enabled) }}

kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
Expand Down Expand Up @@ -73,7 +79,7 @@ spec:
service:
name: {{ template "kong.fullname" (index $.Subcharts "kong") }}-proxy
port:
number: {{ $.Values.kong.proxy.tls.servicePort }}
number: {{ $servicePort }}
{{- end }}
{{- else }}
- http:
Expand All @@ -84,6 +90,6 @@ spec:
service:
name: {{ template "kong.fullname" (index $.Subcharts "kong") }}-proxy
port:
number: {{ $.Values.kong.proxy.tls.servicePort }}
number: {{ $servicePort }}
{{- end }}
{{- end }}

0 comments on commit 715bed8

Please sign in to comment.