Skip to content

Commit

Permalink
Disabled NATS security context (#16728)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfaizanse committed Feb 3, 2023
1 parent e04e69b commit da8c9bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/eventing/charts/nats/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
{{- if or .Values.priorityClassName .Values.global.priorityClassName }}
priorityClassName: {{ coalesce .Values.priorityClassName .Values.global.priorityClassName }}
{{- end }}
{{- if .Values.global.podSecurityContext }}
{{- if and .Values.global.natsSecurityContextEnabled .Values.global.podSecurityContext }}
securityContext: {{ toYaml .Values.global.podSecurityContext | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
Expand Down Expand Up @@ -97,7 +97,7 @@ spec:
- name: config-reloader
image: "{{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.nats_config_reloader) }}"
imagePullPolicy: {{ .Values.nats.pullPolicy }}
{{- if .Values.global.containerSecurityContext }}
{{- if and .Values.global.natsSecurityContextEnabled .Values.global.containerSecurityContext }}
securityContext: {{- toYaml .Values.global.containerSecurityContext | nindent 10 }}
{{- end }}
command:
Expand Down Expand Up @@ -125,7 +125,7 @@ spec:
- name: metrics
image: "{{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.prometheus_nats_exporter) }}"
imagePullPolicy: {{ .Values.exporter.pullPolicy }}
{{- if .Values.global.containerSecurityContext }}
{{- if and .Values.global.natsSecurityContextEnabled .Values.global.containerSecurityContext }}
securityContext: {{- toYaml .Values.global.containerSecurityContext | nindent 10 }}
{{- end }}
resources:
Expand All @@ -146,7 +146,7 @@ spec:
- name: nats
image: "{{ include "imageurl" (dict "reg" .Values.global.containerRegistry "img" .Values.global.images.nats) }}"
imagePullPolicy: {{ .Values.nats.pullPolicy }}
{{- if .Values.global.containerSecurityContext }}
{{- if and .Values.global.natsSecurityContextEnabled .Values.global.containerSecurityContext }}
securityContext: {{- toYaml .Values.global.containerSecurityContext | nindent 10 }}
{{- end }}
resources:
Expand Down
2 changes: 2 additions & 0 deletions resources/eventing/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ global:
statusPort: 15020
portName: status

natsSecurityContextEnabled: false

podSecurityContext:
fsGroup: 10001
runAsUser: 10001
Expand Down

0 comments on commit da8c9bf

Please sign in to comment.