diff --git a/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml b/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml index a3705bf03..2ff4dc374 100644 --- a/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml +++ b/charts/victoria-metrics-distributed/templates/per-az/vmagent.yaml @@ -1,5 +1,6 @@ {{- $ctx := dict "helm" . }} -{{- $tenant := ternary "multitenant" "0" .Values.enableMultitenancy }} +{{- $isMultitenant := .Values.enableMultitenancy }} +{{- $tenant := ternary "multitenant" "0" $isMultitenant }} {{- range $i, $zone := .Values.availabilityZones }} {{- if $zone.vmagent.enabled }} {{- if (($zone.vmagent).spec).remoteWrite }} @@ -16,7 +17,7 @@ metadata: {{- $_ := set $ctx "appKey" (list "availabilityZones" $i "vmagent") }} name: {{ include "vm.fullname" $ctx }} namespace: {{ include "vm.namespace" $ }} -{{- $spec := mergeOverwrite (deepCopy ($zone.common).spec) (deepCopy ($zone.vmagent).spec) }} +{{- $spec := mergeOverwrite (deepCopy $.Values.common.vmagent.spec) (deepCopy ($zone.common).spec) (deepCopy ($zone.vmagent).spec) }} {{- $remoteWrites := default list }} {{- range $rwZone := $.Values.availabilityZones }} {{- if $rwZone.write.allow }} @@ -30,6 +31,9 @@ metadata: {{- end }} {{- end }} {{- $_ := set $spec "remoteWrite" (concat $remoteWrites ($spec.remoteWrites | default list)) }} +{{- if $isMultitenant }} + {{- $_ := set $spec "remoteWriteSettings" (dict "useMultitenantMode" true) }} +{{- end }} spec: {{ toYaml $spec | nindent 2 }} {{- end }} {{- end }} diff --git a/charts/victoria-metrics-distributed/values.yaml b/charts/victoria-metrics-distributed/values.yaml index 7c6c58461..444d6622d 100644 --- a/charts/victoria-metrics-distributed/values.yaml +++ b/charts/victoria-metrics-distributed/values.yaml @@ -13,9 +13,7 @@ common: vmagent: # -- Common VMAgent spec, which can be overriden by each VMAgent configuration. # Available parameters can be found [here](https://docs.victoriametrics.com/operator/api/index.html#vmagentspec) - spec: - remoteWriteSettings: - useMultiTenantMode: true + spec: {} vmcluster: # -- Common VMCluster spec, which can be overriden by each VMCluster configuration. # Available parameters can be found [here](https://docs.victoriametrics.com/operator/api/index.html#vmclusterspec)