-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds support for multiple wildcard ingress in the Grafana add-on
- Loading branch information
1 parent
0aaf4cf
commit d451318
Showing
3 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{{- if $.Values.multipleWildcardIngress.enabled -}} | ||
{{- $fullName := include "grafana.fullname" . -}} | ||
{{- $svcPort := $.Values.service.port -}} | ||
{{- range $index, $hostDetails := $.Values.multipleWildcardIngress.hosts }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ $fullName }} | ||
namespace: {{ include "grafana.namespace" $ }} | ||
labels: | ||
{{- include "grafana.labels" $ | nindent 4 }} | ||
annotations: | ||
nginx.ingress.kubernetes.io/proxy-body-size: 50m | ||
nginx.ingress.kubernetes.io/proxy-send-timeout: "60" | ||
nginx.ingress.kubernetes.io/proxy-read-timeout: "60" | ||
nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" | ||
{{- if $.Values.multipleWildcardIngress.rewriteCustomPathsEnabled }} | ||
nginx.ingress.kubernetes.io/rewrite-target: / | ||
{{- end }} | ||
# provider-agnostic default annotations | ||
# if value is provided as "null" or null, it is unset | ||
# adding a fix for scenarios where ingress annotations are inside ingress.annotations.normal | ||
{{- if not (hasKey $.Values.multipleWildcardIngress.annotations "normal")}} | ||
{{- if gt (len $.Values.multipleWildcardIngress.annotations) 0}} | ||
{{- range $k, $v := $.Values.multipleWildcardIngress.annotations }} | ||
{{- if $v}} | ||
{{- if and (not (eq $v "null")) $v}} | ||
{{ $k }}: {{ $v }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if hasKey $.Values.multipleWildcardIngress.annotations "normal"}} | ||
{{- if gt (len $.Values.multipleWildcardIngress.annotations.normal) 0}} | ||
{{- range $k, $v := $.Values.multipleWildcardIngress.annotations.normal }} | ||
{{- if $v}} | ||
{{- if and (not (eq $v "null")) $v}} | ||
{{ $k }}: {{ $v }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
{{- if hasKey $.Values.multipleWildcardIngress.annotations "kubernetes.io/ingress.class" }} | ||
ingressClassName: {{ index $.Values.multipleWildcardIngress.annotations "kubernetes.io/ingress.class" }} | ||
{{- else }} | ||
ingressClassName: {{ $.Values.multipleWildcardIngress.ingressClass }} | ||
{{- end }} | ||
{{- if $hostDetails.tlsSecret }} | ||
tls: | ||
- hosts: | ||
- {{ $hostDetails.hostName | quote }} | ||
secretName: {{ $hostDetails.tlsSecret }} | ||
{{- end }} | ||
rules: | ||
- host: {{ $hostDetails.hostName | quote }} | ||
http: | ||
paths: | ||
- pathType: ImplementationSpecific | ||
backend: | ||
service: | ||
name: {{ $fullName }} | ||
port: | ||
number: {{ $svcPort }} | ||
{{- if not (eq $index (sub (len $.Values.multipleWildcardIngress.hosts) 1)) }} | ||
--- | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters