Skip to content

Commit 126d382

Browse files
authored
Use correct Kong service port for ingress based on TLS settings (#9863)
1 parent 2e5bee9 commit 126d382

File tree

1 file changed

+8
-2
lines changed
  • charts/kubernetes-dashboard/templates/networking

1 file changed

+8
-2
lines changed

charts/kubernetes-dashboard/templates/networking/ingress.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
{{- if and .Values.app.ingress.enabled (eq .Values.app.mode "dashboard")}}
1616
{{- include "kubernetes-dashboard.validate.ingressIssuerScope" $ }}
1717

18+
19+
# Determine the service port to use for the ingress configuration
20+
# If TLS is enabled in the ingress configuration, use the TLS service port.
21+
# Otherwise, fall back to the HTTP service port.
22+
{{- $servicePort := (ternary $.Values.kong.proxy.tls.servicePort $.Values.kong.proxy.http.servicePort $.Values.app.ingress.tls.enabled) }}
23+
1824
kind: Ingress
1925
apiVersion: networking.k8s.io/v1
2026
metadata:
@@ -73,7 +79,7 @@ spec:
7379
service:
7480
name: {{ template "kong.fullname" (index $.Subcharts "kong") }}-proxy
7581
port:
76-
number: {{ $.Values.kong.proxy.tls.servicePort }}
82+
number: {{ $servicePort }}
7783
{{- end }}
7884
{{- else }}
7985
- http:
@@ -84,6 +90,6 @@ spec:
8490
service:
8591
name: {{ template "kong.fullname" (index $.Subcharts "kong") }}-proxy
8692
port:
87-
number: {{ $.Values.kong.proxy.tls.servicePort }}
93+
number: {{ $servicePort }}
8894
{{- end }}
8995
{{- end }}

0 commit comments

Comments
 (0)