Skip to content

Commit

Permalink
remove serviceAccountName from Deployment and StatefulSet, when it's …
Browse files Browse the repository at this point in the history
…disabled (#1684)
  • Loading branch information
AndrewChubatiuk authored Nov 5, 2024
1 parent 9852491 commit 9559f33
Show file tree
Hide file tree
Showing 21 changed files with 44 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/victoria-metrics-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Fix Deployment/StatefulSets when `serviceAccount.name` is empty and `serviceAccount.create: false`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1683).

## 0.14.5

Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ spec:
{{- $annotations := merge (dict "checksum/config" (include (print .Template.BasePath "/configmap.yaml") . | sha256sum)) (deepCopy .Values.podAnnotations) }}
annotations: {{ toYaml $annotations | nindent 8 }}
spec:
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-agent/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ spec:
{{- $annotations := merge (dict "checksum/config" (include (print .Template.BasePath "/configmap.yaml") . | sha256sum)) (deepCopy .Values.podAnnotations) }}
annotations: {{ toYaml $annotations | nindent 8 }}
spec:
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-alert/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Fix Deployment/StatefulSets when `serviceAccount.name` is empty and `serviceAccount.create: false`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1683).

## 0.12.4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ spec:
{{- $annotations = merge $annotations (deepCopy $app.podMetadata.annotations) }}
annotations: {{ toYaml $annotations | nindent 8 }}
spec:
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $sa }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- end }}
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ spec:
{{- $annotations = merge $annotations $app.podAnnotations }}
annotations: {{ toYaml $annotations | nindent 8 }}
spec:
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $sa }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- end }}
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- with ($app.imagePullSecrets | default .Values.global.imagePullSecrets) }}
imagePullSecrets: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Fix Deployment/StatefulSets when `serviceAccount.name` is empty and `serviceAccount.create: false`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1683).

## 0.7.4

Expand Down
4 changes: 3 additions & 1 deletion charts/victoria-metrics-auth/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ spec:
{{- $annotations := merge (dict "checksum/config" (include (print .Template.BasePath "/secret.yaml") . | sha256sum)) .Values.podAnnotations }}
annotations: {{ toYaml $annotations | nindent 8 }}
spec:
serviceAccountName: {{ .Values.serviceAccount.name | default $fullname }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-cluster/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Fix Deployment/StatefulSets when `serviceAccount.name` is empty and `serviceAccount.create: false`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1683).

## 0.14.7

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 @@ -3,7 +3,7 @@ type: application
appVersion: v1.106.0
description: Victoria Metrics Cluster version - high-performance, cost-effective and scalable TSDB, long-term remote storage for Prometheus
name: victoria-metrics-cluster
version: 0.14.7
version: 0.14.8
sources:
- https://github.com/VictoriaMetrics/helm-charts
icon: https://avatars.githubusercontent.com/u/43720803?s=200&v=4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ spec:
{{- with $app.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- with $app.initContainers }}
initContainers: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -125,7 +124,10 @@ spec:
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $sa }}
{{- end }}
{{- with $app.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ spec:
{{- with $app.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- with $app.initContainers }}
initContainers: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -106,7 +105,10 @@ spec:
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $sa }}
{{- end }}
{{- with $app.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ spec:
{{- with $app.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- with $app.initContainers }}
initContainers: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -103,7 +102,10 @@ spec:
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $sa }}
{{- end }}
{{- with $app.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ spec:
{{- with $app.schedulerName }}
schedulerName: {{ . }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- $manager := $app.vmbackupmanager }}
{{- if or $app.initContainers $manager.restore.onStart.enabled }}
initContainers:
Expand Down Expand Up @@ -218,7 +217,10 @@ spec:
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $sa }}
{{- end }}
{{- with $app.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-gateway/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Fix Deployment/StatefulSets when `serviceAccount.name` is empty and `serviceAccount.create: false`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1683).

## 0.5.4

Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ spec:
{{- $annotations := merge (dict "checksum/config" (include (print .Template.BasePath "/configmap.yaml") . | sha256sum)) .Values.podAnnotations }}
annotations: {{ toYaml $annotations | nindent 8 }}
spec:
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Fix Deployment/StatefulSets when `serviceAccount.name` is empty and `serviceAccount.create: false`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1683).

## 0.37.0

Expand Down
2 changes: 2 additions & 0 deletions charts/victoria-metrics-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ spec:
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" .Values.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
{{- end }}
{{- with (.Values.imagePullSecrets | default .Values.global.imagePullSecrets) }}
imagePullSecrets: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-single/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Fix Deployment/StatefulSets when `serviceAccount.name` is empty and `serviceAccount.create: false`. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1683).

## 0.12.4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ spec:
{{- with $app.schedulerName }}
schedulerName: {{ . }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- $manager := $app.vmbackupmanager }}
{{- if or $app.initContainers $manager.restore.onStart.enabled }}
initContainers:
Expand Down Expand Up @@ -241,7 +240,10 @@ spec:
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.serviceAccount.name | default $fullname }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- end }}
{{- with $app.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ spec:
{{- with $app.schedulerName }}
schedulerName: {{ . }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- $manager := $app.vmbackupmanager }}
{{- if or $app.initContainers $manager.restore.onStart.enabled }}
initContainers:
Expand Down Expand Up @@ -245,7 +244,10 @@ spec:
{{- if $app.podSecurityContext.enabled }}
securityContext: {{ include "vm.securityContext" (dict "securityContext" $app.podSecurityContext "helm" .) | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.serviceAccount.name | default $fullname }}
{{- if or (.Values.serviceAccount).name (.Values.serviceAccount).create }}
serviceAccountName: {{ (.Values.serviceAccount).name | default $fullname }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- end }}
{{- with $app.tolerations }}
tolerations: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down

0 comments on commit 9559f33

Please sign in to comment.