From b127efe6cd04125507d8d8604d9fcf98a7ae290c Mon Sep 17 00:00:00 2001 From: Juan Gonzalez Date: Mon, 25 Mar 2024 10:38:45 +0100 Subject: [PATCH 1/4] add support for helm namespace override --- .../mimir-distributed/templates/_helpers.tpl | 21 ++-- .../templates/admin-api/admin-api-dep.yaml | 4 +- .../templates/admin-api/admin-api-svc.yaml | 2 +- .../alertmanager/alertmanager-config.yaml | 2 +- .../alertmanager/alertmanager-dep.yaml | 4 +- .../alertmanager-statefulset.yaml | 4 +- .../alertmanager-svc-headless.yaml | 2 +- .../alertmanager/alertmanager-svc.yaml | 2 +- .../compactor/compactor-statefulset.yaml | 4 +- .../templates/compactor/compactor-svc.yaml | 2 +- .../continuous_test/continuous-test-dep.yaml | 4 +- .../continuous-test-svc-headless.yaml | 2 +- .../distributor/distributor-dep.yaml | 4 +- .../templates/distributor/distributor-so.yaml | 6 +- .../distributor/distributor-svc-headless.yaml | 2 +- .../distributor/distributor-svc.yaml | 2 +- .../templates/gateway/gateway-dep.yaml | 6 +- .../templates/gateway/gateway-ingress.yaml | 2 +- .../templates/gateway/gateway-route.yaml | 2 +- .../templates/gateway/gateway-svc.yaml | 2 +- .../templates/gateway/gateway-v2-hpa.yaml | 2 +- .../gateway/gateway-v2beta1-hpa.yaml | 2 +- .../templates/gateway/nginx-configmap.yaml | 2 +- .../templates/gateway/nginx-secret.yaml | 2 +- .../gossip-ring/gossip-ring-svc.yaml | 2 +- .../graphite-querier-dep.yaml | 4 +- .../graphite-querier-schemas-configmap.yaml | 2 +- .../graphite-querier-svc.yaml | 2 +- .../graphite-write-proxy-dep.yaml | 4 +- .../graphite-write-proxy-svc.yaml | 2 +- .../ingester/ingester-statefulset.yaml | 4 +- .../ingester/ingester-svc-headless.yaml | 2 +- .../templates/ingester/ingester-svc.yaml | 2 +- .../mimir-distributed/templates/ingress.yaml | 2 +- .../mimir-distributed/templates/lib/pdb.tpl | 2 +- .../templates/lib/service-monitor.tpl | 6 +- .../templates/license-secret.yaml | 2 +- .../memcached/_memcached-statefulset.tpl | 2 +- .../templates/memcached/_memcached-svc.tpl | 2 +- .../grafana-agent-cluster-role-binding.yaml | 6 +- .../grafana-agent-cluster-role.yaml | 2 +- .../metamonitoring/grafana-agent.yaml | 2 +- .../metamonitoring/grafana-dashboards.yaml | 2 +- .../kube-state-metrics-servmon.yaml | 2 +- .../kubelet-cadvisor-servmon.yaml | 2 +- .../logs-instance-usernames-secret.yaml | 2 +- .../metamonitoring/logs-instance.yaml | 2 +- .../metrics-instance-usernames-secret.yaml | 2 +- .../metamonitoring/metrics-instance.yaml | 2 +- .../metamonitoring/mixin-alerts.yaml | 2 +- .../templates/metamonitoring/pod-logs.yaml | 4 +- .../metamonitoring/prometheusrule.yaml | 2 +- .../metamonitoring/recording-rules.yaml | 2 +- .../templates/mimir-config.yaml | 2 +- .../templates/minio-secrets.yaml | 2 +- .../templates/minio/create-bucket-job.yaml | 2 +- .../templates/nginx/ingress.yaml | 2 +- .../templates/nginx/nginx-configmap.yaml | 2 +- .../templates/nginx/nginx-dep.yaml | 4 +- .../templates/nginx/nginx-secret.yaml | 2 +- .../templates/nginx/nginx-svc.yaml | 2 +- .../templates/nginx/nginx-v2-hpa.yaml | 2 +- .../templates/nginx/nginx-v2beta1-hpa.yaml | 2 +- .../templates/nginx/route.yaml | 2 +- .../overrides-exporter-dep.yaml | 4 +- .../overrides-exporter-svc.yaml | 2 +- .../templates/querier/querier-dep.yaml | 2 +- .../templates/querier/querier-so.yaml | 6 +- .../templates/querier/querier-svc.yaml | 2 +- .../query-frontend/query-frontend-dep.yaml | 4 +- .../query-frontend/query-frontend-so.yaml | 6 +- .../query-frontend-svc-headless.yaml | 2 +- .../query-frontend/query-frontend-svc.yaml | 2 +- .../query-scheduler/query-scheduler-dep.yaml | 2 +- .../query-scheduler-svc-headless.yaml | 2 +- .../query-scheduler/query-scheduler-svc.yaml | 2 +- .../mimir-distributed/templates/role.yaml | 2 +- .../templates/rolebinding.yaml | 2 +- .../templates/ruler/ruler-dep.yaml | 4 +- .../templates/ruler/ruler-sa.yaml | 2 +- .../templates/ruler/ruler-so.yaml | 6 +- .../templates/ruler/ruler-svc.yaml | 2 +- .../templates/runtime-configmap.yaml | 2 +- .../templates/securitycontextconstraints.yaml | 2 +- .../templates/serviceaccount.yaml | 2 +- .../templates/smoke-test/smoke-test-job.yaml | 2 +- .../store-gateway-statefulset.yaml | 4 +- .../store-gateway-svc-headless.yaml | 2 +- .../store-gateway/store-gateway-svc.yaml | 2 +- .../templates/tokengen/tokengen-job.yaml | 4 +- .../helm/charts/mimir-distributed/values.yaml | 107 +++++++++--------- 91 files changed, 190 insertions(+), 176 deletions(-) diff --git a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl index ba0000e8010..eb9dde115f1 100644 --- a/operations/helm/charts/mimir-distributed/templates/_helpers.tpl +++ b/operations/helm/charts/mimir-distributed/templates/_helpers.tpl @@ -6,6 +6,13 @@ Expand the name of the chart. {{- default ( include "mimir.infixName" . ) .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Override Namespace for multi-chart deployments. +*/}} +{{- define "mimir.namespace" -}} +{{- default $.Release.Namespace $.Values.namespaceOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). @@ -36,9 +43,9 @@ Calculate the gateway url */}} {{- define "mimir.gatewayUrl" -}} {{- if eq (include "mimir.gateway.isEnabled" . ) "true" -}} -http://{{ include "mimir.gateway.service.name" . }}.{{ .Release.Namespace }}.svc:{{ .Values.gateway.service.port | default (include "mimir.serverHttpListenPort" . ) }} +http://{{ include "mimir.gateway.service.name" . }}.{{ include "mimir.namespace" . }}.svc:{{ .Values.gateway.service.port | default (include "mimir.serverHttpListenPort" . ) }} {{- else -}} -http://{{ template "mimir.fullname" . }}-nginx.{{ .Release.Namespace }}.svc:{{ .Values.nginx.service.port }} +http://{{ template "mimir.fullname" . }}-nginx.{{ include "mimir.namespace" . }}.svc:{{ .Values.nginx.service.port }} {{- end -}} {{- end -}} @@ -160,23 +167,23 @@ Alertmanager cluster bind address {{- end -}} {{- define "mimir.chunksCacheAddress" -}} -dns+{{ template "mimir.fullname" . }}-chunks-cache.{{ .Release.Namespace }}.svc:{{ (index .Values "chunks-cache").port }} +dns+{{ template "mimir.fullname" . }}-chunks-cache.{{ include "mimir.namespace" . }}.svc:{{ (index .Values "chunks-cache").port }} {{- end -}} {{- define "mimir.indexCacheAddress" -}} -dns+{{ template "mimir.fullname" . }}-index-cache.{{ .Release.Namespace }}.svc:{{ (index .Values "index-cache").port }} +dns+{{ template "mimir.fullname" . }}-index-cache.{{ include "mimir.namespace" . }}.svc:{{ (index .Values "index-cache").port }} {{- end -}} {{- define "mimir.metadataCacheAddress" -}} -dns+{{ template "mimir.fullname" . }}-metadata-cache.{{ .Release.Namespace }}.svc:{{ (index .Values "metadata-cache").port }} +dns+{{ template "mimir.fullname" . }}-metadata-cache.{{ include "mimir.namespace" . }}.svc:{{ (index .Values "metadata-cache").port }} {{- end -}} {{- define "mimir.resultsCacheAddress" -}} -dns+{{ template "mimir.fullname" . }}-results-cache.{{ .Release.Namespace }}.svc:{{ (index .Values "results-cache").port }} +dns+{{ template "mimir.fullname" . }}-results-cache.{{ include "mimir.namespace" . }}.svc:{{ (index .Values "results-cache").port }} {{- end -}} {{- define "mimir.adminCacheAddress" -}} -dns+{{ template "mimir.fullname" . }}-admin-cache.{{ .Release.Namespace }}.svc:{{ (index .Values "admin-cache").port }} +dns+{{ template "mimir.fullname" . }}-admin-cache.{{ include "mimir.namespace" . }}.svc:{{ (index .Values "admin-cache").port }} {{- end -}} {{/* diff --git a/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-dep.yaml b/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-dep.yaml index 3923ca18483..33aa09ad5fc 100644 --- a/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-dep.yaml @@ -7,7 +7,7 @@ metadata: labels: {{- include "mimir.labels" (dict "ctx" . "component" "admin-api" "memberlist" true) | nindent 4 }} name: {{ include "mimir.resourceName" (dict "ctx" . "component" "admin-api") }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: replicas: {{ .Values.admin_api.replicas }} selector: @@ -21,7 +21,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "admin-api" "memberlist" true) | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "admin-api") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.admin_api.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-svc.yaml b/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-svc.yaml index 64dfb601644..32553d3e904 100644 --- a/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/admin-api/admin-api-svc.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.admin_api.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml index bae1b7c4273..9dadc675951 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-config.yaml @@ -8,7 +8,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "alertmanager" "memberlist" true) | nindent 4 }} annotations: {{- toYaml .Values.alertmanager.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} data: alertmanager_fallback_config.yaml: | {{- .Values.alertmanager.fallbackConfig | nindent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml index 15f90a10d74..e12570407a4 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-dep.yaml @@ -8,7 +8,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "alertmanager" "memberlist" true) | nindent 4 }} annotations: {{- toYaml .Values.alertmanager.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: replicas: {{ .Values.alertmanager.replicas }} selector: @@ -25,7 +25,7 @@ spec: {{- if .Values.alertmanager.fallbackConfig }} checksum/alertmanager-fallback-config: {{ include (print .Template.BasePath "/alertmanager/alertmanager-config.yaml") . | sha256sum }} {{- end }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.alertmanager.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml index 2daeab203d0..d341b60e5d2 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-statefulset.yaml @@ -13,7 +13,7 @@ metadata: {{- include "mimir.labels" $args | nindent 4 }} annotations: {{- include "mimir.componentAnnotations" $args | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: replicas: {{ $rolloutZone.replicas }} {{- if and (semverCompare ">= 1.23-0" (include "mimir.kubeVersion" .)) (.Values.alertmanager.persistentVolume.enableRetentionPolicy) }} @@ -63,7 +63,7 @@ spec: {{- if .Values.alertmanager.fallbackConfig }} checksum/alertmanager-fallback-config: {{ include (print .Template.BasePath "/alertmanager/alertmanager-config.yaml") . | sha256sum }} {{- end }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- with .Values.alertmanager.schedulerName }} schedulerName: {{ . | quote }} diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml index f3ced60f4e6..b7328fa27ab 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc-headless.yaml @@ -12,7 +12,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.alertmanager.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml index da6a7189992..278a5e2aa5d 100644 --- a/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/alertmanager/alertmanager-svc.yaml @@ -19,7 +19,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.alertmanager.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml index d9068678494..d73246a89f7 100644 --- a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-statefulset.yaml @@ -6,7 +6,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "compactor" "memberlist" true) | nindent 4 }} annotations: {{- toYaml .Values.compactor.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: podManagementPolicy: {{ .Values.compactor.podManagementPolicy }} {{- if and (semverCompare ">= 1.23-0" (include "mimir.kubeVersion" .)) (.Values.compactor.persistentVolume.enableRetentionPolicy) }} @@ -49,7 +49,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "compactor" "memberlist" true) | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "compactor") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- with .Values.compactor.schedulerName }} schedulerName: {{ . | quote }} diff --git a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml index a761a54740b..cbad48884cd 100644 --- a/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/compactor/compactor-svc.yaml @@ -9,7 +9,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.compactor.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-dep.yaml b/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-dep.yaml index 31c9050f387..5ad0a5c92e7 100644 --- a/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-dep.yaml @@ -7,7 +7,7 @@ metadata: labels: {{- include "mimir.labels" (dict "ctx" . "component" "continuous-test") | nindent 4 }} name: {{ include "mimir.resourceName" (dict "ctx" . "component" "continuous-test") }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: replicas: {{ .Values.continuous_test.replicas }} selector: @@ -21,7 +21,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "continuous-test") | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "continuous-test") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.continuous_test.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-svc-headless.yaml index 59aceb6d50a..271e518ff5b 100644 --- a/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/continuous_test/continuous-test-svc-headless.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.continuous_test.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml index 7f844b70ba2..801f8c8a369 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml @@ -6,7 +6,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "distributor" "memberlist" true) | nindent 4 }} annotations: {{- toYaml .Values.distributor.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- if not .Values.distributor.kedaAutoscaling.enabled }} # If replicas is not number (when using values file it's float64, when using --set arg it's int64) and is false (i.e. null) don't set it @@ -25,7 +25,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "distributor" "memberlist" true) | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "distributor") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.distributor.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-so.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-so.yaml index a0680f8786c..c586e1985bc 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-so.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-so.yaml @@ -7,7 +7,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "distributor") | nindent 4 }} annotations: {{- toYaml .Values.distributor.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: advanced: horizontalPodAutoscalerConfig: @@ -24,7 +24,7 @@ spec: kind: Deployment triggers: - metadata: - query: max_over_time(sum(sum by (pod) (rate(container_cpu_usage_seconds_total{container="distributor",namespace="{{ .Release.Namespace }}"}[5m])) and max by (pod) (up{container="distributor",namespace="{{ .Release.Namespace }}"}) > 0)[15m:]) * 1000 + query: max_over_time(sum(sum by (pod) (rate(container_cpu_usage_seconds_total{container="distributor",namespace="{{ include "mimir.namespace" . }}"}[5m])) and max by (pod) (up{container="distributor",namespace="{{ include "mimir.namespace" . }}"}) > 0)[15m:]) * 1000 serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} {{- $cpu_request := dig "requests" "cpu" nil .Values.distributor.resources }} threshold: {{ mulf (include "mimir.cpuToMilliCPU" (dict "value" $cpu_request)) (divf .Values.distributor.kedaAutoscaling.targetCPUUtilizationPercentage 100) | floor | int64 | quote }} @@ -33,7 +33,7 @@ spec: {{- end }} type: prometheus - metadata: - query: max_over_time(sum((sum by (pod) (container_memory_working_set_bytes{container="distributor",namespace="{{ .Release.Namespace }}"}) and max by (pod) (up{container="distributor",namespace="{{ .Release.Namespace }}"}) > 0) or vector(0))[15m:]) + sum(sum by (pod) (max_over_time(kube_pod_container_resource_requests{container="distributor",namespace="{{ .Release.Namespace }}", resource="memory"}[15m])) and max by (pod) (changes(kube_pod_container_status_restarts_total{container="distributor",namespace="{{ .Release.Namespace }}"}[15m]) > 0) and max by (pod) (kube_pod_container_status_last_terminated_reason{container="distributor",namespace="{{ .Release.Namespace }}", reason="OOMKilled"}) or vector(0)) + query: max_over_time(sum((sum by (pod) (container_memory_working_set_bytes{container="distributor",namespace="{{ include "mimir.namespace" . }}"}) and max by (pod) (up{container="distributor",namespace="{{ include "mimir.namespace" . }}"}) > 0) or vector(0))[15m:]) + sum(sum by (pod) (max_over_time(kube_pod_container_resource_requests{container="distributor",namespace="{{ include "mimir.namespace" . }}", resource="memory"}[15m])) and max by (pod) (changes(kube_pod_container_status_restarts_total{container="distributor",namespace="{{ include "mimir.namespace" . }}"}[15m]) > 0) and max by (pod) (kube_pod_container_status_last_terminated_reason{container="distributor",namespace="{{ include "mimir.namespace" . }}", reason="OOMKilled"}) or vector(0)) serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} {{- $mem_request := dig "requests" "memory" nil .Values.distributor.resources }} threshold: {{ mulf (include "mimir.siToBytes" (dict "value" $mem_request)) (divf .Values.distributor.kedaAutoscaling.targetMemoryUtilizationPercentage 100) | floor | int64 | quote }} diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml index d59b78c4824..bb15550445f 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc-headless.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.distributor.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml index 868949de140..d2a31657a25 100644 --- a/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/distributor/distributor-svc.yaml @@ -9,7 +9,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.distributor.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml index 0bcbf63e14f..4ecade4491d 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-dep.yaml @@ -9,7 +9,7 @@ metadata: labels: {{- include "mimir.labels" (dict "ctx" $ "component" "gateway") | nindent 4 }} name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "gateway") }} - namespace: {{ $.Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" $ | quote }} spec: {{- if not .autoscaling.enabled }} replicas: {{ .replicas }} @@ -31,7 +31,9 @@ spec: {{- $annotations = (dict "checksum/config" (include (print $.Template.BasePath "/gateway/nginx-configmap.yaml") $ | sha256sum )) | mergeOverwrite $annotations -}} {{- end -}} {{- $annotations | toYaml | nindent 8 }} - namespace: {{ $.Release.Namespace | quote }} + {{- with $ }} + namespace: {{ include "mimir.namespace" . | quote }} + {{- end }} spec: serviceAccountName: {{ include "mimir.serviceAccountName" $ }} {{- if .priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml index b6880deb5a1..a1e5a2741a0 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-ingress.yaml @@ -9,7 +9,7 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- with .Values.gateway.ingress.ingressClassName }} ingressClassName: {{ . }} diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml index a8a08878105..990d5197947 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-route.yaml @@ -9,7 +9,7 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: host: {{ tpl .Values.gateway.route.host $ | quote }} to: diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml index 67853fb4f72..dc4efe3f391 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-svc.yaml @@ -11,7 +11,7 @@ metadata: {{- end }} annotations: {{- toYaml .service.annotations | nindent 4 }} - namespace: {{ $.Release.Namespace | quote }} + namespace: {{ default (include "mimir.namespace" $ ) | quote }} spec: type: {{ .service.type }} {{- with .service.clusterIP }} diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml index b6ae5265762..a63a6889af4 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2-hpa.yaml @@ -6,7 +6,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "gateway") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "gateway") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml index 90e08cc9016..cd4137ef6d3 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/gateway-v2beta1-hpa.yaml @@ -6,7 +6,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "gateway") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "gateway") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml index 8a24a4efead..5696e2761ac 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-configmap.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "gateway-nginx") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "gateway-nginx") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} data: nginx.conf: | {{- tpl .Values.gateway.nginx.config.file . | nindent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml index 15402738a00..53742d6bc10 100644 --- a/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gateway/nginx-secret.yaml @@ -6,7 +6,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "gateway-nginx") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "gateway-nginx") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} stringData: .htpasswd: | {{- tpl .Values.gateway.nginx.basicAuth.htpasswd $ | nindent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml b/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml index 32da7fa2317..c46ed6827bc 100644 --- a/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/gossip-ring/gossip-ring-svc.yaml @@ -4,7 +4,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "gossip-ring") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "gossip-ring") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-dep.yaml b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-dep.yaml index c4b6ca188e6..65c7f445ef5 100644 --- a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-dep.yaml @@ -7,7 +7,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "graphite-querier") | nindent 4 }} annotations: {{- toYaml .Values.graphite.querier.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: replicas: {{ .Values.graphite.querier.replicas }} selector: @@ -21,7 +21,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "graphite-querier") | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "graphite-querier") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.graphite.querier.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-schemas-configmap.yaml b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-schemas-configmap.yaml index 1445a586746..dc5cb28f227 100644 --- a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-schemas-configmap.yaml +++ b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-schemas-configmap.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "graphite-schemas") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "graphite-schemas") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} data: storage-schemas.conf: | {{ .Values.graphite.querier.schemasConfiguration.storageSchemas | indent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-svc.yaml b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-svc.yaml index b954ebe8155..9afdcbb8cae 100644 --- a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-querier/graphite-querier-svc.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.graphite.querier.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-dep.yaml b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-dep.yaml index af330791d96..0391b4c578d 100644 --- a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-dep.yaml @@ -7,7 +7,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "graphite-write-proxy") | nindent 4 }} annotations: {{- toYaml .Values.graphite.write_proxy.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: replicas: {{ .Values.graphite.write_proxy.replicas }} selector: @@ -21,7 +21,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "graphite-write-proxy") | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "graphite-write-proxy") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.graphite.write_proxy.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-svc.yaml b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-svc.yaml index 07c02f16867..386c0d7b6e2 100644 --- a/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/graphite-proxy/graphite-write-proxy/graphite-write-proxy-svc.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.graphite.write_proxy.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml index 2a8c4affde4..ea670e3aa60 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-statefulset.yaml @@ -11,7 +11,7 @@ metadata: {{- include "mimir.labels" $args | nindent 4 }} annotations: {{- include "mimir.componentAnnotations" $args | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: podManagementPolicy: {{ .Values.ingester.podManagementPolicy }} replicas: {{ $rolloutZone.replicas }} @@ -59,7 +59,7 @@ spec: {{- include "mimir.podLabels" $args | nindent 8 }} annotations: {{- include "mimir.podAnnotations" $args | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- with .Values.ingester.schedulerName }} schedulerName: {{ . | quote }} diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml index 0c5c430c6a1..76c5408e09b 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc-headless.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.ingester.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml index 21afa4d7f48..8e1a259b40a 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingester/ingester-svc.yaml @@ -18,7 +18,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.ingester.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/ingress.yaml b/operations/helm/charts/mimir-distributed/templates/ingress.yaml index 97eb406994f..b31b84b8de4 100644 --- a/operations/helm/charts/mimir-distributed/templates/ingress.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ingress.yaml @@ -9,7 +9,7 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- with .Values.ingress.ingressClassName }} ingressClassName: {{ . }} diff --git a/operations/helm/charts/mimir-distributed/templates/lib/pdb.tpl b/operations/helm/charts/mimir-distributed/templates/lib/pdb.tpl index 81239bb7da2..80119f68ac5 100644 --- a/operations/helm/charts/mimir-distributed/templates/lib/pdb.tpl +++ b/operations/helm/charts/mimir-distributed/templates/lib/pdb.tpl @@ -13,7 +13,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" $.ctx "component" $.component) }} labels: {{- include "mimir.labels" (dict "ctx" $.ctx "component" $.component) | nindent 4 }} - namespace: {{ $.ctx.Release.Namespace | quote }} + namespace: {{ default $.ctx.Release.Namespace $.ctx.Values.namespaceOverride | trunc 63 | trimSuffix "-" | quote }} spec: selector: matchLabels: diff --git a/operations/helm/charts/mimir-distributed/templates/lib/service-monitor.tpl b/operations/helm/charts/mimir-distributed/templates/lib/service-monitor.tpl index ab0dbb24c26..aac82f9bdab 100644 --- a/operations/helm/charts/mimir-distributed/templates/lib/service-monitor.tpl +++ b/operations/helm/charts/mimir-distributed/templates/lib/service-monitor.tpl @@ -12,7 +12,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ include "mimir.resourceName" $ }} - namespace: {{ .namespace | default $.ctx.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $.ctx) | quote }} labels: {{- include "mimir.labels" $ | nindent 4 }} {{- with .labels }} @@ -28,7 +28,7 @@ spec: {{- toYaml .namespaceSelector | nindent 4 }} {{- else }} matchNames: - - {{ $.ctx.Release.Namespace }} + - {{ $.ctx.Release.Namespace | default (include "mimir.namespace" $.ctx) }} {{- end }} selector: matchLabels: @@ -48,7 +48,7 @@ spec: {{- end }} relabelings: - sourceLabels: [job] - replacement: "{{ $.ctx.Release.Namespace }}/{{ $.component }}" + replacement: "{{ $.ctx.Release.Namespace | default (include "mimir.namespace" $.ctx) }}/{{ $.component }}" targetLabel: job {{- if kindIs "string" .clusterLabel }} - replacement: "{{ .clusterLabel | default (include "mimir.clusterName" $.ctx) }}" diff --git a/operations/helm/charts/mimir-distributed/templates/license-secret.yaml b/operations/helm/charts/mimir-distributed/templates/license-secret.yaml index c992e8877f0..b8a0efc0957 100644 --- a/operations/helm/charts/mimir-distributed/templates/license-secret.yaml +++ b/operations/helm/charts/mimir-distributed/templates/license-secret.yaml @@ -6,7 +6,7 @@ metadata: name: {{ tpl .Values.license.secretName . }} labels: {{- include "mimir.labels" (dict "ctx" .) | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} data: license.jwt: {{ .Values.license.contents | b64enc }} {{- end -}} diff --git a/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-statefulset.tpl b/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-statefulset.tpl index 0c4bd003b8e..20074703426 100644 --- a/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-statefulset.tpl +++ b/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-statefulset.tpl @@ -12,7 +12,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" $.ctx "component" "memcached") | nindent 4 }} annotations: {{- toYaml .annotations | nindent 4 }} - namespace: {{ $.ctx.Release.Namespace | quote }} + namespace: {{ default $.ctx.Release.Namespace $.ctx.Values.namespaceOverride | trunc 63 | trimSuffix "-" | quote }} spec: podManagementPolicy: {{ .podManagementPolicy }} replicas: {{ .replicas }} diff --git a/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-svc.tpl b/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-svc.tpl index b70862a6afb..a85a42123b5 100644 --- a/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-svc.tpl +++ b/operations/helm/charts/mimir-distributed/templates/memcached/_memcached-svc.tpl @@ -15,7 +15,7 @@ metadata: {{- end }} annotations: {{- toYaml .service.annotations | nindent 4 }} - namespace: {{ $.ctx.Release.Namespace | quote }} + namespace: {{ default $.ctx.Release.Namespace $.ctx.Values.namespaceOverride | trunc 63 | trimSuffix "-" | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role-binding.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role-binding.yaml index 47d8cf59bd0..1fe3315ec3f 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role-binding.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role-binding.yaml @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "grafana-agent") }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }} roleRef: @@ -14,6 +14,8 @@ roleRef: subjects: - kind: ServiceAccount name: {{ include "mimir.serviceAccountName" $ }} - namespace: {{ .namespace | default $.Release.Namespace }} + {{- with $ }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) }} + {{- end }} {{- end }} {{- end }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role.yaml index 678d9165d29..613c2213f8c 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent-cluster-role.yaml @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "grafana-agent") }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }} rules: diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent.yaml index 9d0afaa7b18..78008dac74f 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-agent.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.grafana.com/v1alpha1 kind: GrafanaAgent metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "meta-monitoring") }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }} {{- with .labels }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-dashboards.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-dashboards.yaml index 1b05dbc2ec2..940cd041d7f 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-dashboards.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/grafana-dashboards.yaml @@ -8,7 +8,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ $name }} - namespace: {{ $.Release.Namespace }} + namespace: {{ include "mimir.namespace" $ }} labels: {{- include "mimir.labels" (dict "ctx" $) | nindent 4 }} {{- with .labels }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/kube-state-metrics-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/kube-state-metrics-servmon.yaml index d8b82aa12ff..c5e0c4520e2 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/kube-state-metrics-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/kube-state-metrics-servmon.yaml @@ -5,7 +5,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "k8s-ksm") }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }} {{- with .labels }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/kubelet-cadvisor-servmon.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/kubelet-cadvisor-servmon.yaml index 0446ce0c487..e4189c840e3 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/kubelet-cadvisor-servmon.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/kubelet-cadvisor-servmon.yaml @@ -5,7 +5,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "k8s-kubelet-cadvisor") }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }} {{- with .labels }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance-usernames-secret.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance-usernames-secret.yaml index 22e558b9384..312cad50e12 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance-usernames-secret.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance-usernames-secret.yaml @@ -4,7 +4,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "logs-instance-usernames") }} - namespace: {{ (($.Values.metaMonitoring).grafanaAgent).namespace | default $.Release.Namespace | quote }} + namespace: {{ (($.Values.metaMonitoring).grafanaAgent).namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }} data: diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance.yaml index 11c47e5fcb2..380baea444b 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/logs-instance.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.grafana.com/v1alpha1 kind: LogsInstance metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "meta-monitoring") }} - namespace: {{ (($.Values.metaMonitoring).grafanaAgent).namespace | default $.Release.Namespace | quote }} + namespace: {{ (($.Values.metaMonitoring).grafanaAgent).namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }} {{- with .labels }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance-usernames-secret.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance-usernames-secret.yaml index bd540fbdebc..5034fc21e36 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance-usernames-secret.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance-usernames-secret.yaml @@ -5,7 +5,7 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "metrics-instance-usernames") }} - namespace: {{ $.Values.metaMonitoring.grafanaAgent.namespace | default $.Release.Namespace | quote }} + namespace: {{ $.Values.metaMonitoring.grafanaAgent.namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }} data: diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance.yaml index 4549ad11817..f111727d203 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/metrics-instance.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.grafana.com/v1alpha1 kind: MetricsInstance metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "meta-monitoring") }} - namespace: {{ $.Values.metaMonitoring.grafanaAgent.namespace | default $.Release.Namespace | quote }} + namespace: {{ $.Values.metaMonitoring.grafanaAgent.namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }} {{- with .labels }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/mixin-alerts.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/mixin-alerts.yaml index 29023f3becc..069f6d9bd6c 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/mixin-alerts.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/mixin-alerts.yaml @@ -13,7 +13,7 @@ metadata: {{- with .labels }} {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} spec: {{- $.Files.Get "mixins/alerts.yaml" | nindent 2 }} {{- end }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/pod-logs.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/pod-logs.yaml index 78b799dbbaa..7636f57b628 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/pod-logs.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/pod-logs.yaml @@ -4,7 +4,7 @@ apiVersion: monitoring.grafana.com/v1alpha1 kind: PodLogs metadata: name: {{ include "mimir.resourceName" (dict "ctx" $ "component" "meta-monitoring") }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} labels: {{- include "mimir.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }} {{- with .labels }} @@ -34,7 +34,7 @@ spec: namespaceSelector: matchNames: - - {{ $.Release.Namespace | quote }} + - {{ include "mimir.namespace" $ | quote }} selector: matchLabels: diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/prometheusrule.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/prometheusrule.yaml index 9af08e85cf5..14e872cee75 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/prometheusrule.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/prometheusrule.yaml @@ -13,7 +13,7 @@ metadata: {{- with .labels }} {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | (include "mimir.namespace" $ ) | quote }} spec: groups: {{- toYaml .groups | nindent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/metamonitoring/recording-rules.yaml b/operations/helm/charts/mimir-distributed/templates/metamonitoring/recording-rules.yaml index 682236fdbf8..9704a2b45bc 100644 --- a/operations/helm/charts/mimir-distributed/templates/metamonitoring/recording-rules.yaml +++ b/operations/helm/charts/mimir-distributed/templates/metamonitoring/recording-rules.yaml @@ -13,7 +13,7 @@ metadata: {{- with .labels }} {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .namespace | default $.Release.Namespace | quote }} + namespace: {{ .namespace | default (include "mimir.namespace" $ ) | quote }} spec: {{- $.Files.Get "mixins/rules.yaml" | nindent 2 }} {{- end }} diff --git a/operations/helm/charts/mimir-distributed/templates/mimir-config.yaml b/operations/helm/charts/mimir-distributed/templates/mimir-config.yaml index af72cc83163..99a52852a58 100644 --- a/operations/helm/charts/mimir-distributed/templates/mimir-config.yaml +++ b/operations/helm/charts/mimir-distributed/templates/mimir-config.yaml @@ -9,7 +9,7 @@ metadata: name: {{ tpl .Values.externalConfigSecretName . }} labels: {{- include "mimir.labels" (dict "ctx" .) | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} {{- if eq .Values.configStorageType "Secret" }} data: mimir.yaml: {{ include "mimir.calculatedConfig" . | b64enc }} diff --git a/operations/helm/charts/mimir-distributed/templates/minio-secrets.yaml b/operations/helm/charts/mimir-distributed/templates/minio-secrets.yaml index e646f65cb37..613fb6328c3 100644 --- a/operations/helm/charts/mimir-distributed/templates/minio-secrets.yaml +++ b/operations/helm/charts/mimir-distributed/templates/minio-secrets.yaml @@ -5,7 +5,7 @@ metadata: name: mimir-minio-secret labels: {{- include "mimir.labels" (dict "ctx" .) | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} type: Opaque data: MINIO_ROOT_USER: {{ .Values.minio.rootUser | b64enc }} diff --git a/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml b/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml index 7750dbad1c9..346bb9c6ef3 100644 --- a/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml +++ b/operations/helm/charts/mimir-distributed/templates/minio/create-bucket-job.yaml @@ -9,7 +9,7 @@ kind: Job metadata: {{- $minioSub := index .Subcharts "minio" }} name: {{ include "mimir.resourceName" (dict "ctx" . "component" "make-minio-buckets") }}-{{ $minioSub.Chart.Version }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} labels: app: {{ template "minio.name" . }}-make-bucket-job chart: {{ template "minio.chart" . }} diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/ingress.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/ingress.yaml index 1ca7da7f719..bee48c8cb3d 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/ingress.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/ingress.yaml @@ -11,7 +11,7 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- if .Values.nginx.ingress.ingressClassName }} ingressClassName: {{ .Values.nginx.ingress.ingressClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-configmap.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-configmap.yaml index 2f4ebefa8cd..ab2930e093d 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-configmap.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-configmap.yaml @@ -6,7 +6,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} data: nginx.conf: | {{- tpl .Values.nginx.nginxConfig.file . | nindent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-dep.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-dep.yaml index cc62d8ca09c..a23b8cd77c2 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-dep.yaml @@ -8,7 +8,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }} annotations: {{- toYaml .Values.nginx.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- if not .Values.nginx.autoscaling.enabled }} replicas: {{ .Values.nginx.replicas }} @@ -32,7 +32,7 @@ spec: {{- end }} labels: {{- include "mimir.podLabels" (dict "ctx" . "component" "nginx") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ include "mimir.serviceAccountName" . }} {{- if .Values.image.pullSecrets }} diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-secret.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-secret.yaml index 3bb1d01fa2c..1f323538243 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-secret.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-secret.yaml @@ -6,7 +6,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} stringData: .htpasswd: | {{- tpl .Values.nginx.basicAuth.htpasswd $ | nindent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-svc.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-svc.yaml index 1cad15bd8d7..90d149e4454 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-svc.yaml @@ -11,7 +11,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.nginx.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: {{ .Values.nginx.service.type }} {{- with .Values.nginx.service.clusterIP }} diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2-hpa.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2-hpa.yaml index 3b7e022cce3..f8f0b002e0f 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2-hpa.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2-hpa.yaml @@ -7,7 +7,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2beta1-hpa.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2beta1-hpa.yaml index 9ce76db5eee..5ed2c2c05ad 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2beta1-hpa.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/nginx-v2beta1-hpa.yaml @@ -7,7 +7,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "nginx") }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "nginx") | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/operations/helm/charts/mimir-distributed/templates/nginx/route.yaml b/operations/helm/charts/mimir-distributed/templates/nginx/route.yaml index 4eb3645b8c2..e826bad92d7 100644 --- a/operations/helm/charts/mimir-distributed/templates/nginx/route.yaml +++ b/operations/helm/charts/mimir-distributed/templates/nginx/route.yaml @@ -9,7 +9,7 @@ metadata: annotations: {{- toYaml . | nindent 4 }} {{- end }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: host: {{ .Values.nginx.route.host }} to: diff --git a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml index 19b4142fa15..0ca0e0ebae9 100644 --- a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-dep.yaml @@ -7,7 +7,7 @@ metadata: labels: {{- include "mimir.labels" (dict "ctx" . "component" "overrides-exporter") | nindent 4 }} name: {{ include "mimir.resourceName" (dict "ctx" . "component" "overrides-exporter") }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: replicas: {{ .Values.overrides_exporter.replicas }} selector: @@ -21,7 +21,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "overrides-exporter") | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "overrides-exporter") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.overrides_exporter.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml index 5e42a7f3f64..a1e6fd2cfe4 100644 --- a/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/overrides-exporter/overrides-exporter-svc.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.overrides_exporter.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml b/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml index 918b3b2b131..de21637c04b 100644 --- a/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/querier/querier-dep.yaml @@ -6,7 +6,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "querier" "memberlist" true) | nindent 4 }} annotations: {{- toYaml .Values.querier.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- if not .Values.querier.kedaAutoscaling.enabled }} # If replicas is not number (when using values file it's float64, when using --set arg it's int64) and is false (i.e. null) don't set it diff --git a/operations/helm/charts/mimir-distributed/templates/querier/querier-so.yaml b/operations/helm/charts/mimir-distributed/templates/querier/querier-so.yaml index 6649ced1cb8..dd0a6d7fffe 100644 --- a/operations/helm/charts/mimir-distributed/templates/querier/querier-so.yaml +++ b/operations/helm/charts/mimir-distributed/templates/querier/querier-so.yaml @@ -10,7 +10,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "querier") | nindent 4 }} annotations: {{- toYaml .Values.querier.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: advanced: horizontalPodAutoscalerConfig: @@ -27,7 +27,7 @@ spec: kind: Deployment triggers: - metadata: - query: sum(max_over_time(cortex_query_scheduler_inflight_requests{container="query-scheduler",namespace="{{ .Release.Namespace }}",quantile="0.5"}[1m])) + query: sum(max_over_time(cortex_query_scheduler_inflight_requests{container="query-scheduler",namespace="{{ include "mimir.namespace" . }}",quantile="0.5"}[1m])) serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} threshold: {{ .Values.querier.kedaAutoscaling.querySchedulerInflightRequestsThreshold | quote }} {{- if .Values.kedaAutoscaling.customHeaders }} @@ -36,7 +36,7 @@ spec: name: cortex_querier_hpa_default type: prometheus - metadata: - query: sum(rate(cortex_querier_request_duration_seconds_sum{container="querier",namespace="{{ .Release.Namespace }}"}[1m])) + query: sum(rate(cortex_querier_request_duration_seconds_sum{container="querier",namespace="{{ include "mimir.namespace" . }}"}[1m])) serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} threshold: {{ .Values.querier.kedaAutoscaling.querySchedulerInflightRequestsThreshold | quote }} {{- if .Values.kedaAutoscaling.customHeaders }} diff --git a/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml b/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml index 1eb323ec5a7..6ec81fa923c 100644 --- a/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/querier/querier-svc.yaml @@ -9,7 +9,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.querier.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml index e0d1e629d7c..652a4a981e9 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-dep.yaml @@ -6,7 +6,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "query-frontend") | nindent 4 }} annotations: {{- toYaml .Values.query_frontend.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- if not .Values.query_frontend.kedaAutoscaling.enabled }} # If replicas is not number (when using values file it's float64, when using --set arg it's int64) and is false (i.e. null) don't set it @@ -25,7 +25,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "query-frontend") | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "query-frontend") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.query_frontend.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-so.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-so.yaml index 2ed95021b96..89d0b4ff342 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-so.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-so.yaml @@ -7,7 +7,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "query-frontend") | nindent 4 }} annotations: {{- toYaml .Values.query_frontend.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: advanced: horizontalPodAutoscalerConfig: @@ -24,7 +24,7 @@ spec: kind: Deployment triggers: - metadata: - query: max_over_time(sum(sum by (pod) (rate(container_cpu_usage_seconds_total{container="query-frontend",namespace="{{ .Release.Namespace }}"}[5m])) and max by (pod) (up{container="query-frontend",namespace="{{ .Release.Namespace }}"}) > 0)[15m:]) * 1000 + query: max_over_time(sum(sum by (pod) (rate(container_cpu_usage_seconds_total{container="query-frontend",namespace="{{ include "mimir.namespace" . }}"}[5m])) and max by (pod) (up{container="query-frontend",namespace="{{ include "mimir.namespace" . }}"}) > 0)[15m:]) * 1000 serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} {{- $cpu_request := dig "requests" "cpu" nil .Values.query_frontend.resources }} threshold: {{ mulf (include "mimir.cpuToMilliCPU" (dict "value" $cpu_request)) (divf .Values.query_frontend.kedaAutoscaling.targetCPUUtilizationPercentage 100) | floor | int64 | quote }} @@ -33,7 +33,7 @@ spec: {{- end }} type: prometheus - metadata: - query: max_over_time(sum((sum by (pod) (container_memory_working_set_bytes{container="query-frontend",namespace="{{ .Release.Namespace }}"}) and max by (pod) (up{container="query-frontend",namespace="{{ .Release.Namespace }}"}) > 0) or vector(0))[15m:]) + sum(sum by (pod) (max_over_time(kube_pod_container_resource_requests{container="query-frontend",namespace="{{ .Release.Namespace }}", resource="memory"}[15m])) and max by (pod) (changes(kube_pod_container_status_restarts_total{container="query-frontend",namespace="{{ .Release.Namespace }}"}[15m]) > 0) and max by (pod) (kube_pod_container_status_last_terminated_reason{container="query-frontend",namespace="{{ .Release.Namespace }}", reason="OOMKilled"}) or vector(0)) + query: max_over_time(sum((sum by (pod) (container_memory_working_set_bytes{container="query-frontend",namespace="{{ include "mimir.namespace" . }}"}) and max by (pod) (up{container="query-frontend",namespace="{{ include "mimir.namespace" . }}"}) > 0) or vector(0))[15m:]) + sum(sum by (pod) (max_over_time(kube_pod_container_resource_requests{container="query-frontend",namespace="{{ include "mimir.namespace" . }}", resource="memory"}[15m])) and max by (pod) (changes(kube_pod_container_status_restarts_total{container="query-frontend",namespace="{{ include "mimir.namespace" . }}"}[15m]) > 0) and max by (pod) (kube_pod_container_status_last_terminated_reason{container="query-frontend",namespace="{{ include "mimir.namespace" . }}", reason="OOMKilled"}) or vector(0)) serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} {{- $mem_request := dig "requests" "memory" nil .Values.query_frontend.resources }} threshold: {{ mulf (include "mimir.siToBytes" (dict "value" $mem_request)) (divf .Values.query_frontend.kedaAutoscaling.targetMemoryUtilizationPercentage 100) | floor | int64 | quote }} diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml index b30e7f86630..13ea7367bff 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc-headless.yaml @@ -11,7 +11,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.query_frontend.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml index 3eec5d64204..37f83eaaf0e 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-frontend/query-frontend-svc.yaml @@ -9,7 +9,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.query_frontend.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml index e76301917d0..58cb33a088b 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-dep.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "query-scheduler") }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "query-scheduler") | nindent 4 }} annotations: diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml index c02dba718bf..170fead55d6 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc-headless.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "query-scheduler") }}-headless - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "query-scheduler") | nindent 4 }} prometheus.io/service-monitor: "false" diff --git a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml index abef45e5724..25b5a1319f4 100644 --- a/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/query-scheduler/query-scheduler-svc.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "query-scheduler") }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} labels: {{- include "mimir.labels" (dict "ctx" . "component" "query-scheduler") | nindent 4 }} {{- with .Values.query_scheduler.service.labels }} diff --git a/operations/helm/charts/mimir-distributed/templates/role.yaml b/operations/helm/charts/mimir-distributed/templates/role.yaml index 8e1eff7bb99..bbae2a8fa42 100644 --- a/operations/helm/charts/mimir-distributed/templates/role.yaml +++ b/operations/helm/charts/mimir-distributed/templates/role.yaml @@ -7,7 +7,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" .) }} labels: {{- include "mimir.labels" (dict "ctx" .) | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} rules: {{- if $usePSP }} - apiGroups: ['extensions'] diff --git a/operations/helm/charts/mimir-distributed/templates/rolebinding.yaml b/operations/helm/charts/mimir-distributed/templates/rolebinding.yaml index 7450540671b..776f465f756 100644 --- a/operations/helm/charts/mimir-distributed/templates/rolebinding.yaml +++ b/operations/helm/charts/mimir-distributed/templates/rolebinding.yaml @@ -7,7 +7,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" .) }} labels: {{- include "mimir.labels" (dict "ctx" .) | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml index 4d3ac294359..d515f61b431 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-dep.yaml @@ -7,7 +7,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 4 }} annotations: {{- toYaml .Values.ruler.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- if not .Values.ruler.kedaAutoscaling.enabled }} replicas: {{ .Values.ruler.replicas }} @@ -23,7 +23,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "ruler" "memberlist" true) | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "ruler") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.ruler.serviceAccountName" . }} {{- if .Values.ruler.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-sa.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-sa.yaml index 8993cf19702..393ecb4dbc4 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-sa.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-sa.yaml @@ -10,5 +10,5 @@ metadata: {{- end }} annotations: {{- toYaml .Values.ruler.serviceAccount.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} {{- end }} diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-so.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-so.yaml index 670037e1a08..09493aa2467 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-so.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-so.yaml @@ -7,7 +7,7 @@ metadata: {{- include "mimir.labels" (dict "ctx" . "component" "ruler") | nindent 4 }} annotations: {{- toYaml .Values.ruler.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: advanced: horizontalPodAutoscalerConfig: @@ -24,7 +24,7 @@ spec: kind: Deployment triggers: - metadata: - query: max_over_time(sum(sum by (pod) (rate(container_cpu_usage_seconds_total{container="ruler",namespace="{{ .Release.Namespace }}"}[5m])) and max by (pod) (up{container="ruler",namespace="{{ .Release.Namespace }}"}) > 0)[15m:]) * 1000 + query: max_over_time(sum(sum by (pod) (rate(container_cpu_usage_seconds_total{container="ruler",namespace="{{ include "mimir.namespace" . }}"}[5m])) and max by (pod) (up{container="ruler",namespace="{{ include "mimir.namespace" . }}"}) > 0)[15m:]) * 1000 serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} {{- $cpu_request := dig "requests" "cpu" nil .Values.ruler.resources }} threshold: {{ mulf (include "mimir.cpuToMilliCPU" (dict "value" $cpu_request)) (divf .Values.ruler.kedaAutoscaling.targetCPUUtilizationPercentage 100) | floor | int64 | quote }} @@ -33,7 +33,7 @@ spec: {{- end }} type: prometheus - metadata: - query: max_over_time(sum((sum by (pod) (container_memory_working_set_bytes{container="ruler",namespace="{{ .Release.Namespace }}"}) and max by (pod) (up{container="ruler",namespace="{{ .Release.Namespace }}"}) > 0) or vector(0))[15m:]) + sum(sum by (pod) (max_over_time(kube_pod_container_resource_requests{container="ruler",namespace="{{ .Release.Namespace }}", resource="memory"}[15m])) and max by (pod) (changes(kube_pod_container_status_restarts_total{container="ruler",namespace="{{ .Release.Namespace }}"}[15m]) > 0) and max by (pod) (kube_pod_container_status_last_terminated_reason{container="ruler",namespace="{{ .Release.Namespace }}", reason="OOMKilled"}) or vector(0)) + query: max_over_time(sum((sum by (pod) (container_memory_working_set_bytes{container="ruler",namespace="{{ include "mimir.namespace" . }}"}) and max by (pod) (up{container="ruler",namespace="{{ include "mimir.namespace" . }}"}) > 0) or vector(0))[15m:]) + sum(sum by (pod) (max_over_time(kube_pod_container_resource_requests{container="ruler",namespace="{{ include "mimir.namespace" . }}", resource="memory"}[15m])) and max by (pod) (changes(kube_pod_container_status_restarts_total{container="ruler",namespace="{{ include "mimir.namespace" . }}"}[15m]) > 0) and max by (pod) (kube_pod_container_status_last_terminated_reason{container="ruler",namespace="{{ include "mimir.namespace" . }}", reason="OOMKilled"}) or vector(0)) serverAddress: {{ include "mimir.kedaPrometheusAddress" (dict "ctx" $) }} {{- $mem_request := dig "requests" "memory" nil .Values.ruler.resources }} threshold: {{ mulf (include "mimir.siToBytes" (dict "value" $mem_request)) (divf .Values.ruler.kedaAutoscaling.targetMemoryUtilizationPercentage 100) | floor | int64 | quote }} diff --git a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml index 477f6266590..b57dbc65fac 100644 --- a/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/ruler/ruler-svc.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.ruler.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/runtime-configmap.yaml b/operations/helm/charts/mimir-distributed/templates/runtime-configmap.yaml index bdca1c86715..0c25d6b1f7a 100644 --- a/operations/helm/charts/mimir-distributed/templates/runtime-configmap.yaml +++ b/operations/helm/charts/mimir-distributed/templates/runtime-configmap.yaml @@ -4,7 +4,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" . "component" "runtime") }} labels: {{- include "mimir.labels" (dict "ctx" .) | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} data: runtime.yaml: | {{ tpl (toYaml .Values.runtimeConfig) . | nindent 4 }} diff --git a/operations/helm/charts/mimir-distributed/templates/securitycontextconstraints.yaml b/operations/helm/charts/mimir-distributed/templates/securitycontextconstraints.yaml index dcb3758a7b4..802efa63854 100644 --- a/operations/helm/charts/mimir-distributed/templates/securitycontextconstraints.yaml +++ b/operations/helm/charts/mimir-distributed/templates/securitycontextconstraints.yaml @@ -5,7 +5,7 @@ metadata: name: {{ include "mimir.resourceName" (dict "ctx" .) }} labels: {{- include "mimir.labels" (dict "ctx" .) | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} allowHostDirVolumePlugin: true allowHostIPC: false allowHostNetwork: false diff --git a/operations/helm/charts/mimir-distributed/templates/serviceaccount.yaml b/operations/helm/charts/mimir-distributed/templates/serviceaccount.yaml index 732a68bc575..2da54a97322 100644 --- a/operations/helm/charts/mimir-distributed/templates/serviceaccount.yaml +++ b/operations/helm/charts/mimir-distributed/templates/serviceaccount.yaml @@ -10,5 +10,5 @@ metadata: {{- end }} annotations: {{- toYaml .Values.serviceAccount.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} {{- end }} diff --git a/operations/helm/charts/mimir-distributed/templates/smoke-test/smoke-test-job.yaml b/operations/helm/charts/mimir-distributed/templates/smoke-test/smoke-test-job.yaml index 323c0d24263..4197d78247d 100644 --- a/operations/helm/charts/mimir-distributed/templates/smoke-test/smoke-test-job.yaml +++ b/operations/helm/charts/mimir-distributed/templates/smoke-test/smoke-test-job.yaml @@ -10,7 +10,7 @@ metadata: {{- toYaml .Values.smoke_test.annotations | nindent 4 }} {{- end }} "helm.sh/hook": test - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: backoffLimit: 5 completions: 1 diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml index 4da75e157f9..da4369c5946 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-statefulset.yaml @@ -11,7 +11,7 @@ metadata: {{- include "mimir.labels" $args | nindent 4 }} annotations: {{- include "mimir.componentAnnotations" $args | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: podManagementPolicy: {{ .Values.store_gateway.podManagementPolicy }} replicas: {{ $rolloutZone.replicas }} @@ -59,7 +59,7 @@ spec: {{- include "mimir.podLabels" $args | nindent 8 }} annotations: {{- include "mimir.podAnnotations" $args | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: {{- with .Values.store_gateway.schedulerName }} schedulerName: {{ . | quote }} diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml index 2fb878ecaac..14402b640c1 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc-headless.yaml @@ -10,7 +10,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.store_gateway.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP clusterIP: None diff --git a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml index d637a070c70..a3e09919364 100644 --- a/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml +++ b/operations/helm/charts/mimir-distributed/templates/store-gateway/store-gateway-svc.yaml @@ -18,7 +18,7 @@ metadata: {{- end }} annotations: {{- toYaml .Values.store_gateway.service.annotations | nindent 4 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: type: ClusterIP ports: diff --git a/operations/helm/charts/mimir-distributed/templates/tokengen/tokengen-job.yaml b/operations/helm/charts/mimir-distributed/templates/tokengen/tokengen-job.yaml index 7af1ba506de..b678b216b83 100644 --- a/operations/helm/charts/mimir-distributed/templates/tokengen/tokengen-job.yaml +++ b/operations/helm/charts/mimir-distributed/templates/tokengen/tokengen-job.yaml @@ -11,7 +11,7 @@ metadata: {{- toYaml .Values.tokengenJob.annotations | nindent 4 }} {{- end }} "helm.sh/hook": post-install - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: backoffLimit: 6 completions: 1 @@ -23,7 +23,7 @@ spec: {{- include "mimir.podLabels" (dict "ctx" . "component" "tokengen") | nindent 8 }} annotations: {{- include "mimir.podAnnotations" (dict "ctx" . "component" "tokengen") | nindent 8 }} - namespace: {{ .Release.Namespace | quote }} + namespace: {{ include "mimir.namespace" . | quote }} spec: serviceAccountName: {{ template "mimir.serviceAccountName" . }} {{- if .Values.tokengenJob.priorityClassName }} diff --git a/operations/helm/charts/mimir-distributed/values.yaml b/operations/helm/charts/mimir-distributed/values.yaml index 238a2b9c5eb..54a50adf800 100644 --- a/operations/helm/charts/mimir-distributed/values.yaml +++ b/operations/helm/charts/mimir-distributed/values.yaml @@ -26,6 +26,9 @@ kubeVersionOverride: null # Note: Grafana provided dashboards rely on the default naming and will need changes. nameOverride: null +# -- Overrides the chart's namespace. +namespaceOverride: null + # -- Overrides the chart's computed fullname. Used to change the full prefix of resource names. E.g. myRelease-mimir-ingester-1 to fullnameOverride-ingester-1. # Note: Grafana provided dashboards rely on the default naming and will need changes. fullnameOverride: null @@ -108,7 +111,7 @@ vaultAgent: caCertPath: "" mimir: - # -- Base config file for Grafana Mimir and Grafana Enterprise Metrics. Contains Helm templates that are evaulated at install/upgrade. + # -- Base config file for Grafana Mimir and Grafana Enterprise Metrics. Contains Helm templates that are evaluated at install/upgrade. # To modify the resulting configuration, either copy and alter 'mimir.config' as a whole or use the 'mimir.structuredConfig' to add and modify certain YAML elements. config: | usage_stats: @@ -132,7 +135,7 @@ mimir: s3: access_key_id: {{ .Values.minio.rootUser }} bucket_name: enterprise-metrics-admin - endpoint: {{ .Release.Name }}-minio.{{ .Release.Namespace }}.svc:9000 + endpoint: {{ .Release.Name }}-minio.{{ include "mimir.namespace" . }}.svc:9000 insecure: true secret_access_key: {{ .Values.minio.rootPassword }} {{- end }} @@ -163,7 +166,7 @@ mimir: s3: access_key_id: {{ .Values.minio.rootUser }} bucket_name: {{ include "mimir.minioBucketPrefix" . }}-ruler - endpoint: {{ .Release.Name }}-minio.{{ .Release.Namespace }}.svc:9000 + endpoint: {{ .Release.Name }}-minio.{{ include "mimir.namespace" . }}.svc:9000 insecure: true secret_access_key: {{ .Values.minio.rootPassword }} {{- end }} @@ -208,7 +211,7 @@ mimir: s3: access_key_id: {{ .Values.minio.rootUser }} bucket_name: {{ include "mimir.minioBucketPrefix" . }}-tsdb - endpoint: {{ .Release.Name }}-minio.{{ .Release.Namespace }}.svc:9000 + endpoint: {{ .Release.Name }}-minio.{{ include "mimir.namespace" . }}.svc:9000 insecure: true secret_access_key: {{ .Values.minio.rootPassword }} {{- end }} @@ -252,44 +255,44 @@ mimir: query_sharding_target_series_per_shard: 2500 {{- end }} {{- if .Values.query_scheduler.enabled }} - scheduler_address: {{ template "mimir.fullname" . }}-query-scheduler-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} + scheduler_address: {{ template "mimir.fullname" . }}-query-scheduler-headless.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverGrpcListenPort" . }} {{- end }} frontend_worker: grpc_client_config: max_send_msg_size: 419430400 # 400MiB {{- if .Values.query_scheduler.enabled }} - scheduler_address: {{ template "mimir.fullname" . }}-query-scheduler-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} + scheduler_address: {{ template "mimir.fullname" . }}-query-scheduler-headless.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverGrpcListenPort" . }} {{- else }} - frontend_address: {{ template "mimir.fullname" . }}-query-frontend-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} + frontend_address: {{ template "mimir.fullname" . }}-query-frontend-headless.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverGrpcListenPort" . }} {{- end }} {{- if and .Values.enterprise.enabled }} gateway: proxy: admin_api: - url: http://{{ template "mimir.fullname" . }}-admin-api.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-admin-api.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} alertmanager: - url: http://{{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} compactor: - url: http://{{ template "mimir.fullname" . }}-compactor.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-compactor.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} default: - url: http://{{ template "mimir.fullname" . }}-admin-api.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-admin-api.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} distributor: - url: dns:///{{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}:{{ include "mimir.serverGrpcListenPort" . }} + url: dns:///{{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}:{{ include "mimir.serverGrpcListenPort" . }} ingester: - url: http://{{ template "mimir.fullname" . }}-ingester-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-ingester-headless.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} query_frontend: - url: http://{{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-query-frontend.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} ruler: - url: http://{{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} store_gateway: - url: http://{{ template "mimir.fullname" . }}-store-gateway-headless.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-store-gateway-headless.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} {{- if and .Values.enterprise.enabled .Values.graphite.enabled }} graphite_write_proxy: - url: http://{{ template "mimir.fullname" . }}-graphite-write-proxy.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-graphite-write-proxy.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} graphite_querier: - url: http://{{ template "mimir.fullname" . }}-graphite-querier.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }} + url: http://{{ template "mimir.fullname" . }}-graphite-querier.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }} {{- end}} {{- end }} @@ -314,7 +317,7 @@ mimir: instrumentation: enabled: true distributor_client: - address: dns:///{{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}:{{ include "mimir.serverGrpcListenPort" . }} + address: dns:///{{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}:{{ include "mimir.serverGrpcListenPort" . }} license: path: "/license/license.jwt" @@ -334,7 +337,7 @@ mimir: abort_if_cluster_join_fails: false compression_enabled: false join_members: - - dns+{{ include "mimir.fullname" . }}-gossip-ring.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}:{{ include "mimir.memberlistBindPort" . }} + - dns+{{ include "mimir.fullname" . }}-gossip-ring.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}:{{ include "mimir.memberlistBindPort" . }} querier: # With query sharding we run more but smaller queries. We must strike a balance @@ -347,7 +350,7 @@ mimir: max_outstanding_requests_per_tenant: 800 ruler: - alertmanager_url: dnssrvnoa+http://_http-metrics._tcp.{{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}/alertmanager + alertmanager_url: dnssrvnoa+http://_http-metrics._tcp.{{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}/alertmanager enable_api: true rule_path: /data @@ -356,7 +359,7 @@ mimir: {{- if .Values.minio.enabled }} backend: s3 s3: - endpoint: {{ .Release.Name }}-minio.{{ .Release.Namespace }}.svc:9000 + endpoint: {{ .Release.Name }}-minio.{{ include "mimir.namespace" . }}.svc:9000 bucket_name: {{ include "mimir.minioBucketPrefix" . }}-ruler access_key_id: {{ .Values.minio.rootUser }} secret_access_key: {{ .Values.minio.rootPassword }} @@ -395,11 +398,11 @@ mimir: write_proxy: distributor_client: - address: dns:///{{ template "mimir.fullname" . }}-distributor.{{ .Release.Namespace }}.svc:{{ include "mimir.serverGrpcListenPort" . }} + address: dns:///{{ template "mimir.fullname" . }}-distributor.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverGrpcListenPort" . }} querier: remote_read: - query_address: http://{{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc:{{ include "mimir.serverHttpListenPort" . }}/prometheus + query_address: http://{{ template "mimir.fullname" . }}-query-frontend.{{ include "mimir.namespace" . }}.svc:{{ include "mimir.serverHttpListenPort" . }}/prometheus proxy_bad_requests: false schemas: @@ -407,11 +410,11 @@ mimir: default_storage_aggregations_file: /etc/graphite-proxy/storage-aggregations.conf aggregation_cache: memcached: - addresses: dnssrvnoa+{{ template "mimir.fullname" . }}-gr-aggr-cache.{{ .Release.Namespace}}.svc:11211 + addresses: dnssrvnoa+{{ template "mimir.fullname" . }}-gr-aggr-cache.{{ include "mimir.namespace" .}}.svc:11211 timeout: 1s metric_name_cache: memcached: - addresses: dnssrvnoa+{{ template "mimir.fullname" . }}-gr-metricname-cache.{{ .Release.Namespace}}.svc:11211 + addresses: dnssrvnoa+{{ template "mimir.fullname" . }}-gr-metricname-cache.{{ include "mimir.namespace" .}}.svc:11211 timeout: 1s {{- end}} @@ -2617,66 +2620,66 @@ nginx: # Distributor endpoints location /distributor { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /api/v1/push { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location /otlp/v1/metrics { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Alertmanager endpoints location {{ template "mimir.alertmanagerHttpPrefix" . }} { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /multitenant_alertmanager/status { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /api/v1/alerts { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Ruler endpoints location {{ template "mimir.prometheusHttpPrefix" . }}/config/v1/rules { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location {{ template "mimir.prometheusHttpPrefix" . }}/api/v1/rules { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location {{ template "mimir.prometheusHttpPrefix" . }}/api/v1/alerts { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /ruler/ring { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Rest of {{ template "mimir.prometheusHttpPrefix" . }} goes to the query frontend location {{ template "mimir.prometheusHttpPrefix" . }} { - set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$query_frontend:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Buildinfo endpoint can go to any component location = /api/v1/status/buildinfo { - set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$query_frontend:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Compactor endpoint for uploading blocks location /api/v1/upload/block/ { - set $compactor {{ template "mimir.fullname" . }}-compactor.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $compactor {{ template "mimir.fullname" . }}-compactor.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$compactor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } @@ -3019,66 +3022,66 @@ gateway: # Distributor endpoints location /distributor { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /api/v1/push { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location /otlp/v1/metrics { - set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $distributor {{ template "mimir.fullname" . }}-distributor-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$distributor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Alertmanager endpoints location {{ template "mimir.alertmanagerHttpPrefix" . }} { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /multitenant_alertmanager/status { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /api/v1/alerts { - set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $alertmanager {{ template "mimir.fullname" . }}-alertmanager-headless.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$alertmanager:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Ruler endpoints location {{ template "mimir.prometheusHttpPrefix" . }}/config/v1/rules { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location {{ template "mimir.prometheusHttpPrefix" . }}/api/v1/rules { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location {{ template "mimir.prometheusHttpPrefix" . }}/api/v1/alerts { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } location = /ruler/ring { - set $ruler {{ template "mimir.fullname" . }}-ruler.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $ruler {{ template "mimir.fullname" . }}-ruler.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$ruler:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Rest of {{ template "mimir.prometheusHttpPrefix" . }} goes to the query frontend location {{ template "mimir.prometheusHttpPrefix" . }} { - set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$query_frontend:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Buildinfo endpoint can go to any component location = /api/v1/status/buildinfo { - set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $query_frontend {{ template "mimir.fullname" . }}-query-frontend.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$query_frontend:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } # Compactor endpoint for uploading blocks location /api/v1/upload/block/ { - set $compactor {{ template "mimir.fullname" . }}-compactor.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}; + set $compactor {{ template "mimir.fullname" . }}-compactor.{{ include "mimir.namespace" . }}.svc.{{ .Values.global.clusterDomain }}; proxy_pass http://$compactor:{{ include "mimir.serverHttpListenPort" . }}$request_uri; } From 7e184ef5aa93fd7baa4a69896775410c96f9549d Mon Sep 17 00:00:00 2001 From: Juan Gonzalez Date: Mon, 25 Mar 2024 10:44:43 +0100 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7539640db68..8fd6bd82b60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## main / unreleased ### Grafana Mimir - +* [ENHANCEMENT] Helm: add `namespaceOverride` variable to override default namespace behavior. * [CHANGE] Querier: the CLI flag `-querier.minimize-ingester-requests` has been moved from "experimental" to "advanced". #7638 * [CHANGE] Ingester: `/ingester/flush` endpoint is now only allowed to execute only while the ingester is in `Running` state. The 503 status code is returned if the endpoint is called while the ingester is not in `Running` state. #7486 * [FEATURE] Store-gateway: Allow specific tenants to be enabled or disabled via `-store-gateway.enabled-tenants` or `-store-gateway.disabled-tenants` CLI flags or their corresponding YAML settings. #7653 From f53293958555da60b32cccc119e3fe21f1a1aa20 Mon Sep 17 00:00:00 2001 From: Juan Gonzalez Date: Mon, 25 Mar 2024 10:48:20 +0100 Subject: [PATCH 3/4] revert Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd6bd82b60..7539640db68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## main / unreleased ### Grafana Mimir -* [ENHANCEMENT] Helm: add `namespaceOverride` variable to override default namespace behavior. + * [CHANGE] Querier: the CLI flag `-querier.minimize-ingester-requests` has been moved from "experimental" to "advanced". #7638 * [CHANGE] Ingester: `/ingester/flush` endpoint is now only allowed to execute only while the ingester is in `Running` state. The 503 status code is returned if the endpoint is called while the ingester is not in `Running` state. #7486 * [FEATURE] Store-gateway: Allow specific tenants to be enabled or disabled via `-store-gateway.enabled-tenants` or `-store-gateway.disabled-tenants` CLI flags or their corresponding YAML settings. #7653 From 68473d4a48d475f37c05e2aca652e61aee314e7d Mon Sep 17 00:00:00 2001 From: Juan Gonzalez Date: Mon, 25 Mar 2024 10:49:48 +0100 Subject: [PATCH 4/4] Update Changelog --- operations/helm/charts/mimir-distributed/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/operations/helm/charts/mimir-distributed/CHANGELOG.md b/operations/helm/charts/mimir-distributed/CHANGELOG.md index 71cb0dcbb36..6ae6f5cd701 100644 --- a/operations/helm/charts/mimir-distributed/CHANGELOG.md +++ b/operations/helm/charts/mimir-distributed/CHANGELOG.md @@ -28,6 +28,7 @@ Entries should include a reference to the Pull Request that introduced the chang ## main / unreleased +* [ENHANCEMENT] Add `namespaceOverride` option to change default Helm namespace installation behavior. * [CHANGE] Do not render resource blocks for `initContainers`, `nodeSelector`, `affinity` and `tolerations` if they are empty. * [CHANGE] Rollout-operator: remove default CPU limit. #7125 * [CHANGE] Ring: relaxed the hash ring heartbeat period and timeout for distributor, ingester, store-gateway and compactor: #6860