diff --git a/pkg/chartutil/create.go b/pkg/chartutil/create.go index f8785b46f..2c9717e80 100644 --- a/pkg/chartutil/create.go +++ b/pkg/chartutil/create.go @@ -76,6 +76,17 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + service: type: ClusterIP port: 80 @@ -199,8 +210,12 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ template ".serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: