From 257bb4562cb7424a4b459f481dd706d795278866 Mon Sep 17 00:00:00 2001 From: Eric Shen Date: Mon, 11 Mar 2024 14:25:22 +0800 Subject: [PATCH] fix: template ingress route rules (#1156) * fix: template the ingress route rules Signed-off-by: ericsyh * apply to slim chart Signed-off-by: ericsyh * fix lint Signed-off-by: ericsyh --------- Signed-off-by: ericsyh (cherry picked from commit 90232c186c39b8fb481ee1bb04531bfd559601da) --- .../control-center/control-center-ingress.yaml | 10 +++++----- charts/sn-platform-slim/values.yaml | 5 +++++ .../control-center/control-center-ingress.yaml | 10 +++++----- charts/sn-platform/values.yaml | 5 +++++ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/charts/sn-platform-slim/templates/control-center/control-center-ingress.yaml b/charts/sn-platform-slim/templates/control-center/control-center-ingress.yaml index 05b90af5..7db85123 100644 --- a/charts/sn-platform-slim/templates/control-center/control-center-ingress.yaml +++ b/charts/sn-platform-slim/templates/control-center/control-center-ingress.yaml @@ -72,7 +72,7 @@ spec: - http: paths: {{- if and .Values.monitoring.grafana .Values.ingress.control_center.endpoints.grafana }} - - path: /grafana + - path: {{.Values.ingress.control_center.paths.grafana}} {{- if $isIngressAPIStable }} pathType: {{ .Values.grafana.pathType | default "ImplementationSpecific" }} backend: @@ -87,7 +87,7 @@ spec: {{- end }} {{- end }} {{- if and .Values.monitoring.alert_manager .Values.ingress.control_center.endpoints.alertmanager }} - - path: /alerts + - path: {{.Values.ingress.control_center.paths.alertmanager}} {{- if $isIngressAPIStable }} pathType: {{ .Values.alert_manager.pathType | default "ImplementationSpecific" }} backend: @@ -102,7 +102,7 @@ spec: {{- end }} {{- end }} {{- if and .Values.monitoring.prometheus .Values.ingress.control_center.endpoints.prometheus }} - - path: /prometheus + - path: {{.Values.ingress.control_center.paths.prometheus}} {{- if $isIngressAPIStable }} pathType: {{ .Values.prometheus.pathType | default "ImplementationSpecific" }} backend: @@ -117,7 +117,7 @@ spec: {{- end }} {{- end }} {{- if .Values.components.streamnative_console }} - - path: / + - path: {{.Values.ingress.control_center.paths.streamnative_console}} {{- if $isIngressAPIStable }} pathType: {{ .Values.streamnative_console.pathType | default "ImplementationSpecific" }} backend: @@ -131,7 +131,7 @@ spec: servicePort: {{ .Values.streamnative_console.ports.frontend }} {{- end }} {{- else }} - - path: / + - path: {{.Values.ingress.control_center.paths.streamnative_console}} {{- if $isIngressAPIStable }} pathType: ImplementationSpecific backend: diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index cd29504e..7e898970 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -525,6 +525,11 @@ ingress: grafana: true prometheus: false alertmanager: false + paths: + grafana: /grafana + prometheus: /prometheus + alertmanager: /alerts + streamnative_console: / # Set external domain of the load balancer of ingress controller # external_domain: your.external.control.center.domain external_domain_scheme: https:// diff --git a/charts/sn-platform/templates/control-center/control-center-ingress.yaml b/charts/sn-platform/templates/control-center/control-center-ingress.yaml index 05b90af5..7db85123 100644 --- a/charts/sn-platform/templates/control-center/control-center-ingress.yaml +++ b/charts/sn-platform/templates/control-center/control-center-ingress.yaml @@ -72,7 +72,7 @@ spec: - http: paths: {{- if and .Values.monitoring.grafana .Values.ingress.control_center.endpoints.grafana }} - - path: /grafana + - path: {{.Values.ingress.control_center.paths.grafana}} {{- if $isIngressAPIStable }} pathType: {{ .Values.grafana.pathType | default "ImplementationSpecific" }} backend: @@ -87,7 +87,7 @@ spec: {{- end }} {{- end }} {{- if and .Values.monitoring.alert_manager .Values.ingress.control_center.endpoints.alertmanager }} - - path: /alerts + - path: {{.Values.ingress.control_center.paths.alertmanager}} {{- if $isIngressAPIStable }} pathType: {{ .Values.alert_manager.pathType | default "ImplementationSpecific" }} backend: @@ -102,7 +102,7 @@ spec: {{- end }} {{- end }} {{- if and .Values.monitoring.prometheus .Values.ingress.control_center.endpoints.prometheus }} - - path: /prometheus + - path: {{.Values.ingress.control_center.paths.prometheus}} {{- if $isIngressAPIStable }} pathType: {{ .Values.prometheus.pathType | default "ImplementationSpecific" }} backend: @@ -117,7 +117,7 @@ spec: {{- end }} {{- end }} {{- if .Values.components.streamnative_console }} - - path: / + - path: {{.Values.ingress.control_center.paths.streamnative_console}} {{- if $isIngressAPIStable }} pathType: {{ .Values.streamnative_console.pathType | default "ImplementationSpecific" }} backend: @@ -131,7 +131,7 @@ spec: servicePort: {{ .Values.streamnative_console.ports.frontend }} {{- end }} {{- else }} - - path: / + - path: {{.Values.ingress.control_center.paths.streamnative_console}} {{- if $isIngressAPIStable }} pathType: ImplementationSpecific backend: diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index 2d324ab5..99d9f680 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -600,6 +600,11 @@ ingress: grafana: true prometheus: false alertmanager: false + paths: + grafana: /grafana + prometheus: /prometheus + alertmanager: /alerts + streamnative_console: / # Set external domain of the load balancer of ingress controller # external_domain: your.external.control.center.domain external_domain_scheme: https://