From ffc3b906cd06ee6b8053b84252b71a2ef383a7d7 Mon Sep 17 00:00:00 2001 From: Anas El Barkani Date: Mon, 9 Oct 2023 23:33:50 +0200 Subject: [PATCH] distroless --- charts/ingress-nginx/templates/_helpers.tpl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/charts/ingress-nginx/templates/_helpers.tpl b/charts/ingress-nginx/templates/_helpers.tpl index 7db5b2ca8..df2810b07 100644 --- a/charts/ingress-nginx/templates/_helpers.tpl +++ b/charts/ingress-nginx/templates/_helpers.tpl @@ -198,15 +198,20 @@ IngressClass parameters. Extra modules. */}} {{- define "extraModules" -}} - - name: {{ .name }} image: {{ .image }} + {{- if .distroless | default false }} + command: ['/init_module'] + {{- else }} command: ['sh', '-c', '/usr/local/bin/init_module.sh'] - {{- if (.containerSecurityContext) }} + {{- end }} + {{- if .containerSecurityContext }} securityContext: {{ .containerSecurityContext | toYaml | nindent 4 }} {{- end }} + {{- if .resources }} + resources: {{ .resources | toYaml | nindent 4 }} + {{- end }} volumeMounts: - name: {{ toYaml "modules"}} mountPath: {{ toYaml "/modules_mount"}} - -{{- end -}} +{{- end -}} \ No newline at end of file