Skip to content

Commit

Permalink
fix: remove initContainer and work with runAsUser and fsGroup (#107)
Browse files Browse the repository at this point in the history
* fix: remove initContainer and work with runAsUser and fsGroup

Signed-off-by: Engin Diri <engin.diri@mail.schwarz>
  • Loading branch information
Engin Diri authored Apr 12, 2022
1 parent e4fd18e commit 56cf06b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
4 changes: 2 additions & 2 deletions charts/node-red/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ icon: https://nodered.org/about/resources/media/node-red-icon-2.png

type: application

version: 0.16.0
version: 0.17.0
appVersion: 2.2.2

keywords:
Expand All @@ -29,7 +29,7 @@ maintainers:
annotations:
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/changes: |
- adding basic-auth support for servicemonitor
- remove initContainer and work with runAsUser and fsGroup
artifacthub.io/images: |
- name: node-red
image: docker.io/nodered/node-red:2.2.2
Expand Down
14 changes: 1 addition & 13 deletions charts/node-red/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,11 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- end }}
{{- if or .Values.persistence.enabled .Values.initContainers }}
{{- if .Values.initContainers }}
initContainers:
{{- with .Values.initContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if .Values.persistence.enabled }}
- name: permission-fix
image: busybox
command: ['sh', '-c']
args: ['chmod -R 777 /data']
volumeMounts:
- name: data
mountPath: /data
{{- if .Values.persistence.subPath}}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
{{- end }}
{{- end }}
containers:
{{- if .Values.extraSidecars }}
Expand Down
7 changes: 5 additions & 2 deletions charts/node-red/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ podAnnotations: {}
deploymentAnnotations: {}

# -- Pod Security Context see [values.yaml](values.yaml)
podSecurityContext: {}
# fsGroup: 2000
podSecurityContext:
# -- node-red group is 1000
fsGroup: 1000
# -- node-red user is 1000
runAsUser: 1000

# -- Security Context see [values.yaml](values.yaml)
securityContext: {}
Expand Down

0 comments on commit 56cf06b

Please sign in to comment.