From 94f059744677639cf099739bc127c90d9a530cb2 Mon Sep 17 00:00:00 2001 From: George Date: Wed, 26 Jul 2023 12:35:06 +0400 Subject: [PATCH] helm: add custom labels for loki ingress (#10009) **What this PR does / why we need it**: Custom labels for ingresses are usually addressed from values files, so we need this feature. **Which issue(s) this PR fixes**: **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 - [x] Tests updated - [x] `CHANGELOG.md` updated - [x] If the change is worth mentioning in the release notes, add `add-to-release-notes` label - [x] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_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](https://github.com/grafana/loki/commit/d10549e3ece02120974929894ee333d07755d213) --- production/helm/loki/CHANGELOG.md | 4 ++++ production/helm/loki/Chart.yaml | 2 +- production/helm/loki/README.md | 2 +- production/helm/loki/templates/ingress.yaml | 3 +++ production/helm/loki/values.yaml | 2 ++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md index 827781016c94e..344286b9428cb 100644 --- a/production/helm/loki/CHANGELOG.md +++ b/production/helm/loki/CHANGELOG.md @@ -13,6 +13,10 @@ Entries should include a reference to the pull request that introduced the chang [//]: # ( : 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.9.2 + +- [ENHANCEMENT] Add custom labels value for loki ingress + ## 5.9.1 - [BUGFIX] Fix loki helm chart helper function for loki.host to explicitly include gateway port diff --git a/production/helm/loki/Chart.yaml b/production/helm/loki/Chart.yaml index e31c35a6f8880..68f079bc8c16b 100644 --- a/production/helm/loki/Chart.yaml +++ b/production/helm/loki/Chart.yaml @@ -3,7 +3,7 @@ name: loki description: Helm chart for Grafana Loki in simple, scalable mode type: application appVersion: 2.8.3 -version: 5.9.1 +version: 5.9.2 home: https://grafana.github.io/helm-charts sources: - https://github.com/grafana/loki diff --git a/production/helm/loki/README.md b/production/helm/loki/README.md index c9288e5a1e7bb..fd1b30301e1bd 100644 --- a/production/helm/loki/README.md +++ b/production/helm/loki/README.md @@ -1,6 +1,6 @@ # loki -![Version: 5.9.1](https://img.shields.io/badge/Version-5.9.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.3](https://img.shields.io/badge/AppVersion-2.8.3-informational?style=flat-square) +![Version: 5.9.2](https://img.shields.io/badge/Version-5.9.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.8.3](https://img.shields.io/badge/AppVersion-2.8.3-informational?style=flat-square) Helm chart for Grafana Loki in simple, scalable mode diff --git a/production/helm/loki/templates/ingress.yaml b/production/helm/loki/templates/ingress.yaml index 99c29df6fdbe0..d4c2a09356fe7 100644 --- a/production/helm/loki/templates/ingress.yaml +++ b/production/helm/loki/templates/ingress.yaml @@ -7,6 +7,9 @@ metadata: namespace: {{ $.Release.Namespace }} labels: {{- include "loki.labels" . | nindent 4 }} + {{- with .Values.ingress.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 2e0fdf88d208d..6f06bcc450777 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -1130,6 +1130,8 @@ ingress: # nginx.ingress.kubernetes.io/auth-secret-type: auth-map # nginx.ingress.kubernetes.io/configuration-snippet: | # proxy_set_header X-Scope-OrgID $remote_user; + labels: {} + # blackbox.monitoring.exclude: "true" paths: write: - /api/prom/push