softplayer-helm-lib/charts/testing/templates/workload/_security.tpl

30 lines
803 B
Smarty
Raw Normal View History

2024-05-05 16:51:37 +00:00
{{- define "lib.securityContext" -}}
{{- if not .Values.workload.securityContext -}}
# ---------------------------------------------------------------------
# Using the default security context, if it doesn't work for you,
# please update `.Values.workload.securityContext`
# ---------------------------------------------------------------------
securityContext:
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
{{- else -}}
{{- with .Values.workload.securityContext -}}
securityContext:
{{ toYaml . | indent 2 }}
{{- end }}
{{- end -}}
{{- end -}}
{{- define "lib.containerSecurityContext" -}}
securityContext:
{{- if not .securityContext }}
runAsUser: 2000
allowPrivilegeEscalation: false
{{- else }}
{{- with .securityContext }}
{{ toYaml . | indent 2 }}
{{- end }}
{{- end -}}
{{- end -}}