Skip to content

Commit

Permalink
fix misused securityContext and podSecurityContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleygo committed Jul 21, 2023
1 parent 659a1d6 commit f7ac8c1
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions charts/victoria-logs-single/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
containers:
- name: {{ template "victoria-logs.name" . }}-{{ .Values.server.name }}
securityContext:
{{- toYaml .Values.server.podSecurityContext | nindent 12 }}
{{- toYaml .Values.server.securityContext | nindent 12 }}
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
{{- if .Values.server.containerWorkingDir }}
Expand Down Expand Up @@ -116,9 +116,9 @@ spec:
nodeSelector:
{{ toYaml .Values.server.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.server.securityContext }}
{{- if .Values.server.podSecurityContext }}
securityContext:
{{ toYaml .Values.server.securityContext | indent 8 }}
{{ toYaml .Values.server.podSecurityContext | indent 8 }}
{{- end }}
{{- if .Values.server.tolerations }}
tolerations:
Expand Down
6 changes: 3 additions & 3 deletions charts/victoria-logs-single/templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
containers:
- name: {{ template "victoria-logs.name" . }}-{{ .Values.server.name }}
{{- with .Values.server.podSecurityContext }}
{{- with .Values.server.securityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
Expand Down Expand Up @@ -118,9 +118,9 @@ spec:
nodeSelector:
{{ toYaml .Values.server.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.server.securityContext }}
{{- if .Values.server.podSecurityContext }}
securityContext:
{{ toYaml .Values.server.securityContext | indent 8 }}
{{ toYaml .Values.server.podSecurityContext | indent 8 }}
{{- end }}
{{- if .Values.server.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ spec:
{{- end }}
serviceAccountName: {{ template "vmalert.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- with .Values.alertmanager.securityContext }}
{{- with .Values.alertmanager.podSecurityContext }}
securityContext:
{{- toYaml .| nindent 8 }}
{{- end }}
containers:
- name: {{ template "vmalert.name" . }}-alertmanager
securityContext:
{{- toYaml .Values.alertmanager.podSecurityContext | nindent 12 }}
{{- toYaml .Values.alertmanager.securityContext | nindent 12 }}
image: "{{ .Values.alertmanager.image }}:{{ .Values.alertmanager.tag }}"
args:
- --config.file=/config/alertmanager.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ spec:
{{- end }}
serviceAccountName: {{ template "vmalert.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.server.securityContext | nindent 8 }}
{{- toYaml .Values.server.podSecurityContext | nindent 8 }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
containers:
- name: {{ template "vmalert.name" . }}-{{ .Values.server.name }}
securityContext:
{{- toYaml .Values.server.podSecurityContext | nindent 12 }}
{{- toYaml .Values.server.securityContext | nindent 12 }}
image: "{{ .Values.server.image.repository }}:{{ default .Chart.AppVersion .Values.server.image.tag }}"
args:
- -rule=/config/alert-rules.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
workingDir: {{ .Values.vminsert.containerWorkingDir }}
{{- end }}
securityContext:
{{- toYaml .Values.vminsert.podSecurityContext | nindent 12 }}
{{- toYaml .Values.vminsert.securityContext | nindent 12 }}
args:
{{- if not .Values.vminsert.suppresStorageFQDNsRender }}
{{- include "victoria-metrics.vminsert.vmstorage-pod-fqdn" . | nindent 12 }}
Expand Down Expand Up @@ -141,7 +141,7 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.vminsert.securityContext }}
{{- with .Values.vminsert.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
workingDir: {{ .Values.vmselect.containerWorkingDir }}
{{- end }}
securityContext:
{{- toYaml .Values.vmselect.podSecurityContext | nindent 12 }}
{{- toYaml .Values.vmselect.securityContext | nindent 12 }}
args:
- {{ printf "%s=%s" "--cacheDataPath" .Values.vmselect.cacheMountPath | quote}}
{{- if not .Values.vmselect.suppresStorageFQDNsRender }}
Expand Down Expand Up @@ -118,9 +118,9 @@ spec:
nodeSelector:
{{ toYaml .Values.vmselect.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vmselect.securityContext }}
{{- if .Values.vmselect.podSecurityContext }}
securityContext:
{{ toYaml .Values.vmselect.securityContext | indent 8 }}
{{ toYaml .Values.vmselect.podSecurityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.vmselect.tolerations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
workingDir: {{ .Values.vmselect.containerWorkingDir }}
{{- end }}
securityContext:
{{- toYaml .Values.vmselect.podSecurityContext | nindent 12 }}
{{- toYaml .Values.vmselect.securityContext | nindent 12 }}
args:
- {{ printf "%s=%s" "--cacheDataPath" .Values.vmselect.cacheMountPath | quote}}
{{- if not .Values.vmselect.suppresStorageFQDNsRender }}
Expand Down Expand Up @@ -112,9 +112,9 @@ spec:
nodeSelector:
{{ toYaml .Values.vmselect.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vmselect.securityContext }}
{{- if .Values.vmselect.podSecurityContext }}
securityContext:
{{ toYaml .Values.vmselect.securityContext | indent 8 }}
{{ toYaml .Values.vmselect.podSecurityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.vmselect.tolerations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
workingDir: {{ .Values.vmstorage.containerWorkingDir }}
{{- end }}
securityContext:
{{- toYaml .Values.vmstorage.podSecurityContext | nindent 12 }}
{{- toYaml .Values.vmstorage.securityContext | nindent 12 }}
args:
- {{ printf "%s=%s" "--retentionPeriod" (toString .Values.vmstorage.retentionPeriod) | quote}}
- {{ printf "%s=%s" "--storageDataPath" .Values.vmstorage.persistentVolume.mountPath | quote}}
Expand Down Expand Up @@ -106,7 +106,7 @@ spec:
- name: {{ template "victoria-metrics.name" . }}-vmbackupmanager
image: "{{ .Values.vmstorage.vmbackupmanager.image.repository }}:{{ .Values.vmstorage.vmbackupmanager.image.tag }}"
imagePullPolicy: "{{ .Values.vmstorage.image.pullPolicy }}"
{{- with .Values.vmstorage.podSecurityContext }}
{{- with .Values.vmstorage.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -171,9 +171,9 @@ spec:
nodeSelector:
{{ toYaml .Values.vmstorage.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.vmstorage.securityContext }}
{{- if .Values.vmstorage.podSecurityContext }}
securityContext:
{{ toYaml .Values.vmstorage.securityContext | indent 8 }}
{{ toYaml .Values.vmstorage.podSecurityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.vmstorage.tolerations }}
Expand Down
2 changes: 1 addition & 1 deletion charts/victoria-metrics-single/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Return if ingress supports pathType.
{{- range $key, $value := .Values.server.vmbackupmanager.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- with .Values.server.podSecurityContext }}
{{- with .Values.server.securityContext }}
securityContext: {{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.vmbackupmanager.resources }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.server.name }}
securityContext:
{{- toYaml .Values.server.podSecurityContext | nindent 12 }}
{{- toYaml .Values.server.securityContext | nindent 12 }}
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
{{- if .Values.server.containerWorkingDir }}
Expand Down Expand Up @@ -203,9 +203,9 @@ spec:
nodeSelector:
{{ toYaml .Values.server.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.server.securityContext }}
{{- if .Values.server.podSecurityContext }}
securityContext:
{{ toYaml .Values.server.securityContext | indent 8 }}
{{ toYaml .Values.server.podSecurityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.server.tolerations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.server.name }}
{{- with .Values.server.podSecurityContext }}
{{- with .Values.server.securityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
Expand Down Expand Up @@ -170,7 +170,7 @@ spec:
{{- with .Values.server.vmbackupmanager.resources }}
resources: {{ toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.server.podSecurityContext }}
{{- with .Values.server.securityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.vmbackupmanager.livenessProbe }}
Expand Down Expand Up @@ -204,9 +204,9 @@ spec:
nodeSelector:
{{ toYaml .Values.server.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.server.securityContext }}
{{- if .Values.server.podSecurityContext }}
securityContext:
{{ toYaml .Values.server.securityContext | indent 8 }}
{{ toYaml .Values.server.podSecurityContext | indent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.server.tolerations }}
Expand Down

0 comments on commit f7ac8c1

Please sign in to comment.