Add probes
This commit is contained in:
@ -3,15 +3,8 @@
|
||||
{{ fail ".Values.workload.containers can not be empty (heler.deployment.containers)" }}
|
||||
{{- end -}} {{- /* /(1) */ -}}
|
||||
containers:
|
||||
{{- range $k,$v := .Values.workload.containers }} {{- /* (1) */}}
|
||||
- name: {{ $k }}
|
||||
{{- include "helper.workload.containerSecurityContext" . | nindent 4 -}}
|
||||
{{- include "helper.workload.image" (dict "Chart" $.Chart "Image" .image) | indent 4 -}}
|
||||
{{- include "helper.container.command" $v | nindent 4 -}}
|
||||
{{- include "helper.container.args" $v | nindent 4 -}}
|
||||
{{- include "helper.container.ports" (dict "Context" $ "Container" $v) | nindent 4 -}}
|
||||
{{- include "helper.container.volumeMounts" $v | nindent 4 -}}
|
||||
{{- include "helper.container.envFrom" (dict "Context" $ "Container" $v) | nindent 4 -}}
|
||||
{{- range $k, $v := .Values.workload.containers }} {{- /* (1) */}}
|
||||
{{ include "helper.deployment.container" (dict "Context" $ "ContainerName" $k "ContainerData" $v) | indent 2}}
|
||||
{{- end }} {{- /* /(1) */}}
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
||||
@ -19,20 +12,24 @@ containers:
|
||||
{{- if .Values.workload.initContainers -}} {{- /* (1) */ -}}
|
||||
initContainers:
|
||||
{{- range $k,$v := .Values.workload.initContainers }} {{- /* (2) */}}
|
||||
- name: {{ $k }}
|
||||
{{- include "helper.workload.containerSecurityContext" . | nindent 4 -}}
|
||||
{{- include "helper.workload.image" (dict "Chart" $.Chart "Image" .image) | indent 4 -}}
|
||||
{{- include "helper.container.command" $v | nindent 4 -}}
|
||||
{{- include "helper.container.args" $v | nindent 4 -}}
|
||||
{{- include "helper.container.ports" (dict "Context" $ "Container" $v) | nindent 4 -}}
|
||||
{{- include "helper.container.volumeMounts" $v | nindent 4 -}}
|
||||
{{- include "helper.container.envFrom" (dict "Context" $ "Container" $v) | nindent 4 -}}
|
||||
{{ include "helper.deployment.container" (dict "Context" $ "ContainerName" $k "ContainerData" $v) | indent 2}}
|
||||
{{- end }} {{- /* /(1) */}}
|
||||
{{- end -}} {{- /* /(2) */ -}}
|
||||
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
||||
{{- define "helper.deployment.container" -}} {{- /* (define) */ -}}
|
||||
- name: {{ .ContainerName }}
|
||||
{{- include "helper.workload.containerSecurityContext" .ContainerData | nindent 2 -}}
|
||||
{{- include "helper.workload.image" (dict "Chart" .Context.Chart "Image" .ContainerData.image) | indent 2 -}}
|
||||
{{- include "helper.container.command" .ContainerData | nindent 2 -}}
|
||||
{{- include "helper.container.args" .ContainerData | nindent 2 -}}
|
||||
{{- include "helper.container.ports" (dict "Context" .Context "Container" .ContainerData) | nindent 2 -}}
|
||||
{{- include "helper.container.volumeMounts" .ContainerData | nindent 2 -}}
|
||||
{{- include "helper.container.envFrom" (dict "Context" .Context "Container" .ContainerData) | nindent 2 -}}
|
||||
{{- include "helper.container.livenessProbe" .ContainerData | nindent 2 -}}
|
||||
{{- include "helper.container.readinessProbe" .ContainerData | nindent 2 -}}
|
||||
{{- include "helper.container.startupProbe" .ContainerData | nindent 2 -}}
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
||||
{{- define "helper.container.command" -}} {{- /* (define) */ -}}
|
||||
@ -118,3 +115,25 @@ envFrom:
|
||||
{{- end -}} {{- /* /(2) */ -}}
|
||||
{{- end -}} {{- /* /(1) */ -}}
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
||||
{{- /* Probes */ -}}
|
||||
{{- define "helper.container.readinessProbe" -}} {{- /* (define) */ -}}
|
||||
{{- if .readinessProbe }} {{- /* (1) */}}
|
||||
readinessProbe:
|
||||
{{ .readinessProbe | toYaml | indent 2 }}
|
||||
{{- end }} {{- /* /(0) */}}
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
||||
{{- define "helper.container.livenessProbe" -}} {{- /* (define) */ -}}
|
||||
{{- if .livenessProbe }} {{- /* (1) */}}
|
||||
livenessProbe:
|
||||
{{ .livenessProbe | toYaml | indent 2 }}
|
||||
{{- end }} {{- /* /(0) */}}
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
||||
{{- define "helper.container.startupProbe" -}} {{- /* (define) */ -}}
|
||||
{{- if .startupProbe }} {{- /* (1) */}}
|
||||
startupProbe:
|
||||
{{ .startupProbe | toYaml | indent 2 }}
|
||||
{{- end }} {{- /* /(0) */}}
|
||||
{{- end -}} {{- /* /(define) */ -}}
|
||||
|
Reference in New Issue
Block a user