Skip to content

Commit

Permalink
fix: override app.kubernetes.io/version label if custom image tag is …
Browse files Browse the repository at this point in the history
…set (#1782)
  • Loading branch information
AndrewChubatiuk authored Nov 22, 2024
1 parent a44ae0d commit 753df49
Show file tree
Hide file tree
Showing 71 changed files with 328 additions and 192 deletions.
3 changes: 2 additions & 1 deletion charts/victoria-logs-single/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-logs-single/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions charts/victoria-logs-single/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/victoria-logs-single/templates/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- /*
Create custom template context
*/}}
{{- $ctx := dict "helm" . -}}
{{- $ctx := dict "helm" . "appKey" "server" -}}

{{- /*
Loop through all dashboard files
Expand Down Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-logs-single/templates/server-service.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/victoria-metrics-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-metrics-agent/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion charts/victoria-metrics-agent/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 0 additions & 1 deletion charts/victoria-metrics-agent/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/victoria-metrics-alert/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-metrics-alert/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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 }}
13 changes: 7 additions & 6 deletions charts/victoria-metrics-alert/templates/alertmanager-pvc.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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 }}
3 changes: 2 additions & 1 deletion charts/victoria-metrics-alert/templates/server-pdb.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/victoria-metrics-anomaly/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-metrics-anomaly/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 7 additions & 6 deletions charts/victoria-metrics-anomaly/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -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" . }}
Expand All @@ -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 }}
1 change: 1 addition & 0 deletions charts/victoria-metrics-anomaly/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/victoria-metrics-anomaly/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $pdb := .Values.podDisruptionBudget }}
{{- $app := .Values }}
{{- $pdb := $app.podDisruptionBudget }}
{{- if $pdb.enabled }}
{{- $ctx := dict "helm" . }}
{{- $fullname := include "vm.fullname" $ctx }}
Expand Down
7 changes: 4 additions & 3 deletions charts/victoria-metrics-anomaly/templates/pod-monitor.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-metrics-auth/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 3 additions & 1 deletion charts/victoria-metrics-cluster/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-metrics-cluster/Chart.lock
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 753df49

Please sign in to comment.