Skip to content

Commit

Permalink
fix: template ingress route rules (#1156)
Browse files Browse the repository at this point in the history
* fix: template the ingress route rules

Signed-off-by: ericsyh <[email protected]>

* apply to slim chart

Signed-off-by: ericsyh <[email protected]>

* fix lint

Signed-off-by: ericsyh <[email protected]>

---------

Signed-off-by: ericsyh <[email protected]>
(cherry picked from commit 90232c1)
  • Loading branch information
ericsyh committed Mar 11, 2024
1 parent 171aadf commit 6116c22
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions charts/sn-platform-slim/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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://
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions charts/sn-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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://
Expand Down

0 comments on commit 6116c22

Please sign in to comment.