Skip to content

Commit

Permalink
From pod labels removed dynamic label helm.sh/chart to avoid restar…
Browse files Browse the repository at this point in the history
…ting every time the chart is updated without changing the pods parameters. **Note that this time it will lead the pods restart** (#695) (#697)
  • Loading branch information
Amper authored Oct 4, 2023
1 parent 892f952 commit 225bce6
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/victoria-metrics-cluster/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Next release

- TODO
- From pod labels removed dynamic label `helm.sh/chart` to avoid restarting every time the chart is updated without changing the pods parameters. **Note that this time it will cause the pods to restart** (#695)

## 0.11.0

Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: v1.93.5
description: Victoria Metrics Cluster version - high-performance, cost-effective and scalable TSDB, long-term remote storage for Prometheus
name: victoria-metrics-cluster
version: 0.11.0
version: 0.11.1
sources:
- https://github.com/VictoriaMetrics/helm-charts
icon: https://avatars.githubusercontent.com/u/43720803?s=200&v=4
Expand Down
19 changes: 19 additions & 0 deletions charts/victoria-metrics-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,20 @@ helm.sh/chart: {{ include "victoria-metrics.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{- define "victoria-metrics.common.podLabels" -}}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{- define "victoria-metrics.vmstorage.labels" -}}
{{ include "victoria-metrics.vmstorage.matchLabels" . }}
{{ include "victoria-metrics.common.metaLabels" . }}
{{- end -}}

{{- define "victoria-metrics.vmstorage.podLabels" -}}
{{ include "victoria-metrics.vmstorage.matchLabels" . }}
{{ include "victoria-metrics.common.podLabels" . }}
{{- end -}}

{{- define "victoria-metrics.vmstorage.matchLabels" -}}
app: {{ .Values.vmstorage.name }}
{{ include "victoria-metrics.common.matchLabels" . }}
Expand All @@ -70,6 +79,11 @@ app: {{ .Values.vmstorage.name }}
{{ include "victoria-metrics.common.metaLabels" . }}
{{- end -}}

{{- define "victoria-metrics.vmselect.podLabels" -}}
{{ include "victoria-metrics.vmselect.matchLabels" . }}
{{ include "victoria-metrics.common.podLabels" . }}
{{- end -}}

{{- define "victoria-metrics.vmselect.matchLabels" -}}
app: {{ .Values.vmselect.name }}
{{ include "victoria-metrics.common.matchLabels" . }}
Expand All @@ -80,6 +94,11 @@ app: {{ .Values.vmselect.name }}
{{ include "victoria-metrics.common.metaLabels" . }}
{{- end -}}

{{- define "victoria-metrics.vminsert.podLabels" -}}
{{ include "victoria-metrics.vminsert.matchLabels" . }}
{{ include "victoria-metrics.common.podLabels" . }}
{{- end -}}

{{- define "victoria-metrics.vminsert.matchLabels" -}}
app: {{ .Values.vminsert.name }}
{{ include "victoria-metrics.common.matchLabels" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vminsert.labels" . | nindent 8 }}
{{- include "victoria-metrics.vminsert.podLabels" . | nindent 8 }}
{{- with .Values.vminsert.extraLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
{{ toYaml .Values.vmselect.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 8 }}
{{- include "victoria-metrics.vmselect.podLabels" . | nindent 8 }}
{{- with .Values.vmselect.extraLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
{{ toYaml .Values.vmselect.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmselect.labels" . | nindent 8 }}
{{- include "victoria-metrics.vmselect.podLabels" . | nindent 8 }}
{{- with .Values.vmselect.extraLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
{{ toYaml .Values.vmstorage.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.vmstorage.labels" . | nindent 8 }}
{{- include "victoria-metrics.vmstorage.podLabels" . | nindent 8 }}
{{- with .Values.vmstorage.extraLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
Expand Down

0 comments on commit 225bce6

Please sign in to comment.