Add probes
This commit is contained in:
parent
8958c9e2e0
commit
b76da1c101
@ -2,7 +2,7 @@ apiVersion: v2
|
||||
name: softplayer-lib-workload
|
||||
description: A library to be reused accross softplayer charts
|
||||
type: library
|
||||
version: 0.1.7
|
||||
version: 0.1.8
|
||||
maintainers:
|
||||
- name: allanger
|
||||
email: allanger@badhouseplants.net
|
||||
|
@ -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) */ -}}
|
||||
|
8
charts/workload/templates/raw/_raw.tpl
Normal file
8
charts/workload/templates/raw/_raw.tpl
Normal file
@ -0,0 +1,8 @@
|
||||
{{- define "lib.raw" -}}
|
||||
{{- if $.Values.raw -}}
|
||||
{{- range $.Values.raw }}
|
||||
---{{- (tpl . $) | nindent 0 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
Loading…
Reference in New Issue
Block a user