From df1254f46b6cbe01d7c62e8b82032b1cc1b3782a Mon Sep 17 00:00:00 2001 From: Joel Hermanns Date: Wed, 27 Sep 2023 18:46:41 +0200 Subject: [PATCH] helm: add namespace settings where missing (#10713) **What this PR does / why we need it**: It adds the right `namespace` values for some components in the helm chart. **Which issue(s) this PR fixes**: Fixes #10048 **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/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](https://github.com/grafana/loki/commit/d10549e3ece02120974929894ee333d07755d213) I hope I did things right w.r.t. the changelog/README changes for the helm chart. Please let me know if I did something wrong :) --- production/helm/loki/CHANGELOG.md | 4 ++++ production/helm/loki/Chart.yaml | 2 +- production/helm/loki/README.md | 2 +- production/helm/loki/templates/monitoring/grafana-agent.yaml | 1 + production/helm/loki/templates/monitoring/logs-instance.yaml | 1 + production/helm/loki/templates/monitoring/pod-logs.yaml | 1 + .../helm/loki/templates/monitoring/servicemonitor.yaml | 1 + production/helm/loki/templates/write/hpa.yaml | 1 + .../helm/loki/templates/write/poddisruptionbudget-write.yaml | 1 + .../helm/loki/templates/write/service-write-headless.yaml | 1 + production/helm/loki/templates/write/service-write.yaml | 3 ++- production/helm/loki/templates/write/statefulset-write.yaml | 5 +++-- 12 files changed, 18 insertions(+), 5 deletions(-) diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md index 31fd46012b947..9c224f2a807f3 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.23.1 + +- [BUGFIX] Add missing namespaces to some components + ## 5.23.0 - [ENHANCEMENT] Add loki.storage.azure.connectionString to support Azure connection string diff --git a/production/helm/loki/Chart.yaml b/production/helm/loki/Chart.yaml index b0ef53f3f8f85..89d1e2f6c8e00 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.9.1 -version: 5.23.0 +version: 5.23.1 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 ba6ed3797b1d3..002898dad582a 100644 --- a/production/helm/loki/README.md +++ b/production/helm/loki/README.md @@ -1,6 +1,6 @@ # loki -![Version: 5.23.0](https://img.shields.io/badge/Version-5.23.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.1](https://img.shields.io/badge/AppVersion-2.9.1-informational?style=flat-square) +![Version: 5.23.1](https://img.shields.io/badge/Version-5.23.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.1](https://img.shields.io/badge/AppVersion-2.9.1-informational?style=flat-square) Helm chart for Grafana Loki in simple, scalable mode diff --git a/production/helm/loki/templates/monitoring/grafana-agent.yaml b/production/helm/loki/templates/monitoring/grafana-agent.yaml index 5aabe5ecc1eb7..e32a4adf7da36 100644 --- a/production/helm/loki/templates/monitoring/grafana-agent.yaml +++ b/production/helm/loki/templates/monitoring/grafana-agent.yaml @@ -4,6 +4,7 @@ apiVersion: monitoring.grafana.com/v1alpha1 kind: GrafanaAgent metadata: name: {{ include "loki.fullname" $ }} + namespace: {{ $.Release.Namespace }} labels: {{- include "loki.labels" $ | nindent 4 }} {{- with .labels }} diff --git a/production/helm/loki/templates/monitoring/logs-instance.yaml b/production/helm/loki/templates/monitoring/logs-instance.yaml index 34ab6e9a53b40..58d5fb045c0cf 100644 --- a/production/helm/loki/templates/monitoring/logs-instance.yaml +++ b/production/helm/loki/templates/monitoring/logs-instance.yaml @@ -4,6 +4,7 @@ apiVersion: monitoring.grafana.com/v1alpha1 kind: LogsInstance metadata: name: {{ include "loki.fullname" $ }} + namespace: {{ $.Release.Namespace }} {{- with .annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/production/helm/loki/templates/monitoring/pod-logs.yaml b/production/helm/loki/templates/monitoring/pod-logs.yaml index e8ced3dce6de2..4fa4d836fbce0 100644 --- a/production/helm/loki/templates/monitoring/pod-logs.yaml +++ b/production/helm/loki/templates/monitoring/pod-logs.yaml @@ -5,6 +5,7 @@ apiVersion: monitoring.grafana.com/v1alpha1 kind: PodLogs metadata: name: {{ include "loki.fullname" $ }} + namespace: {{ $.Release.Namespace }} {{- with .annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/production/helm/loki/templates/monitoring/servicemonitor.yaml b/production/helm/loki/templates/monitoring/servicemonitor.yaml index 4bc56a84740f5..856cee8f38391 100644 --- a/production/helm/loki/templates/monitoring/servicemonitor.yaml +++ b/production/helm/loki/templates/monitoring/servicemonitor.yaml @@ -5,6 +5,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ include "loki.fullname" $ }} + namespace: {{ $.Release.Namespace }} {{- with .annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/production/helm/loki/templates/write/hpa.yaml b/production/helm/loki/templates/write/hpa.yaml index 18d59dbd07572..ba88ee2ddddc9 100644 --- a/production/helm/loki/templates/write/hpa.yaml +++ b/production/helm/loki/templates/write/hpa.yaml @@ -9,6 +9,7 @@ apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: {{ include "loki.writeFullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "loki.writeLabels" . | nindent 4 }} spec: diff --git a/production/helm/loki/templates/write/poddisruptionbudget-write.yaml b/production/helm/loki/templates/write/poddisruptionbudget-write.yaml index 9e11a9871f637..24e135604a525 100644 --- a/production/helm/loki/templates/write/poddisruptionbudget-write.yaml +++ b/production/helm/loki/templates/write/poddisruptionbudget-write.yaml @@ -4,6 +4,7 @@ apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "loki.writeFullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "loki.writeLabels" . | nindent 4 }} spec: diff --git a/production/helm/loki/templates/write/service-write-headless.yaml b/production/helm/loki/templates/write/service-write-headless.yaml index 7cf25f8506e1c..71cdcb7b2db8c 100644 --- a/production/helm/loki/templates/write/service-write-headless.yaml +++ b/production/helm/loki/templates/write/service-write-headless.yaml @@ -5,6 +5,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "loki.writeFullname" . }}-headless + namespace: {{ $.Release.Namespace }} labels: {{- include "loki.writeSelectorLabels" . | nindent 4 }} {{- with .Values.loki.serviceLabels }} diff --git a/production/helm/loki/templates/write/service-write.yaml b/production/helm/loki/templates/write/service-write.yaml index 245b8e4a88f27..35a548c0330c3 100644 --- a/production/helm/loki/templates/write/service-write.yaml +++ b/production/helm/loki/templates/write/service-write.yaml @@ -5,6 +5,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "loki.writeFullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "loki.writeLabels" . | nindent 4 }} {{- with .Values.loki.serviceLabels }} @@ -33,4 +34,4 @@ spec: protocol: TCP selector: {{- include "loki.writeSelectorLabels" . | nindent 4 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/production/helm/loki/templates/write/statefulset-write.yaml b/production/helm/loki/templates/write/statefulset-write.yaml index 3c1d84fc3b611..42644c49c0929 100644 --- a/production/helm/loki/templates/write/statefulset-write.yaml +++ b/production/helm/loki/templates/write/statefulset-write.yaml @@ -5,6 +5,7 @@ apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "loki.writeFullname" . }} + namespace: {{ $.Release.Namespace }} labels: {{- include "loki.writeLabels" . | nindent 4 }} app.kubernetes.io/part-of: memberlist @@ -177,7 +178,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumeClaimTemplates: - - apiVersion: v1 + - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: data @@ -197,4 +198,4 @@ spec: {{- with .Values.write.extraVolumeClaimTemplates }} {{- toYaml . | nindent 4 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }}