LivenessProbe support - you can use it, doesn't mean you should
This commit is contained in:
@@ -84,6 +84,16 @@ spec:
|
|||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.livenessProbe.enabled }}
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: {{ .Values.livenessProbe.path }}
|
||||||
|
port: {{ .Values.containerPort }}
|
||||||
|
scheme: HTTP
|
||||||
|
{{- with .Values.livenessProbe.settings }}
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
|
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.resources | nindent 12 }}
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
suite: test deployment
|
||||||
|
templates:
|
||||||
|
- deployment.yaml
|
||||||
|
- configmap.yaml
|
||||||
|
tests:
|
||||||
|
- it: Should set a liveness probe
|
||||||
|
set:
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.containers[0].livenessProbe
|
||||||
|
value:
|
||||||
|
httpGet:
|
||||||
|
path: "/"
|
||||||
|
port: 80
|
||||||
|
scheme: HTTP
|
||||||
|
initialDelaySeconds: 0
|
||||||
|
periodSeconds: 10
|
||||||
|
successThreshold: 1
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 3
|
||||||
|
- it: Should not set a livenessProbe
|
||||||
|
asserts:
|
||||||
|
- isNull:
|
||||||
|
path: spec.template.spec.containers[0].livenessProbe
|
||||||
|
- it: Should tune liveness probe
|
||||||
|
set:
|
||||||
|
livenessProbe:
|
||||||
|
enabled: true
|
||||||
|
settings:
|
||||||
|
periodSeconds: 30
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.template.spec.containers[0].livenessProbe
|
||||||
|
value:
|
||||||
|
httpGet:
|
||||||
|
path: "/"
|
||||||
|
port: 80
|
||||||
|
scheme: HTTP
|
||||||
|
initialDelaySeconds: 0
|
||||||
|
periodSeconds: 30
|
||||||
|
successThreshold: 1
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 3
|
||||||
@@ -40,6 +40,17 @@ probe:
|
|||||||
timeoutSeconds: 3
|
timeoutSeconds: 3
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
|
|
||||||
|
# Before you use a liveness probe: https://srcco.de/posts/kubernetes-liveness-probes-are-dangerous.html
|
||||||
|
livenessProbe:
|
||||||
|
enabled: false
|
||||||
|
path: "/"
|
||||||
|
settings:
|
||||||
|
initialDelaySeconds: 0
|
||||||
|
periodSeconds: 10
|
||||||
|
successThreshold: 1
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 3
|
||||||
|
|
||||||
secretEnabled: false
|
secretEnabled: false
|
||||||
|
|
||||||
shell: "/bin/sh"
|
shell: "/bin/sh"
|
||||||
|
|||||||
Reference in New Issue
Block a user