helm: use tpl for ingress hosts (#10175)

**What this PR does / why we need it**: Use tpl for ingress hosts.
Needed for values passed from globals in umbrella charts. We´re already
using this in [Grafana Helm
Chart](d8a6407197/charts/grafana/templates/ingress.yaml (L37)).

**Which issue(s) this PR fixes**:
Fixes #<issue number>

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [x] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [x] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e3ec)

---------

Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com>
pull/9246/head^2 helm-loki-5.12.0
christianjedroCDT 2 years ago committed by GitHub
parent 4d2a94ebd3
commit 7cd4890fda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      docs/sources/setup/install/helm/reference.md
  2. 4
      production/helm/loki/CHANGELOG.md
  3. 2
      production/helm/loki/Chart.yaml
  4. 2
      production/helm/loki/README.md
  5. 4
      production/helm/loki/templates/gateway/ingress-gateway.yaml
  6. 4
      production/helm/loki/templates/ingress.yaml
  7. 6
      production/helm/loki/values.yaml

@ -1094,7 +1094,7 @@ false
<tr>
<td>gateway.ingress.hosts</td>
<td>list</td>
<td>Hosts configuration for the gateway ingress</td>
<td>Hosts configuration for the gateway ingress, passed through the `tpl` function to allow templating</td>
<td><pre lang="json">
[
{
@ -1130,7 +1130,7 @@ false
<tr>
<td>gateway.ingress.tls</td>
<td>list</td>
<td>TLS configuration for the gateway ingress</td>
<td>TLS configuration for the gateway ingress. Hosts passed through the `tpl` function to allow templating</td>
<td><pre lang="json">
[
{
@ -1482,11 +1482,13 @@ false
</td>
</tr>
<tr>
<td>ingress.hosts[0]</td>
<td>string</td>
<td></td>
<td>ingress.hosts</td>
<td>list</td>
<td>Hosts configuration for the ingress, passed through the `tpl` function to allow templating</td>
<td><pre lang="json">
[
"loki.example.com"
]
</pre>
</td>
</tr>
@ -1673,7 +1675,7 @@ false
<tr>
<td>ingress.tls</td>
<td>list</td>
<td></td>
<td>TLS configuration for the ingress. Hosts passed through the `tpl` function to allow templating</td>
<td><pre lang="json">
[]
</pre>

@ -13,6 +13,10 @@ Entries should include a reference to the pull request that introduced the chang
[//]: # (<AUTOMATED_UPDATES_LOCATOR> : do not remove this line. This locator is used by the CI pipeline to automatically create a changelog entry for each new Loki release. Add other chart versions and respective changelog entries bellow this line.)
## 5.12.0
- [ENHANCEMENT] Use tpl function in ingress and gateway-ingress for hosts
## 5.11.0
- [CHANGE] Changed version of Loki to 2.8.4

@ -3,7 +3,7 @@ name: loki
description: Helm chart for Grafana Loki in simple, scalable mode
type: application
appVersion: 2.8.4
version: 5.11.0
version: 5.12.0
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki

@ -1,6 +1,6 @@
# loki
![Version: 5.11.0](https://img.shields.io/badge/Version-5.11.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.4](https://img.shields.io/badge/AppVersion-2.8.4-informational?style=flat-square)
![Version: 5.12.0](https://img.shields.io/badge/Version-5.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.4](https://img.shields.io/badge/AppVersion-2.8.4-informational?style=flat-square)
Helm chart for Grafana Loki in simple, scalable mode

@ -26,7 +26,7 @@ spec:
{{- range .Values.gateway.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
- {{ tpl . $ | quote }}
{{- end }}
{{- with .secretName }}
secretName: {{ . }}
@ -35,7 +35,7 @@ spec:
{{- end }}
rules:
{{- range .Values.gateway.ingress.hosts }}
- host: {{ .host | quote }}
- host: {{ tpl .host $ | quote }}
http:
paths:
{{- range .paths }}

@ -23,7 +23,7 @@ spec:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
- {{ tpl . $ | quote }}
{{- end }}
{{- with .secretName }}
secretName: {{ . }}
@ -32,7 +32,7 @@ spec:
{{- end }}
rules:
{{- range $.Values.ingress.hosts }}
- host: {{ . | quote }}
- host: {{ tpl . $ | quote }}
http:
paths:
{{- include "loki.ingress.servicePaths" $ | indent 10}}

@ -1152,8 +1152,10 @@ ingress:
- /loki/api/v1/rules
- /prometheus/api/v1/rules
- /prometheus/api/v1/alerts
# -- Hosts configuration for the ingress, passed through the `tpl` function to allow templating
hosts:
- loki.example.com
# -- TLS configuration for the ingress. Hosts passed through the `tpl` function to allow templating
tls: []
# - hosts:
# - loki.example.com
@ -1287,14 +1289,14 @@ gateway:
annotations: {}
# -- Labels for the gateway ingress
labels: {}
# -- Hosts configuration for the gateway ingress
# -- Hosts configuration for the gateway ingress, passed through the `tpl` function to allow templating
hosts:
- host: gateway.loki.example.com
paths:
- path: /
# -- pathType (e.g. ImplementationSpecific, Prefix, .. etc.) might also be required by some Ingress Controllers
# pathType: Prefix
# -- TLS configuration for the gateway ingress
# -- TLS configuration for the gateway ingress. Hosts passed through the `tpl` function to allow templating
tls:
- secretName: loki-gateway-tls
hosts:

Loading…
Cancel
Save