From 753df4950264fdd8924ef97f838e4c9465b2a760 Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Fri, 22 Nov 2024 16:10:56 +0200 Subject: [PATCH] fix: override app.kubernetes.io/version label if custom image tag is set (#1782) --- charts/victoria-logs-single/CHANGELOG.md | 3 +- charts/victoria-logs-single/Chart.lock | 6 +-- charts/victoria-logs-single/Chart.yaml | 4 +- .../templates/dashboard.yaml | 4 +- .../templates/server-deployment.yaml | 1 - .../templates/server-service-monitor.yaml | 5 ++- .../templates/server-service.yaml | 2 +- .../templates/server-statefulset.yaml | 1 - charts/victoria-metrics-agent/CHANGELOG.md | 3 +- charts/victoria-metrics-agent/Chart.lock | 6 +-- .../templates/configmap.yaml | 2 +- .../templates/statefulset.yaml | 1 - charts/victoria-metrics-alert/CHANGELOG.md | 3 +- charts/victoria-metrics-alert/Chart.lock | 6 +-- .../templates/alertmanager-configmap.yaml | 9 +++-- .../templates/alertmanager-pvc.yaml | 13 +++--- .../templates/server-alerts-configmap.yaml | 5 ++- .../templates/server-pdb.yaml | 3 +- charts/victoria-metrics-anomaly/CHANGELOG.md | 3 +- charts/victoria-metrics-anomaly/Chart.lock | 6 +-- .../templates/configmap.yaml | 13 +++--- .../templates/controller.yaml | 1 + .../templates/pdb.yaml | 3 +- .../templates/pod-monitor.yaml | 7 ++-- charts/victoria-metrics-auth/CHANGELOG.md | 2 + charts/victoria-metrics-auth/Chart.lock | 6 +-- charts/victoria-metrics-cluster/CHANGELOG.md | 4 +- charts/victoria-metrics-cluster/Chart.lock | 6 +-- .../tests/__snapshot__/hpa_test.yaml.snap | 8 ++++ .../tests/__snapshot__/ingress_test.yaml.snap | 3 ++ .../tests/__snapshot__/service_test.yaml.snap | 8 ++++ .../tests/__snapshot__/vmauth_test.yaml.snap | 2 + .../__snapshot__/vminsert_test.yaml.snap | 2 + .../__snapshot__/vmselect_test.yaml.snap | 4 ++ .../__snapshot__/vmstorage_test.yaml.snap | 2 + .../victoria-metrics-distributed/CHANGELOG.md | 2 +- .../victoria-metrics-distributed/Chart.lock | 6 +-- .../templates/per-az/vmagent.yaml | 28 +++++++------ .../per-az/vmauth-read-balancer.yaml | 32 ++++++++------- .../templates/per-az/vmauth-read-proxy.yaml | 2 +- .../per-az/vmauth-write-balancer.yaml | 25 ++++++------ .../templates/per-az/vmcluster.yaml | 2 + .../templates/vmauth-read.yaml | 29 +++++++------- .../templates/vmauth-write.yaml | 27 +++++++------ .../tests/__snapshot__/vmauth_test.yaml.snap | 32 +++++++++++++++ .../tests/vmauth_test.yaml | 40 ++++++++++++++++++- charts/victoria-metrics-gateway/CHANGELOG.md | 3 +- charts/victoria-metrics-gateway/Chart.lock | 6 +-- .../templates/deployment.yaml | 1 - .../victoria-metrics-k8s-stack/CHANGELOG.md | 4 +- charts/victoria-metrics-k8s-stack/Chart.lock | 8 ++-- charts/victoria-metrics-k8s-stack/Chart.yaml | 2 +- .../templates/_helpers.tpl | 10 ++--- .../rules/additionalVictoriaMetricsRules.yml | 9 +++-- .../alertmanager/custom-templates.yaml | 4 +- .../alertmanager/monzo-template.yaml | 7 ++-- .../alertmanager/vmalertmanager.yaml | 2 +- .../vmagent/vmagent.yaml | 2 +- .../vmalert/custom-templates.yaml | 9 +++-- .../vmalert/notifiers.yaml | 13 +++--- .../vmalert/vmalert.yaml | 7 ++-- .../vmauth/vmauth.yaml | 7 ++-- .../vmcluster/vmcluster.yaml | 2 +- .../vmsingle/vmsingle.yml | 7 ++-- charts/victoria-metrics-operator/CHANGELOG.md | 3 +- charts/victoria-metrics-operator/Chart.lock | 6 +-- charts/victoria-metrics-single/CHANGELOG.md | 3 +- charts/victoria-metrics-single/Chart.lock | 6 +-- .../templates/relabel-configmap.yaml | 5 ++- .../templates/scrape-configmap.yaml | 7 ++-- .../templates/server-service-monitor.yaml | 5 ++- 71 files changed, 328 insertions(+), 192 deletions(-) diff --git a/charts/victoria-logs-single/CHANGELOG.md b/charts/victoria-logs-single/CHANGELOG.md index 8fea2e4a5..f3c7d4778 100644 --- a/charts/victoria-logs-single/CHANGELOG.md +++ b/charts/victoria-logs-single/CHANGELOG.md @@ -2,7 +2,8 @@ - Removed redundant `VECTOR_SELF_NODE_NAME` env variable from vector values. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1727). - Added Vector dashboard. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1721). -- updated common dependency 0.0.23 -> 0.0.28 +- updated common dependency 0.0.23 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.8.1 diff --git a/charts/victoria-logs-single/Chart.lock b/charts/victoria-logs-single/Chart.lock index 05222eeb8..6f111a003 100644 --- a/charts/victoria-logs-single/Chart.lock +++ b/charts/victoria-logs-single/Chart.lock @@ -4,6 +4,6 @@ dependencies: version: 0.37.0 - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:6d7491d33d1e6d34e3a69c40e68e06f248b527bc427cac5e7ade443de74fe8f3 -generated: "2024-11-21T10:19:10.296280383Z" + version: 0.0.31 +digest: sha256:5dcd605c5df47cc38dc451f11ebd73de4a91b8c67e0d432ad300fda842f0616a +generated: "2024-11-21T12:04:48.049715677Z" diff --git a/charts/victoria-logs-single/Chart.yaml b/charts/victoria-logs-single/Chart.yaml index 8250b2c02..183a3fd17 100644 --- a/charts/victoria-logs-single/Chart.yaml +++ b/charts/victoria-logs-single/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: v0.41.0 +appVersion: v1.0.0 description: Victoria Logs Single version - high-performance, cost-effective and scalable logs storage name: victoria-logs-single -version: 0.8.1 +version: 0.8.2 sources: - https://github.com/VictoriaMetrics/helm-charts icon: https://avatars.githubusercontent.com/u/43720803?s=200&v=4 diff --git a/charts/victoria-logs-single/templates/dashboard.yaml b/charts/victoria-logs-single/templates/dashboard.yaml index 9947ab4cf..103924535 100644 --- a/charts/victoria-logs-single/templates/dashboard.yaml +++ b/charts/victoria-logs-single/templates/dashboard.yaml @@ -3,7 +3,7 @@ {{- /* Create custom template context */}} -{{- $ctx := dict "helm" . -}} +{{- $ctx := dict "helm" . "appKey" "server" -}} {{- /* Loop through all dashboard files @@ -37,7 +37,7 @@ metadata: name: {{ printf "%s-%s" (include "vm.fullname" $) $dashboardName | replace "_" "" }} labels: app: {{ $app }} - {{- include "vm.labels" $ | nindent 4 }} + {{- include "vm.labels" $ctx | nindent 4 }} spec: json: | {{ $dashboardResult | nindent 4 }} {{- toYaml $.Values.dashboards.grafanaOperator.spec | nindent 2 }} diff --git a/charts/victoria-logs-single/templates/server-deployment.yaml b/charts/victoria-logs-single/templates/server-deployment.yaml index cf1ef15ca..04444ce79 100644 --- a/charts/victoria-logs-single/templates/server-deployment.yaml +++ b/charts/victoria-logs-single/templates/server-deployment.yaml @@ -52,7 +52,6 @@ spec: {{- if $app.securityContext.enabled }} securityContext: {{- include "vm.securityContext" (dict "securityContext" $app.securityContext "helm" $ctx) | nindent 12 }} {{- end }} - {{- $_ := set $ctx "app" $app }} image: {{ include "vm.image" $ctx }} imagePullPolicy: {{ $app.image.pullPolicy }} {{- if $app.containerWorkingDir }} diff --git a/charts/victoria-logs-single/templates/server-service-monitor.yaml b/charts/victoria-logs-single/templates/server-service-monitor.yaml index f122a33f5..58d2d232e 100644 --- a/charts/victoria-logs-single/templates/server-service-monitor.yaml +++ b/charts/victoria-logs-single/templates/server-service-monitor.yaml @@ -1,6 +1,7 @@ -{{- if and .Values.server.enabled .Values.server.serviceMonitor.enabled -}} +{{- $app := .Values.server }} +{{- if and $app.enabled $app.serviceMonitor.enabled -}} {{- $ctx := dict "helm" . "appKey" "server" }} -{{- $serviceMonitor := .Values.server.serviceMonitor -}} +{{- $serviceMonitor := $app.serviceMonitor -}} {{- $fullname := include "vm.plain.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} apiVersion: monitoring.coreos.com/v1 diff --git a/charts/victoria-logs-single/templates/server-service.yaml b/charts/victoria-logs-single/templates/server-service.yaml index 787e6c59a..bbdc4ed2e 100644 --- a/charts/victoria-logs-single/templates/server-service.yaml +++ b/charts/victoria-logs-single/templates/server-service.yaml @@ -1,5 +1,5 @@ -{{- $ctx := dict "helm" . "appKey" "server" }} {{- $app := .Values.server }} +{{- $ctx := dict "helm" . "appKey" "server" }} {{- $service := $app.service }} {{- if $app.enabled -}} apiVersion: v1 diff --git a/charts/victoria-logs-single/templates/server-statefulset.yaml b/charts/victoria-logs-single/templates/server-statefulset.yaml index 321f537c8..06c6866fa 100644 --- a/charts/victoria-logs-single/templates/server-statefulset.yaml +++ b/charts/victoria-logs-single/templates/server-statefulset.yaml @@ -46,7 +46,6 @@ spec: {{- if $app.securityContext.enabled }} securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.securityContext "helm" .) | nindent 12 }} {{- end }} - {{- $_ := set $ctx "app" $app }} image: {{ include "vm.image" $ctx }} imagePullPolicy: {{ $app.image.pullPolicy }} {{- with $app.containerWorkingDir }} diff --git a/charts/victoria-metrics-agent/CHANGELOG.md b/charts/victoria-metrics-agent/CHANGELOG.md index 6df833db8..fd8874255 100644 --- a/charts/victoria-metrics-agent/CHANGELOG.md +++ b/charts/victoria-metrics-agent/CHANGELOG.md @@ -1,6 +1,7 @@ ## Next release -- TODO +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.14.8 diff --git a/charts/victoria-metrics-agent/Chart.lock b/charts/victoria-metrics-agent/Chart.lock index 92eaf6c39..6f2f63ec0 100644 --- a/charts/victoria-metrics-agent/Chart.lock +++ b/charts/victoria-metrics-agent/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:c0bb6d5e095b1b195458e15c1f0702779e6359791b9d04f067cfd21de84785ea -generated: "2024-11-21T10:19:14.877223718Z" + version: 0.0.31 +digest: sha256:1202e66ad746d6ff1d629ce2e67940cd3b5ca2fe63c794f4d333a392b154e5e4 +generated: "2024-11-21T12:04:53.234564721Z" diff --git a/charts/victoria-metrics-agent/templates/configmap.yaml b/charts/victoria-metrics-agent/templates/configmap.yaml index ef0cbd521..954f7c69d 100644 --- a/charts/victoria-metrics-agent/templates/configmap.yaml +++ b/charts/victoria-metrics-agent/templates/configmap.yaml @@ -34,6 +34,6 @@ kind: ConfigMap metadata: name: {{ $fullname }}-rw namespace: {{ $ns }} - labels: {{- include "vm.labels" $ctx | nindent 4 }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} data: {{ . | nindent 2 }} {{- end }} diff --git a/charts/victoria-metrics-agent/templates/statefulset.yaml b/charts/victoria-metrics-agent/templates/statefulset.yaml index 0b4e595e3..d2fc120b2 100644 --- a/charts/victoria-metrics-agent/templates/statefulset.yaml +++ b/charts/victoria-metrics-agent/templates/statefulset.yaml @@ -48,7 +48,6 @@ spec: {{- if .Values.securityContext.enabled }} securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.securityContext "helm" .) | nindent 12 }} {{- end }} - {{- $_ := set $ctx "app" .Values }} image: {{ include "vm.image" $ctx }} imagePullPolicy: {{ .Values.image.pullPolicy }} workingDir: {{ .Values.containerWorkingDir }} diff --git a/charts/victoria-metrics-alert/CHANGELOG.md b/charts/victoria-metrics-alert/CHANGELOG.md index ffe08d32a..97ffdecd8 100644 --- a/charts/victoria-metrics-alert/CHANGELOG.md +++ b/charts/victoria-metrics-alert/CHANGELOG.md @@ -1,6 +1,7 @@ ## Next release -- TODO +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.12.6 diff --git a/charts/victoria-metrics-alert/Chart.lock b/charts/victoria-metrics-alert/Chart.lock index 779fbc043..a9fc671d2 100644 --- a/charts/victoria-metrics-alert/Chart.lock +++ b/charts/victoria-metrics-alert/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:c0bb6d5e095b1b195458e15c1f0702779e6359791b9d04f067cfd21de84785ea -generated: "2024-11-21T10:19:20.506643679Z" + version: 0.0.31 +digest: sha256:1202e66ad746d6ff1d629ce2e67940cd3b5ca2fe63c794f4d333a392b154e5e4 +generated: "2024-11-21T12:04:59.972072252Z" diff --git a/charts/victoria-metrics-alert/templates/alertmanager-configmap.yaml b/charts/victoria-metrics-alert/templates/alertmanager-configmap.yaml index 6279540d1..e04187568 100644 --- a/charts/victoria-metrics-alert/templates/alertmanager-configmap.yaml +++ b/charts/victoria-metrics-alert/templates/alertmanager-configmap.yaml @@ -1,4 +1,5 @@ -{{- if and .Values.alertmanager.enabled (empty .Values.alertmanager.configMap) }} +{{- $app := .Values.alertmanager }} +{{- if and $app.enabled (empty $app.configMap) }} {{- $ctx := dict "helm" . "appKey" "alertmanager" }} {{- $fullname := include "vm.plain.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} @@ -9,11 +10,11 @@ metadata: namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} data: - alertmanager.yaml: |{{ toYaml .Values.alertmanager.config | nindent 4 }} - {{- range $key, $value := .Values.alertmanager.templates }} + alertmanager.yaml: |{{ toYaml $app.config | nindent 4 }} + {{- range $key, $value := $app.templates }} {{ $key }}: |{{ $value | nindent 4 }} {{- end }} - {{- with .Values.alertmanager.webconfig }} + {{- with $app.webconfig }} webconfig.yaml: |{{ toYaml . | nindent 4 }} {{- end }} {{- end }} diff --git a/charts/victoria-metrics-alert/templates/alertmanager-pvc.yaml b/charts/victoria-metrics-alert/templates/alertmanager-pvc.yaml index 8c9e6892c..8a5c22bc3 100644 --- a/charts/victoria-metrics-alert/templates/alertmanager-pvc.yaml +++ b/charts/victoria-metrics-alert/templates/alertmanager-pvc.yaml @@ -1,5 +1,6 @@ -{{- if .Values.alertmanager.enabled -}} -{{- if and .Values.alertmanager.persistentVolume.enabled (not .Values.alertmanager.persistentVolume.existingClaim)}} +{{- $app := .Values.alertmanager }} +{{- if $app.enabled -}} +{{- if and $app.persistentVolume.enabled (not $app.persistentVolume.existingClaim)}} {{- $ctx := dict "helm" . "appKey" "alertmanager" }} {{- $fullname := include "vm.plain.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} @@ -9,17 +10,17 @@ metadata: name: {{ $fullname }} namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} - {{- with .Values.alertmanager.persistentVolume.annotations }} + {{- with $app.persistentVolume.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} spec: - {{- with .Values.alertmanager.persistentVolume.accessModes }} + {{- with $app.persistentVolume.accessModes }} accessModes: {{ toYaml . | nindent 4 }} {{- end }} resources: requests: - storage: {{ .Values.alertmanager.persistentVolume.size }} - {{- with .Values.alertmanager.persistentVolume.storageClassName }} + storage: {{ $app.persistentVolume.size }} + {{- with $app.persistentVolume.storageClassName }} storageClassName: {{ . }} {{- end }} {{- end }} diff --git a/charts/victoria-metrics-alert/templates/server-alerts-configmap.yaml b/charts/victoria-metrics-alert/templates/server-alerts-configmap.yaml index 540196513..9b3256072 100644 --- a/charts/victoria-metrics-alert/templates/server-alerts-configmap.yaml +++ b/charts/victoria-metrics-alert/templates/server-alerts-configmap.yaml @@ -1,4 +1,5 @@ -{{- if empty .Values.server.configMap }} +{{- $app := .Values.server }} +{{- if empty $app.configMap }} {{- $ctx := dict "helm" . "appKey" "server" }} {{- $fullname := include "vm.plain.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} @@ -9,5 +10,5 @@ metadata: namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} data: - alert-rules.yaml: |{{ toYaml .Values.server.config.alerts | nindent 4 }} + alert-rules.yaml: |{{ toYaml $app.config.alerts | nindent 4 }} {{- end }} diff --git a/charts/victoria-metrics-alert/templates/server-pdb.yaml b/charts/victoria-metrics-alert/templates/server-pdb.yaml index 477de323b..4a8a0667a 100644 --- a/charts/victoria-metrics-alert/templates/server-pdb.yaml +++ b/charts/victoria-metrics-alert/templates/server-pdb.yaml @@ -1,4 +1,5 @@ -{{- $pdb := .Values.server.podDisruptionBudget }} +{{- $app := .Values.server }} +{{- $pdb := $app.podDisruptionBudget }} {{- if $pdb.enabled }} {{- $ctx := dict "helm" . "appKey" "server" }} {{- $fullname := include "vm.plain.fullname" $ctx }} diff --git a/charts/victoria-metrics-anomaly/CHANGELOG.md b/charts/victoria-metrics-anomaly/CHANGELOG.md index 954eb5ebc..3b3fee857 100644 --- a/charts/victoria-metrics-anomaly/CHANGELOG.md +++ b/charts/victoria-metrics-anomaly/CHANGELOG.md @@ -1,6 +1,7 @@ ## Next release -- TODO +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 1.6.7 diff --git a/charts/victoria-metrics-anomaly/Chart.lock b/charts/victoria-metrics-anomaly/Chart.lock index 4fd431c1c..8f02042e9 100644 --- a/charts/victoria-metrics-anomaly/Chart.lock +++ b/charts/victoria-metrics-anomaly/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:c0bb6d5e095b1b195458e15c1f0702779e6359791b9d04f067cfd21de84785ea -generated: "2024-11-21T10:19:25.773712459Z" + version: 0.0.31 +digest: sha256:1202e66ad746d6ff1d629ce2e67940cd3b5ca2fe63c794f4d333a392b154e5e4 +generated: "2024-11-21T12:05:06.56942538Z" diff --git a/charts/victoria-metrics-anomaly/templates/configmap.yaml b/charts/victoria-metrics-anomaly/templates/configmap.yaml index 4dabfe71d..f8a8adafa 100644 --- a/charts/victoria-metrics-anomaly/templates/configmap.yaml +++ b/charts/victoria-metrics-anomaly/templates/configmap.yaml @@ -1,9 +1,10 @@ -{{- if not .Values.config.reader.tenant_id -}} - {{- $ := unset .Values.config.reader "tenant_id" }} +{{- $app := .Values }} +{{- if not $app.config.reader.tenant_id -}} + {{- $ := unset $app.config.reader "tenant_id" }} {{- end -}} -{{- if not .Values.config.writer.tenant_id -}} - {{- $ := unset .Values.config.writer "tenant_id" }} +{{- if not $app.config.writer.tenant_id -}} + {{- $ := unset $app.config.writer "tenant_id" }} {{- end -}} {{- $ctx := dict "helm" . }} @@ -15,8 +16,8 @@ metadata: name: {{ $fullname }} namespace: {{ include "vm.namespace" $ctx }} labels: {{- include "vm.labels" $ctx | nindent 4 }} - {{- with .Values.configMapAnnotations }} + {{- with $app.configMapAnnotations }} annotations: {{ toYaml . | nindent 10 }} {{- end }} data: - config.yml: |{{ toYaml (.Values.config | default dict) | nindent 4 }} + config.yml: |{{ toYaml ($app.config | default dict) | nindent 4 }} diff --git a/charts/victoria-metrics-anomaly/templates/controller.yaml b/charts/victoria-metrics-anomaly/templates/controller.yaml index 0c0ec1193..90ffd6b6a 100644 --- a/charts/victoria-metrics-anomaly/templates/controller.yaml +++ b/charts/victoria-metrics-anomaly/templates/controller.yaml @@ -21,6 +21,7 @@ kind: {{ ternary "StatefulSet" "Deployment" .Values.persistentVolume.enabled }} metadata: namespace: {{ $ns }} name: {{ $fullname }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} spec: selector: matchLabels: {{ include "vm.selectorLabels" $ctx | nindent 6 }} diff --git a/charts/victoria-metrics-anomaly/templates/pdb.yaml b/charts/victoria-metrics-anomaly/templates/pdb.yaml index 5aafc0768..2f5e94eb6 100644 --- a/charts/victoria-metrics-anomaly/templates/pdb.yaml +++ b/charts/victoria-metrics-anomaly/templates/pdb.yaml @@ -1,4 +1,5 @@ -{{- $pdb := .Values.podDisruptionBudget }} +{{- $app := .Values }} +{{- $pdb := $app.podDisruptionBudget }} {{- if $pdb.enabled }} {{- $ctx := dict "helm" . }} {{- $fullname := include "vm.fullname" $ctx }} diff --git a/charts/victoria-metrics-anomaly/templates/pod-monitor.yaml b/charts/victoria-metrics-anomaly/templates/pod-monitor.yaml index 183fa7c13..0f598b26a 100644 --- a/charts/victoria-metrics-anomaly/templates/pod-monitor.yaml +++ b/charts/victoria-metrics-anomaly/templates/pod-monitor.yaml @@ -1,8 +1,9 @@ -{{- if .Values.podMonitor.enabled }} -{{- if or (not (((.Values.config).monitoring).pull).port) (not (((.Values.config).monitoring).pull).enabled) -}} +{{- $app := .Values }} +{{- if $app.podMonitor.enabled }} +{{- if or (not ((($app.config).monitoring).pull).port) (not ((($app.config).monitoring).pull).enabled) -}} {{- fail "`config.monitoring.pull.port` is required and `config.monitoring.pull.enabled` should be `true`, when PodMonitor is enabled" -}} {{- end -}} -{{- $podMonitor := .Values.podMonitor -}} +{{- $podMonitor := $app.podMonitor -}} {{- $ctx := dict "helm" . }} {{- $fullname := include "vm.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} diff --git a/charts/victoria-metrics-auth/CHANGELOG.md b/charts/victoria-metrics-auth/CHANGELOG.md index cbc3aef8d..8951884ff 100644 --- a/charts/victoria-metrics-auth/CHANGELOG.md +++ b/charts/victoria-metrics-auth/CHANGELOG.md @@ -1,6 +1,8 @@ ## Next release - fixed multiple ingress rendering. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1777) +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.7.7 diff --git a/charts/victoria-metrics-auth/Chart.lock b/charts/victoria-metrics-auth/Chart.lock index 4804d06f9..29a1ecd57 100644 --- a/charts/victoria-metrics-auth/Chart.lock +++ b/charts/victoria-metrics-auth/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:c0bb6d5e095b1b195458e15c1f0702779e6359791b9d04f067cfd21de84785ea -generated: "2024-11-21T10:19:28.427488085Z" + version: 0.0.31 +digest: sha256:1202e66ad746d6ff1d629ce2e67940cd3b5ca2fe63c794f4d333a392b154e5e4 +generated: "2024-11-21T12:05:10.058097048Z" diff --git a/charts/victoria-metrics-cluster/CHANGELOG.md b/charts/victoria-metrics-cluster/CHANGELOG.md index f8153ec98..0b26a2329 100644 --- a/charts/victoria-metrics-cluster/CHANGELOG.md +++ b/charts/victoria-metrics-cluster/CHANGELOG.md @@ -1,6 +1,8 @@ ## Next release -- Removed unsupported selectNodes SRV discovery +- removed unsupported selectNodes SRV discovery +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.14.12 diff --git a/charts/victoria-metrics-cluster/Chart.lock b/charts/victoria-metrics-cluster/Chart.lock index fbb2ee695..e6938459d 100644 --- a/charts/victoria-metrics-cluster/Chart.lock +++ b/charts/victoria-metrics-cluster/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:c0bb6d5e095b1b195458e15c1f0702779e6359791b9d04f067cfd21de84785ea -generated: "2024-11-21T10:19:31.660827129Z" + version: 0.0.31 +digest: sha256:1202e66ad746d6ff1d629ce2e67940cd3b5ca2fe63c794f4d333a392b154e5e4 +generated: "2024-11-21T12:05:13.169502092Z" diff --git a/charts/victoria-metrics-cluster/tests/__snapshot__/hpa_test.yaml.snap b/charts/victoria-metrics-cluster/tests/__snapshot__/hpa_test.yaml.snap index 5ad8e1c9a..7791d5070 100644 --- a/charts/victoria-metrics-cluster/tests/__snapshot__/hpa_test.yaml.snap +++ b/charts/victoria-metrics-cluster/tests/__snapshot__/hpa_test.yaml.snap @@ -8,6 +8,7 @@ hpa should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0 extraLabelName: authExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmauth @@ -29,6 +30,7 @@ hpa should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: insertExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vminsert @@ -50,6 +52,7 @@ hpa should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: selectExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmselect @@ -71,6 +74,7 @@ hpa should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: storageExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmstorage @@ -96,6 +100,7 @@ hpa should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0 extraLabelName: authExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmauth-node @@ -117,6 +122,7 @@ hpa should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: insertExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vminsert-node @@ -138,6 +144,7 @@ hpa should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: selectExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmselect-node @@ -159,6 +166,7 @@ hpa should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: storageExtraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmstorage-node diff --git a/charts/victoria-metrics-cluster/tests/__snapshot__/ingress_test.yaml.snap b/charts/victoria-metrics-cluster/tests/__snapshot__/ingress_test.yaml.snap index db6fc2dd6..ef1f78858 100644 --- a/charts/victoria-metrics-cluster/tests/__snapshot__/ingress_test.yaml.snap +++ b/charts/victoria-metrics-cluster/tests/__snapshot__/ingress_test.yaml.snap @@ -10,6 +10,7 @@ ingress should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0 helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmauth namespace: NAMESPACE @@ -36,6 +37,7 @@ ingress should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vminsert namespace: NAMESPACE @@ -66,6 +68,7 @@ ingress should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmselect namespace: NAMESPACE diff --git a/charts/victoria-metrics-cluster/tests/__snapshot__/service_test.yaml.snap b/charts/victoria-metrics-cluster/tests/__snapshot__/service_test.yaml.snap index f46dc619c..0d8f8d3cf 100644 --- a/charts/victoria-metrics-cluster/tests/__snapshot__/service_test.yaml.snap +++ b/charts/victoria-metrics-cluster/tests/__snapshot__/service_test.yaml.snap @@ -8,6 +8,7 @@ service should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0 helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmauth namespace: NAMESPACE @@ -31,6 +32,7 @@ service should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vminsert namespace: NAMESPACE @@ -54,6 +56,7 @@ service should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmselect namespace: NAMESPACE @@ -77,6 +80,7 @@ service should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmstorage namespace: NAMESPACE @@ -110,6 +114,7 @@ service should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0 extraServiceLabelName: authExtraServiceLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmauth-node @@ -134,6 +139,7 @@ service should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraServiceLabelName: insertExtraServiceLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vminsert-node @@ -158,6 +164,7 @@ service should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraServiceLabelName: selectExtraServiceLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmselect-node @@ -182,6 +189,7 @@ service should match snapshot with fullnameOverride and extraLabels: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraServiceLabelName: storageExtraServiceLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmstorage-node diff --git a/charts/victoria-metrics-cluster/tests/__snapshot__/vmauth_test.yaml.snap b/charts/victoria-metrics-cluster/tests/__snapshot__/vmauth_test.yaml.snap index b7a42fd93..e2b324e2d 100644 --- a/charts/victoria-metrics-cluster/tests/__snapshot__/vmauth_test.yaml.snap +++ b/charts/victoria-metrics-cluster/tests/__snapshot__/vmauth_test.yaml.snap @@ -8,6 +8,7 @@ deployment should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0 helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmauth namespace: NAMESPACE @@ -73,6 +74,7 @@ deployment should match snapshot with fullnameOverride, extraLabels and podLabel app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0 extraLabelName: extraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmauth-node diff --git a/charts/victoria-metrics-cluster/tests/__snapshot__/vminsert_test.yaml.snap b/charts/victoria-metrics-cluster/tests/__snapshot__/vminsert_test.yaml.snap index 790f60092..bf8454aa0 100644 --- a/charts/victoria-metrics-cluster/tests/__snapshot__/vminsert_test.yaml.snap +++ b/charts/victoria-metrics-cluster/tests/__snapshot__/vminsert_test.yaml.snap @@ -8,6 +8,7 @@ deployment should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vminsert namespace: NAMESPACE @@ -67,6 +68,7 @@ deployment should match snapshot with fullnameOverride, extraLabels and podLabel app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: extraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vminsert-node diff --git a/charts/victoria-metrics-cluster/tests/__snapshot__/vmselect_test.yaml.snap b/charts/victoria-metrics-cluster/tests/__snapshot__/vmselect_test.yaml.snap index d5ddde6c3..9d585c1ff 100644 --- a/charts/victoria-metrics-cluster/tests/__snapshot__/vmselect_test.yaml.snap +++ b/charts/victoria-metrics-cluster/tests/__snapshot__/vmselect_test.yaml.snap @@ -8,6 +8,7 @@ deployment should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmselect namespace: NAMESPACE @@ -76,6 +77,7 @@ deployment should match snapshot with fullnameOverride, extraLabels and podLabel app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: extraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmselect-node @@ -146,6 +148,7 @@ statefulset should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmselect namespace: NAMESPACE @@ -218,6 +221,7 @@ statefulset should match snapshot with fullnameOverride, extraLabels and podLabe app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: extraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmselect-node diff --git a/charts/victoria-metrics-cluster/tests/__snapshot__/vmstorage_test.yaml.snap b/charts/victoria-metrics-cluster/tests/__snapshot__/vmstorage_test.yaml.snap index 287fac0c4..b7ecae4b8 100644 --- a/charts/victoria-metrics-cluster/tests/__snapshot__/vmstorage_test.yaml.snap +++ b/charts/victoria-metrics-cluster/tests/__snapshot__/vmstorage_test.yaml.snap @@ -8,6 +8,7 @@ statefulset should match snapshot: app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster helm.sh/chart: victoria-metrics-cluster-0.1.1 name: RELEASE-NAME-victoria-metrics-cluster-vmstorage namespace: NAMESPACE @@ -88,6 +89,7 @@ statefulset should match snapshot with fullnameOverride, extraLabels and podLabe app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: victoria-metrics-cluster + app.kubernetes.io/version: 0.1.0-cluster extraLabelName: extraLabelValue helm.sh/chart: victoria-metrics-cluster-0.1.1 name: vmstorage-node diff --git a/charts/victoria-metrics-distributed/CHANGELOG.md b/charts/victoria-metrics-distributed/CHANGELOG.md index d429b1b8a..396ce1292 100644 --- a/charts/victoria-metrics-distributed/CHANGELOG.md +++ b/charts/victoria-metrics-distributed/CHANGELOG.md @@ -1,6 +1,6 @@ ## Next release -- TODO +- updated common dependency 0.0.28 -> 0.0.31 ## 0.5.0 diff --git a/charts/victoria-metrics-distributed/Chart.lock b/charts/victoria-metrics-distributed/Chart.lock index ad0769aa8..4aaf1cdda 100644 --- a/charts/victoria-metrics-distributed/Chart.lock +++ b/charts/victoria-metrics-distributed/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 + version: 0.0.31 - name: victoria-metrics-k8s-stack repository: https://victoriametrics.github.io/helm-charts version: 0.28.4 -digest: sha256:681225b86ea89e8a32399e83dfd439fce7f5c7f7f6f75a5ce3c111400d3a5128 -generated: "2024-11-21T10:19:34.265402463Z" +digest: sha256:5dc41d316170fadd32069a9c5c2dc040e1153df795862a55c0daf91e7c13f11c +generated: "2024-11-21T12:05:16.348444676Z" diff --git a/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml b/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml index 7a7c64ed9..342d6ced0 100644 --- a/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml +++ b/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml @@ -1,25 +1,27 @@ {{- $ctx := dict "helm" . }} {{- $isMultitenant := .Values.enableMultitenancy }} {{- $tenant := ternary "multitenant" "0" $isMultitenant }} -{{- range $i, $z := .Values.availabilityZones }} -{{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $z }} -{{- if $zone.vmagent.enabled }} -{{- if (($zone.vmagent).spec).remoteWrite }} - {{- fail "Error: distributed vmagent doesn't support customized remoteWrite address" }} -{{- end }} +{{- range $i, $az := .Values.availabilityZones }} + {{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $az }} + {{- if $zone.vmagent.enabled }} + {{- if (($zone.vmagent).spec).remoteWrite }} + {{- fail "Error: distributed vmagent doesn't support customized remoteWrite address" }} + {{- end }} + {{- $vmagent := deepCopy $zone.vmagent }} + {{- $_ := set $vmagent "spec" (mergeOverwrite (deepCopy $.Values.common.vmagent.spec) (deepCopy ($zone.common).spec) (deepCopy ($vmagent.spec))) }} + {{- $_ := set $zone "vmagent" $vmagent }} + {{- $_ := set $ctx "appKey" (list "zone" "vmagent" "spec") }} + {{- $_ := set $ctx "zone" $zone }} --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAgent metadata: - {{- $_ := set $ctx "appKey" (list "zone" "vmagent") }} - {{- $_ := set $ctx "zone" $zone }} - labels: {{ include "vm.labels" $ | nindent 4 }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} {{- with $zone.vmagent.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} name: {{ include "vm.cr.fullname" $ctx }} namespace: {{ include "vm.namespace" $ }} -{{- $spec := mergeOverwrite (deepCopy $.Values.common.vmagent.spec) (deepCopy ($zone.common).spec) (deepCopy ($zone.vmagent).spec) }} {{- $remoteWrites := default list }} {{- range $rwz := $.Values.availabilityZones }} {{- $rwZone := mergeOverwrite (deepCopy $.Values.zoneTpl) $rwz }} @@ -35,10 +37,10 @@ metadata: {{- $_ := unset $ctx "style" }} {{- end }} {{- end }} -{{- $_ := set $spec "remoteWrite" (concat $remoteWrites ($spec.remoteWrites | default list)) }} +{{- $_ := set $zone.vmagent.spec "remoteWrite" (concat $remoteWrites ($zone.vmagent.spec.remoteWrites | default list)) }} {{- if $isMultitenant }} - {{- $_ := set $spec "remoteWriteSettings" (dict "useMultitenantMode" true) }} + {{- $_ := set $zone.vmagent.spec "remoteWriteSettings" (dict "useMultitenantMode" true) }} {{- end }} -spec: {{ tpl (toYaml $spec) $ctx | nindent 2 }} +spec: {{ tpl (toYaml $zone.vmagent.spec) $ctx | nindent 2 }} {{- end }} {{- end }} diff --git a/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-balancer.yaml b/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-balancer.yaml index 5483f5635..8451ae31d 100644 --- a/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-balancer.yaml +++ b/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-balancer.yaml @@ -1,31 +1,33 @@ -{{- $ns := include "vm.namespace" . }} {{- $ctx := dict "helm" . }} {{- range $i, $z := .Values.availabilityZones }} -{{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $z }} -{{- if $zone.read.perZone.vmauth.enabled }} + {{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $z }} + {{- if ((($zone.read).perZone).vmauth).enabled }} + {{- $authSpec := ((($zone.read).perZone).vmauth).spec | default dict }} + {{- $commonSpec := ($zone.common).spec | default dict }} + {{- $commonAuthSpec := ((($.Values).common).vmauth).spec | default dict }} + {{- $commonClusterSpec := ((($.Values).common).vmcluster).spec | default dict }} + {{- $authSpec = mergeOverwrite (deepCopy $commonAuthSpec) (deepCopy ($zone.common).spec) (deepCopy $authSpec) }} + {{- $_ := set $ctx "appKey" (list "zone" "read" "perZone" "vmauth" "spec") }} + {{- $_ := set $zone.read.perZone.vmauth "spec" $authSpec }} + {{- $_ := set $ctx "zone" $zone }} --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAuth metadata: - {{- $_ := set $ctx "appKey" (list "zone" "read" "perZone" "vmauth" "spec") }} - {{- $_ := set $ctx "zone" $zone }} name: {{ include "vm.cr.fullname" $ctx }} - namespace: {{ $ns }} - labels: {{ include "vm.labels" $ | nindent 4 }} + namespace: {{ include "vm.namespace" $ctx }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} {{- with $zone.read.perZone.vmauth.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} -{{- $spec := mergeOverwrite (deepCopy $.Values.common.vmauth.spec) (deepCopy (($zone.common).spec)) (deepCopy (((($zone.read).perZone).vmauth).spec)) }} -spec: {{ tpl (toYaml (omit $spec "unauthorizedAccessConfig")) $ctx | nindent 2 }} +spec: {{ tpl (toYaml (omit $zone.read.perZone.vmauth.spec "unauthorizedAccessConfig")) $ctx | nindent 2 }} + {{- $clusterSpec := ($zone.vmcluster).spec | default dict }} + {{- $_ := set $ctx "appKey" (list "zone" "vmcluster" "spec" "vmselect") }} + {{- $_ := set $zone.vmcluster "spec" (mergeOverwrite (deepCopy $commonClusterSpec) (deepCopy $commonSpec) (deepCopy $clusterSpec)) }} + {{- $_ := set $ctx "style" "managed" }} unauthorizedAccessConfig: - src_paths: - "/select/.+" - {{- $_ := set $ctx "appKey" (list "zone" "vmcluster" "spec" "vmselect") }} - {{- if $zone.vmcluster }} - {{- $urlSpec := $zone.vmcluster.spec | default dict }} - {{- $_ := set $zone.vmcluster "spec" (mergeOverwrite (deepCopy $.Values.common.vmcluster.spec) $urlSpec) }} - {{- end }} - {{- $_ := set $ctx "style" "managed" }} url_prefix: - {{ include "vm.url" $ctx }} {{- $_ := unset $ctx "style" }} diff --git a/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-proxy.yaml b/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-proxy.yaml index eae9bfdd3..6fe0025c5 100644 --- a/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-proxy.yaml +++ b/charts/victoria-metrics-distributed/templates/per-az/vmauth-read-proxy.yaml @@ -15,7 +15,7 @@ metadata: {{- $_ := set $ctx "zone" $zone }} name: {{ include "vm.cr.fullname" $ctx }} namespace: {{ $ns }} - labels: {{ include "vm.labels" $ | nindent 4 }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} {{- with $zone.read.crossZone.vmauth.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} diff --git a/charts/victoria-metrics-distributed/templates/per-az/vmauth-write-balancer.yaml b/charts/victoria-metrics-distributed/templates/per-az/vmauth-write-balancer.yaml index 67b028a31..437a108b7 100644 --- a/charts/victoria-metrics-distributed/templates/per-az/vmauth-write-balancer.yaml +++ b/charts/victoria-metrics-distributed/templates/per-az/vmauth-write-balancer.yaml @@ -1,27 +1,28 @@ {{- $ctx := dict "helm" . }} {{- range $i, $z := .Values.availabilityZones }} -{{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $z }} -{{- if $zone.write.vmauth.enabled }} + {{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $z }} + {{- if (($zone.write).vmauth).enabled }} + {{- $commonAuthSpec := ((($.Values).common).vmauth).spec | default dict }} + {{- $commonClusterSpec := ((($.Values).common).vmcluster).spec | default dict }} + {{- $commonSpec := ($zone.common).spec | default dict }} + {{- $spec := $zone.write.vmauth.spec | default dict }} + {{- $_ := set $ctx "appKey" (list "zone" "write" "vmauth" "spec") }} + {{- $_ := set $zone.write.vmauth "spec" (mergeOverwrite (deepCopy $commonAuthSpec) (deepCopy $commonSpec) (deepCopy $spec)) }} + {{- $_ := set $ctx "zone" $zone }} --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAuth metadata: - {{- $_ := set $ctx "appKey" (list "zone" "write" "vmauth" "spec") }} - {{- $_ := set $ctx "zone" $zone }} name: {{ include "vm.cr.fullname" $ctx }} namespace: {{ include "vm.namespace" $ }} - labels: {{ include "vm.labels" $ | nindent 4 }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} {{- with $zone.write.vmauth.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} -{{- $spec := $zone.spec | default dict }} -{{- $spec = mergeOverwrite (deepCopy $.Values.common.vmauth.spec) (deepCopy $spec) (deepCopy (($zone.common).spec)) (deepCopy $zone.write.vmauth.spec) }} -spec: {{ tpl (toYaml (omit $spec "unauthorizedAccessConfig")) $ctx | nindent 2 }} +spec: {{ tpl (toYaml (omit $zone.write.vmauth.spec "unauthorizedAccessConfig")) $ctx | nindent 2 }} {{- $_ := set $ctx "style" "managed" }} - {{- if ($zone.vmcluster).spec }} - {{- $urlSpec := $zone.vmcluster.spec | default dict }} - {{- $_ := set $zone.vmcluster "spec" (mergeOverwrite (deepCopy $.Values.common.vmcluster.spec) $urlSpec) }} - {{- end }} + {{- $clusterSpec := ($zone.vmcluster).spec | default dict }} + {{- $_ := set $zone.vmcluster "spec" (mergeOverwrite (deepCopy $commonClusterSpec) (deepCopy $commonSpec) (deepCopy $clusterSpec)) }} {{- $_ := set $ctx "appKey" (list "zone" "vmcluster" "spec" "vminsert") }} unauthorizedAccessConfig: - src_paths: diff --git a/charts/victoria-metrics-distributed/templates/per-az/vmcluster.yaml b/charts/victoria-metrics-distributed/templates/per-az/vmcluster.yaml index fe93846da..1dfeca766 100644 --- a/charts/victoria-metrics-distributed/templates/per-az/vmcluster.yaml +++ b/charts/victoria-metrics-distributed/templates/per-az/vmcluster.yaml @@ -9,6 +9,8 @@ metadata: {{- end }} name: {{ $name }} namespace: {{ include "vm.namespace" $ }} + {{- $_ := set $ "zone" $rolloutZone }} + {{- $_ := set $ "appKey" "zone" }} labels: {{ include "vm.labels" $ | nindent 4 }} spec: {{ toYaml (deepCopy $rolloutZone) | nindent 2 }} {{- end }} diff --git a/charts/victoria-metrics-distributed/templates/vmauth-read.yaml b/charts/victoria-metrics-distributed/templates/vmauth-read.yaml index 713b597d6..11facae67 100644 --- a/charts/victoria-metrics-distributed/templates/vmauth-read.yaml +++ b/charts/victoria-metrics-distributed/templates/vmauth-read.yaml @@ -1,21 +1,24 @@ -{{- if .Values.read.global.vmauth.enabled }} +{{- $ctx := dict "helm" . }} {{- $fullname := include "vm.fullname" . }} -{{- $ctx := dict "helm" . "appKey" (list "read" "global" "vmauth") "fullname" $fullname }} -{{- $ns := include "vm.namespace" $ctx }} +{{- if ((((.Values).read).global).vmauth).enabled }} + {{- $commonAuth := dict "spec" ((((.Values).common).vmauth).spec | default dict) }} + {{- $auth := .Values.read.global.vmauth | default dict }} + {{- $auth = mergeOverwrite (deepCopy $commonAuth) (deepCopy $auth) }} + {{- $_ := set $ctx "appKey" (list "vmauth" "spec") }} + {{- $_ := set $ctx "fullname" $fullname }} + {{- $_ := set $ctx "vmauth" $auth }} --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAuth metadata: name: {{ include "vm.cr.fullname" $ctx }} - namespace: {{ $ns }} - labels: {{ include "vm.labels" $ | nindent 4 }} + namespace: {{ include "vm.namespace" $ctx }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} {{- with .Values.read.global.vmauth.annotations }} - annotations: - {{- toYaml . | nindent 4 }} + annotations: {{ toYaml . | nindent 4 }} {{- end }} -{{- $spec := mergeOverwrite (deepCopy .Values.common.vmauth.spec) (deepCopy .Values.read.global.vmauth.spec) }} spec: - {{- with (omit $spec "unauthorizedAccessConfig") }} + {{- with (omit $auth.spec "unauthorizedAccessConfig") }} {{- toYaml . | nindent 2 }} {{- end }} unauthorizedAccessConfig: @@ -26,12 +29,10 @@ spec: {{- $urls := default list }} {{- range $i, $z := $.Values.availabilityZones }} {{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $z }} - {{- if (($zone.read).crossZone).vmauth }} - {{- $urlSpec := $zone.read.crossZone.vmauth.spec | default dict }} - {{- $_ := set $zone.read.crossZone.vmauth "spec" (mergeOverwrite (deepCopy $.Values.common.vmauth.spec) $urlSpec) }} - {{- end }} - {{- $_ := set $ctx "appKey" (list "zone" "read" "crossZone" "vmauth" "spec") }} + {{- $authSpec := ((($zone.read).crossZone).vmauth).spec | default dict }} + {{- $_ := set $zone.read.crossZone.vmauth "spec" (mergeOverwrite (deepCopy $commonAuth.spec) $authSpec) }} {{- $_ := set $ctx "zone" $zone }} + {{- $_ := set $ctx "appKey" (list "zone" "read" "crossZone" "vmauth" "spec") }} {{- $urls = append $urls (include "vm.url" $ctx) }} {{- end }} {{- $_ := unset $ctx "style" }} diff --git a/charts/victoria-metrics-distributed/templates/vmauth-write.yaml b/charts/victoria-metrics-distributed/templates/vmauth-write.yaml index 6f3dc4ed6..3c2398e43 100644 --- a/charts/victoria-metrics-distributed/templates/vmauth-write.yaml +++ b/charts/victoria-metrics-distributed/templates/vmauth-write.yaml @@ -1,20 +1,24 @@ -{{- if .Values.write.global.vmauth.enabled }} +{{- $ctx := dict "helm" . }} {{- $fullname := include "vm.fullname" . }} -{{- $ctx := dict "helm" . "appKey" (list "write" "global" "vmauth") "fullname" $fullname }} -{{- $ns := include "vm.namespace" $ctx }} +{{- if ((((.Values).write).global).vmauth).enabled }} + {{- $commonAuth := dict "spec" ((((.Values).common).vmauth).spec | default dict) }} + {{- $auth := .Values.write.global.vmauth | default dict }} + {{- $auth = mergeOverwrite (deepCopy $commonAuth) (deepCopy $auth) }} + {{- $_ := set $ctx "appKey" (list "vmauth" "spec") }} + {{- $_ := set $ctx "fullname" $fullname }} + {{- $_ := set $ctx "vmauth" $auth }} --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAuth metadata: name: {{ include "vm.cr.fullname" $ctx }} - namespace: {{ $ns }} - labels: {{ include "vm.labels" $ | nindent 4 }} - {{- with .Values.write.global.vmauth.annotations }} + namespace: {{ include "vm.namespace" $ctx }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} + {{- with ((((.Values).write).global).vmauth).annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} -{{- $spec := mergeOverwrite (deepCopy .Values.common.vmauth.spec) (deepCopy .Values.write.global.vmauth.spec) }} spec: - {{- with (omit $spec "unauthorizedAccessConfig") }} + {{- with (omit $auth.spec "unauthorizedAccessConfig") }} {{- toYaml . | nindent 2 }} {{- end }} unauthorizedAccessConfig: @@ -26,12 +30,11 @@ spec: - "/api/v1/import/.+" {{- $_ := set $ctx "style" "managed" }} {{- $urls := default list }} + {{- $commonAgentSpec := (((.Values).common).vmagent).spec | default dict }} {{- range $i, $z := $.Values.availabilityZones }} {{- $zone := mergeOverwrite (deepCopy $.Values.zoneTpl) $z }} - {{- if $zone.vmagent }} - {{- $urlSpec := $zone.vmagent.spec | default dict }} - {{- $_ := set $zone.vmagent "spec" (mergeOverwrite (deepCopy $.Values.common.vmagent.spec) $urlSpec) }} - {{- end }} + {{- $agentSpec := $zone.vmagent.spec | default dict }} + {{- $_ := set $zone.vmagent "spec" (mergeOverwrite (deepCopy $commonAgentSpec) $agentSpec) }} {{- $_ := set $ctx "zone" $zone }} {{- $_ := set $ctx "appKey" (list "zone" "vmagent" "spec") }} {{- $urls = append $urls (include "vm.url" $ctx) }} diff --git a/charts/victoria-metrics-distributed/tests/__snapshot__/vmauth_test.yaml.snap b/charts/victoria-metrics-distributed/tests/__snapshot__/vmauth_test.yaml.snap index 3ae376fb0..8307f1f00 100644 --- a/charts/victoria-metrics-distributed/tests/__snapshot__/vmauth_test.yaml.snap +++ b/charts/victoria-metrics-distributed/tests/__snapshot__/vmauth_test.yaml.snap @@ -4,9 +4,11 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-read-balancer-zone-eu-1 app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: v1.0.4 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-read-balancer-zone-eu-1 namespace: NAMESPACE @@ -14,6 +16,8 @@ vmauth should match snapshot: affinity: {} extraArgs: discoverBackendIPs: "true" + image: + tag: v1.0.4 nodeSelector: topology.kubernetes.io/zone: zone-eu-1 port: "8427" @@ -31,9 +35,11 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-read-balancer-zone-us-1 app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: v1.0.4 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-read-balancer-zone-us-1 namespace: NAMESPACE @@ -41,6 +47,8 @@ vmauth should match snapshot: affinity: {} extraArgs: discoverBackendIPs: "true" + image: + tag: v1.0.4 nodeSelector: topology.kubernetes.io/zone: zone-us-1 port: "8427" @@ -58,14 +66,18 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-read-proxy-zone-eu-1 app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: 0.1.0 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-read-proxy-zone-eu-1 namespace: NAMESPACE spec: affinity: {} + image: + tag: v1.0.5 nodeSelector: topology.kubernetes.io/zone: zone-eu-1 port: "8427" @@ -87,14 +99,18 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-read-proxy-zone-us-1 app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: 0.1.0 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-read-proxy-zone-us-1 namespace: NAMESPACE spec: affinity: {} + image: + tag: v1.0.5 nodeSelector: topology.kubernetes.io/zone: zone-us-1 port: "8427" @@ -116,9 +132,11 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-write-balancer-zone-eu-1 app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: v1.0.6 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-write-balancer-zone-eu-1 namespace: NAMESPACE @@ -126,6 +144,8 @@ vmauth should match snapshot: affinity: {} extraArgs: discoverBackendIPs: "true" + image: + tag: v1.0.6 nodeSelector: topology.kubernetes.io/zone: zone-eu-1 port: "8427" @@ -143,9 +163,11 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-write-balancer-zone-us-1 app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: v1.0.6 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-write-balancer-zone-us-1 namespace: NAMESPACE @@ -153,6 +175,8 @@ vmauth should match snapshot: affinity: {} extraArgs: discoverBackendIPs: "true" + image: + tag: v1.0.6 nodeSelector: topology.kubernetes.io/zone: zone-us-1 port: "8427" @@ -170,13 +194,17 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-global-read-RELEASE-NAME-vm-distributed app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: v1.0.3 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-global-read-RELEASE-NAME-vm-distributed namespace: NAMESPACE spec: + image: + tag: v1.0.3 port: "8427" unauthorizedAccessConfig: - load_balancing_policy: first_available @@ -190,13 +218,17 @@ vmauth should match snapshot: kind: VMAuth metadata: labels: + app: vmauth-global-write-RELEASE-NAME-vm-distributed app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: vm-distributed + app.kubernetes.io/version: v1.0.2 helm.sh/chart: victoria-metrics-distributed-0.1.1 name: vmauth-global-write-RELEASE-NAME-vm-distributed namespace: NAMESPACE spec: + image: + tag: v1.0.2 port: "8427" unauthorizedAccessConfig: - src_paths: diff --git a/charts/victoria-metrics-distributed/tests/vmauth_test.yaml b/charts/victoria-metrics-distributed/tests/vmauth_test.yaml index 9b48f07c6..7e55b608c 100644 --- a/charts/victoria-metrics-distributed/tests/vmauth_test.yaml +++ b/charts/victoria-metrics-distributed/tests/vmauth_test.yaml @@ -8,7 +8,43 @@ templates: tests: - it: vmauth should match snapshot set: - vmauth: - enabled: true + write: + global: + vmauth: + spec: + image: + tag: v1.0.2 + read: + global: + vmauth: + spec: + image: + tag: v1.0.3 + zoneTpl: + read: + perZone: + vmauth: + spec: + image: + tag: v1.0.4 + crossZone: + vmauth: + spec: + image: + tag: v1.0.5 + write: + vmauth: + spec: + image: + tag: v1.0.6 + cluster: + spec: + image: + tag: v1.0.7 + vmagent: + spec: + image: + tag: v1.0.8 + asserts: - matchSnapshot: {} diff --git a/charts/victoria-metrics-gateway/CHANGELOG.md b/charts/victoria-metrics-gateway/CHANGELOG.md index df90f9de4..23f3fffac 100644 --- a/charts/victoria-metrics-gateway/CHANGELOG.md +++ b/charts/victoria-metrics-gateway/CHANGELOG.md @@ -1,6 +1,7 @@ ## Next release -- TODO +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.5.7 diff --git a/charts/victoria-metrics-gateway/Chart.lock b/charts/victoria-metrics-gateway/Chart.lock index 3df43c3a1..dddf8adc6 100644 --- a/charts/victoria-metrics-gateway/Chart.lock +++ b/charts/victoria-metrics-gateway/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:c0bb6d5e095b1b195458e15c1f0702779e6359791b9d04f067cfd21de84785ea -generated: "2024-11-21T10:19:37.957264215Z" + version: 0.0.31 +digest: sha256:1202e66ad746d6ff1d629ce2e67940cd3b5ca2fe63c794f4d333a392b154e5e4 +generated: "2024-11-21T12:05:19.975508595Z" diff --git a/charts/victoria-metrics-gateway/templates/deployment.yaml b/charts/victoria-metrics-gateway/templates/deployment.yaml index 69d66f15e..a23b2dc32 100644 --- a/charts/victoria-metrics-gateway/templates/deployment.yaml +++ b/charts/victoria-metrics-gateway/templates/deployment.yaml @@ -67,7 +67,6 @@ spec: {{- if .Values.securityContext.enabled }} securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.securityContext "helm" .) | nindent 12 }} {{- end }} - {{- $_ := set $ctx "app" .Values }} image: {{ include "vm.image" $ctx }} workingDir: {{ .Values.containerWorkingDir }} args: {{ include "vmgateway.args" $ctx | nindent 12 }} diff --git a/charts/victoria-metrics-k8s-stack/CHANGELOG.md b/charts/victoria-metrics-k8s-stack/CHANGELOG.md index 7196273ac..8a413997a 100644 --- a/charts/victoria-metrics-k8s-stack/CHANGELOG.md +++ b/charts/victoria-metrics-k8s-stack/CHANGELOG.md @@ -1,6 +1,8 @@ ## Next release -- Fixed ability to override CR names using `.name`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1778) +- fixed ability to override CR names using `.name`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1778) +- updated common dependency 0.0.28 -> 0.0.29 +- bump operator chart version to 0.38.0 ## 0.28.4 diff --git a/charts/victoria-metrics-k8s-stack/Chart.lock b/charts/victoria-metrics-k8s-stack/Chart.lock index b73d30d8d..bc749e79a 100644 --- a/charts/victoria-metrics-k8s-stack/Chart.lock +++ b/charts/victoria-metrics-k8s-stack/Chart.lock @@ -1,10 +1,10 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 + version: 0.0.31 - name: victoria-metrics-operator repository: https://victoriametrics.github.io/helm-charts - version: 0.37.0 + version: 0.38.0 - name: kube-state-metrics repository: https://prometheus-community.github.io/helm-charts version: 5.26.0 @@ -17,5 +17,5 @@ dependencies: - name: prometheus-operator-crds repository: https://prometheus-community.github.io/helm-charts version: 15.0.0 -digest: sha256:365a8ca24c71cf1657afc762a89ccfacb22c2568e3cf202645f7ea8e2ebd281b -generated: "2024-11-21T10:19:41.692298175Z" +digest: sha256:afcb2c0c44032e678dae159b1325f7daf1b81a17d49a27d0a5c86652f9b052ca +generated: "2024-11-21T12:05:23.547530305Z" diff --git a/charts/victoria-metrics-k8s-stack/Chart.yaml b/charts/victoria-metrics-k8s-stack/Chart.yaml index 8e6a41f7a..a1e9692b2 100644 --- a/charts/victoria-metrics-k8s-stack/Chart.yaml +++ b/charts/victoria-metrics-k8s-stack/Chart.yaml @@ -36,7 +36,7 @@ dependencies: version: "0.0.*" repository: https://victoriametrics.github.io/helm-charts - name: victoria-metrics-operator - version: "0.37.*" + version: "0.38.*" repository: https://victoriametrics.github.io/helm-charts condition: victoria-metrics-operator.enabled - name: kube-state-metrics diff --git a/charts/victoria-metrics-k8s-stack/templates/_helpers.tpl b/charts/victoria-metrics-k8s-stack/templates/_helpers.tpl index 82986a717..8dcb7edcc 100644 --- a/charts/victoria-metrics-k8s-stack/templates/_helpers.tpl +++ b/charts/victoria-metrics-k8s-stack/templates/_helpers.tpl @@ -61,7 +61,7 @@ {{- $_ := set $remotes "remoteRead" $remoteRead -}} {{- $_ := set $remotes "datasource" $remoteRead -}} {{- if $Values.vmalert.additionalNotifierConfigs }} - {{- $configName := printf "%s-vmalert-additional-notifier" $fullname -}} + {{- $configName := printf "%s-additional-notifier" $fullname -}} {{- $notifierConfigRef := dict "name" $configName "key" "notifier-configs.yaml" -}} {{- $_ := set $remotes "notifierConfigRef" $notifierConfigRef -}} {{- else if $Values.alertmanager.enabled -}} @@ -85,8 +85,8 @@ {{- $Values := (.helm).Values | default .Values -}} {{- $cms := ($Values.vmalert.spec.configMaps | default list) -}} {{- if $Values.vmalert.templateFiles -}} - {{- $fullname := include "vm.fullname" . -}} - {{- $cms = append $cms (printf "%s-vmalert-extra-tpl" $fullname) -}} + {{- $fullname := include "vm.managed.fullname" . -}} + {{- $cms = append $cms (printf "%s-extra-tpl" $fullname) -}} {{- end -}} {{- $output := dict "configMaps" (compact $cms) -}} {{- toYaml $output -}} @@ -114,7 +114,7 @@ {{- $Values := (.helm).Values | default .Values }} {{- $Chart := (.helm).Chart | default .Chart }} {{- $extraArgs := dict "remoteWrite.disablePathAppend" "true" -}} - {{- $fullname := include "vm.plain.fullname" . }} + {{- $fullname := include "vm.managed.fullname" . }} {{- if $Values.vmalert.templateFiles -}} {{- $ruleTmpl := printf "/etc/vm/configs/%s-extra-tpl/*.tmpl" $fullname -}} {{- $_ := set $extraArgs "rule.templates" $ruleTmpl -}} @@ -230,7 +230,7 @@ {{- /* Alermanager spec */ -}} {{- define "vm.alertmanager.spec" -}} {{- $Values := (.helm).Values | default .Values }} - {{- $fullname := include "vm.plain.fullname" . -}} + {{- $fullname := include "vm.managed.fullname" . -}} {{- $spec := $Values.alertmanager.spec -}} {{- if and (not $Values.alertmanager.spec.configRawYaml) (not $Values.alertmanager.spec.configSecret) -}} {{- $_ := set $spec "configSecret" $fullname -}} diff --git a/charts/victoria-metrics-k8s-stack/templates/rules/additionalVictoriaMetricsRules.yml b/charts/victoria-metrics-k8s-stack/templates/rules/additionalVictoriaMetricsRules.yml index 51440ef83..89a4a3631 100644 --- a/charts/victoria-metrics-k8s-stack/templates/rules/additionalVictoriaMetricsRules.yml +++ b/charts/victoria-metrics-k8s-stack/templates/rules/additionalVictoriaMetricsRules.yml @@ -1,6 +1,7 @@ -{{- $app := (include "vm.name" .) }} +{{- $prefix := (include "vm.name" .) }} {{- if .Values.additionalVictoriaMetricsMap }} -{{- $ctx := dict "helm" . }} +{{- $app := .Values.vmalert }} +{{- $ctx := dict "helm" . "appKey" (list "vmalert" "spec") }} {{- $ns := include "vm.namespace" $ctx }} apiVersion: v1 kind: List @@ -12,11 +13,11 @@ items: - apiVersion: operator.victoriametrics.com/v1beta1 kind: VMRule metadata: - {{- $name := (printf "%s-%s" $app $VMRuleName) }} + {{- $name := (printf "%s-%s" $prefix $VMRuleName) }} name: {{ $name }} namespace: {{ include "vm.namespace" $ }} {{- $extraLabels := (deepCopy ($VMRule.additionalLabels | default dict)) -}} - {{- $_ := set $extraLabels "app" $app }} + {{- $_ := set $extraLabels "app" $prefix }} {{- $_ := set $ctx "extraLabels" $extraLabels }} labels: {{ include "vm.labels" $ctx | nindent 8 }} {{- $_ := unset $ctx "extraLabels" }} diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/custom-templates.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/custom-templates.yaml index b03bdbcb7..9d6ea619c 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/custom-templates.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/custom-templates.yaml @@ -1,7 +1,7 @@ {{- $app := .Values.alertmanager }} {{- if and $app.enabled $app.templateFiles }} -{{- $ctx := dict "helm" . "appKey" "alertmanager" "style" "managed" }} -{{- $fullname := include "vm.plain.fullname" $ctx }} +{{- $ctx := dict "helm" . "appKey" (list "alertmanager" "spec") "style" "managed" }} +{{- $fullname := include "vm.managed.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} kind: ConfigMap apiVersion: v1 diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/monzo-template.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/monzo-template.yaml index 7550f74fc..5f6d0be74 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/monzo-template.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/monzo-template.yaml @@ -1,6 +1,7 @@ -{{- if and .Values.alertmanager.enabled .Values.alertmanager.monzoTemplate.enabled }} -{{- $ctx := dict "helm" . "appKey" "alertmanager" "style" "managed" }} -{{- $fullname := include "vm.plain.fullname" $ctx }} +{{- $app := .Values.alertmanager }} +{{- if and $app.enabled $app.monzoTemplate.enabled }} +{{- $ctx := dict "helm" . "appKey" (list "alertmanager" "spec") "style" "managed" }} +{{- $fullname := include "vm.managed.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} --- kind: ConfigMap diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/vmalertmanager.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/vmalertmanager.yaml index 6e31b827f..8db8dcb78 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/vmalertmanager.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/alertmanager/vmalertmanager.yaml @@ -1,6 +1,6 @@ {{- $app := .Values.alertmanager }} {{- if $app.enabled }} - {{- $ctx := dict "helm" . "appKey" "alertmanager" "style" "managed" }} + {{- $ctx := dict "helm" . "appKey" (list "alertmanager" "spec") "style" "managed" }} {{- $fullname := include "vm.cr.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} {{- if and $app.spec.configRawYaml $app.config }} diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmagent/vmagent.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmagent/vmagent.yaml index f0fc5ea90..98bd7cf52 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmagent/vmagent.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmagent/vmagent.yaml @@ -1,6 +1,6 @@ {{- $app := .Values.vmagent }} {{- if $app.enabled }} -{{- $ctx := dict "helm" . "appKey" "vmagent" }} +{{- $ctx := dict "helm" . "appKey" (list "vmagent" "spec") }} {{- $fullname := include "vm.cr.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} --- diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/custom-templates.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/custom-templates.yaml index 193c7625a..525bc0105 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/custom-templates.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/custom-templates.yaml @@ -1,6 +1,7 @@ -{{- if and .Values.vmalert.enabled .Values.vmalert.templateFiles }} -{{- $ctx := dict "helm" . "appKey" "vmalert" }} -{{- $fullname := include "vm.plain.fullname" $ctx }} +{{- $app := .Values.vmalert }} +{{- if and $app.enabled $app.templateFiles }} +{{- $ctx := dict "helm" . "appKey" (list "vmalert" "spec") }} +{{- $fullname := include "vm.managed.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} kind: ConfigMap apiVersion: v1 @@ -9,7 +10,7 @@ metadata: namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} data: - {{- range $file, $template := .Values.vmalert.templateFiles }} + {{- range $file, $template := $app.templateFiles }} {{ $file }}: |{{ $template | nindent 4 }} {{- end }} {{- end }} diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/notifiers.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/notifiers.yaml index e5b2a94d9..4dfd972e8 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/notifiers.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/notifiers.yaml @@ -1,6 +1,7 @@ -{{- if and .Values.vmalert.enabled .Values.vmalert.additionalNotifierConfigs }} -{{- $ctx := dict "helm" . "appKey" "vmalert" }} -{{- $fullname := include "vm.plain.fullname" $ctx }} +{{- $app := .Values.vmalert }} +{{- if and $app.enabled $app.additionalNotifierConfigs }} +{{- $ctx := dict "helm" . "appKey" (list "vmalert" "spec") }} +{{- $fullname := include "vm.managed.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} apiVersion: v1 kind: Secret @@ -9,7 +10,7 @@ metadata: namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} stringData: - {{- $configs := .Values.vmalert.additionalNotifierConfigs.static_configs | default list -}} + {{- $configs := $app.additionalNotifierConfigs.static_configs | default list -}} {{- if (.Values.alertmanager).enabled }} {{- $replicas := ((.Values.alertmanager).spec).replicaCount | int -}} {{- if gt $replicas 0 }} @@ -25,6 +26,6 @@ stringData: {{- $configs = append $configs (dict "targets" $targets) -}} {{- end }} {{- end }} - {{- $_ := set .Values.vmalert.additionalNotifierConfigs "static_configs" $configs }} - notifier-configs.yaml: |{{ toYaml .Values.vmalert.additionalNotifierConfigs | nindent 4 }} + {{- $_ := set $app.additionalNotifierConfigs "static_configs" $configs }} + notifier-configs.yaml: |{{ toYaml $app.additionalNotifierConfigs | nindent 4 }} {{- end }} diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/vmalert.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/vmalert.yaml index 683acf701..e78efb71e 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/vmalert.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmalert/vmalert.yaml @@ -1,12 +1,13 @@ -{{- if .Values.vmalert.enabled }} -{{- $ctx := dict "helm" . "appKey" "vmalert" }} +{{- $app := .Values.vmalert }} +{{- if $app.enabled }} +{{- $ctx := dict "helm" . "appKey" (list "vmalert" "spec") }} {{- $fullname := include "vm.cr.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAlert metadata: - {{- with .Values.vmalert.annotations }} + {{- with $app.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} name: {{ $fullname }} diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmauth/vmauth.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmauth/vmauth.yaml index 562eb5194..09344fb3b 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmauth/vmauth.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmauth/vmauth.yaml @@ -1,12 +1,13 @@ -{{- if .Values.vmauth.enabled }} -{{- $ctx := dict "helm" . "appKey" "vmauth" }} +{{- $app := .Values.vmauth }} +{{- if $app.enabled }} +{{- $ctx := dict "helm" . "appKey" (list "vmauth" "spec") }} {{- $fullname := include "vm.cr.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} --- apiVersion: operator.victoriametrics.com/v1beta1 kind: VMAuth metadata: - {{- with .Values.vmauth.annotations }} + {{- with $app.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} name: {{ $fullname }} diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmcluster/vmcluster.yaml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmcluster/vmcluster.yaml index 6b6ea7986..6dc9409ae 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmcluster/vmcluster.yaml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmcluster/vmcluster.yaml @@ -1,6 +1,6 @@ {{- $app := .Values.vmcluster }} {{- if $app.enabled }} -{{- $ctx := dict "helm" . "appKey" "vmcluster" }} +{{- $ctx := dict "helm" . "appKey" (list "vmcluster" "spec") }} {{- $fullname := include "vm.cr.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} --- diff --git a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmsingle/vmsingle.yml b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmsingle/vmsingle.yml index 34d047b18..fffb38951 100644 --- a/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmsingle/vmsingle.yml +++ b/charts/victoria-metrics-k8s-stack/templates/victoria-metrics-operator/vmsingle/vmsingle.yml @@ -1,11 +1,12 @@ -{{- if .Values.vmsingle.enabled }} -{{- $ctx := dict "helm" . "appKey" "vmsingle" }} +{{- $app := .Values.vmsingle }} +{{- if $app.enabled }} +{{- $ctx := dict "helm" . "appKey" (list "vmsingle" "spec") }} {{- $fullname := include "vm.cr.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} apiVersion: operator.victoriametrics.com/v1beta1 kind: VMSingle metadata: - {{- with .Values.vmsingle.annotations }} + {{- with $app.annotations }} annotations: {{ toYaml . | nindent 4 }} {{- end }} name: {{ $fullname }} diff --git a/charts/victoria-metrics-operator/CHANGELOG.md b/charts/victoria-metrics-operator/CHANGELOG.md index 900656b4d..7de9eaaf5 100644 --- a/charts/victoria-metrics-operator/CHANGELOG.md +++ b/charts/victoria-metrics-operator/CHANGELOG.md @@ -1,6 +1,7 @@ ## Next release -- TODO +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.38.0 diff --git a/charts/victoria-metrics-operator/Chart.lock b/charts/victoria-metrics-operator/Chart.lock index 1dc0289b7..6836aa22d 100644 --- a/charts/victoria-metrics-operator/Chart.lock +++ b/charts/victoria-metrics-operator/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 + version: 0.0.31 - name: crds repository: "" version: 0.0.* -digest: sha256:c672ce7fad64abf813e9636c8189752a056fb25c58ab4f1f4dab8648293541d1 -generated: "2024-11-21T10:19:49.798484054Z" +digest: sha256:bd550d2696d84501e1cd12660fc38972f7995ac808ad71521e3d32e21232020f +generated: "2024-11-21T12:05:31.533573461Z" diff --git a/charts/victoria-metrics-single/CHANGELOG.md b/charts/victoria-metrics-single/CHANGELOG.md index e9e683cd3..a9f837902 100644 --- a/charts/victoria-metrics-single/CHANGELOG.md +++ b/charts/victoria-metrics-single/CHANGELOG.md @@ -1,6 +1,7 @@ ## Next release -- TODO +- updated common dependency 0.0.28 -> 0.0.31 +- fixed app.kubernetes.io/version tag override if custom tag is set. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1766). ## 0.12.7 diff --git a/charts/victoria-metrics-single/Chart.lock b/charts/victoria-metrics-single/Chart.lock index 3c7539d63..1fca9a783 100644 --- a/charts/victoria-metrics-single/Chart.lock +++ b/charts/victoria-metrics-single/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: victoria-metrics-common repository: https://victoriametrics.github.io/helm-charts - version: 0.0.30 -digest: sha256:c0bb6d5e095b1b195458e15c1f0702779e6359791b9d04f067cfd21de84785ea -generated: "2024-11-21T10:19:52.036601472Z" + version: 0.0.31 +digest: sha256:1202e66ad746d6ff1d629ce2e67940cd3b5ca2fe63c794f4d333a392b154e5e4 +generated: "2024-11-21T12:05:34.198841212Z" diff --git a/charts/victoria-metrics-single/templates/relabel-configmap.yaml b/charts/victoria-metrics-single/templates/relabel-configmap.yaml index e5143706a..fd625efbc 100644 --- a/charts/victoria-metrics-single/templates/relabel-configmap.yaml +++ b/charts/victoria-metrics-single/templates/relabel-configmap.yaml @@ -1,4 +1,5 @@ -{{- if and .Values.server.relabel.enabled (empty .Values.server.relabel.configMap) }} +{{- $app := .Values.server }} +{{- if and $app.relabel.enabled (empty $app.relabel.configMap) }} {{- $ctx := dict "helm" . "appKey" "server" }} {{- $fullname := include "vm.plain.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} @@ -9,5 +10,5 @@ metadata: namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} data: - relabel.yml: |{{ toYaml .Values.server.relabel.config | nindent 4 }} + relabel.yml: |{{ toYaml $app.relabel.config | nindent 4 }} {{- end }} diff --git a/charts/victoria-metrics-single/templates/scrape-configmap.yaml b/charts/victoria-metrics-single/templates/scrape-configmap.yaml index ef7d74637..68d4d5753 100644 --- a/charts/victoria-metrics-single/templates/scrape-configmap.yaml +++ b/charts/victoria-metrics-single/templates/scrape-configmap.yaml @@ -1,4 +1,5 @@ -{{- if and .Values.server.scrape.enabled (empty .Values.server.scrape.configMap) }} +{{- $app := .Values.server }} +{{- if and $app.scrape.enabled (empty $app.scrape.configMap) }} {{- $ctx := dict "helm" . "appKey" "server" }} {{- $fullname := include "vm.plain.fullname" $ctx }} {{- $ns := include "vm.namespace" $ctx }} @@ -9,8 +10,8 @@ metadata: namespace: {{ $ns }} labels: {{ include "vm.labels" $ctx | nindent 4 }} data: - {{- $config := .Values.server.scrape.config }} - {{- with .Values.server.scrape.extraScrapeConfigs }} + {{- $config := $app.scrape.config }} + {{- with $app.scrape.extraScrapeConfigs }} {{- if hasKey $config "scrape_configs" }} {{- $_ := set $config "scrape_configs" (concat $config.scrape_configs .) }} {{- end }} diff --git a/charts/victoria-metrics-single/templates/server-service-monitor.yaml b/charts/victoria-metrics-single/templates/server-service-monitor.yaml index cc7a19faf..8efb29b47 100644 --- a/charts/victoria-metrics-single/templates/server-service-monitor.yaml +++ b/charts/victoria-metrics-single/templates/server-service-monitor.yaml @@ -1,5 +1,6 @@ -{{- if and .Values.server.enabled .Values.server.serviceMonitor.enabled -}} -{{- $serviceMonitor := .Values.server.serviceMonitor -}} +{{- $app := .Values.server }} +{{- if and $app.enabled $app.serviceMonitor.enabled -}} +{{- $serviceMonitor := $app.serviceMonitor -}} {{- $ctx := dict "helm" . "appKey" "server" }} {{- $fullname := include "vm.plain.fullname" $ctx }} apiVersion: monitoring.coreos.com/v1