common-helm-lib/templates/parts/_containers.tpl
Jonas Forsberg 0fe6d615a0
All checks were successful
Package and publish helm chart / package-helm (push) Successful in 14s
.
2024-10-22 14:29:12 +02:00

48 lines
1.3 KiB
Smarty

{{- define "lib.parts.container" -}}
{{/*
create the environment varable list
*/}}
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 4 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.controller.command }}
command: {{ toYaml . | nindent 4}}
{{- end }}
{{- with .Values.controller.args }}
args: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.lifecycle }}
lifecycle:
{{- toYaml . | nindent 4 }}
{{- end }}
ports:
{{- range $name, $values := .Values.service -}}
{{- if $values.enabled -}}
{{- range $k, $v := $values.ports }}
- name: {{ $k }}
containerPort: {{ default $v.port $v.targetPort }}
{{- end -}}
{{- end -}}
{{- end }}
env:
{{- include "lib.parts.env" . | nindent 4 -}}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.resources }}
resources:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}