Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

podSecurityContext and securityContext in values.yaml used interchangeably across helm charts #455

Closed
srihas opened this issue Jan 25, 2023 · 1 comment · Fixed by #592
Closed
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@srihas
Copy link

srihas commented Jan 25, 2023

The standard convention of using podSecurityContext and securityContext from values.yaml in deployment/statefulset spec seems to be as follows:

  securityContext:
    {{- toYaml .Values.podSecurityContext | nindent 8 }}
  containers:
    - name: {{ .Chart.Name }}
      securityContext:
        {{- toYaml .Values.securityContext | nindent 12 }}

While, the same is not followed in many cases - vmalert, vmcluster, alertmanager etc.
for e.g. in file:
https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-alert/templates/alertmanager-deployment.yaml

  {{- with .Values.alertmanager.securityContext }}
  securityContext:
    {{- toYaml .| nindent 8 }}
  {{- end }}
  containers:
    - name: {{ template "vmalert.name" . }}-alertmanager
      securityContext:
        {{- toYaml .Values.alertmanager.podSecurityContext | nindent 12 }}

While in the case the vmagent, it is rightly used:
https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-agent/templates/deployment.yaml

  securityContext:
    {{- toYaml .Values.podSecurityContext | nindent 8 }}
  containers:
    - name: {{ .Chart.Name }}
      securityContext:
        {{- toYaml .Values.securityContext | nindent 12 }}
@Haleygo Haleygo added bug Something isn't working good first issue Good for newcomers labels Jul 19, 2023
@Haleygo
Copy link
Contributor

Haleygo commented Jul 20, 2023

@srihas Thanks for the report!
Feel free to pull a request if you like)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants