Skip to content

Commit

Permalink
Merge pull request #40190 from rmweir/add-start-probe
Browse files Browse the repository at this point in the history
Add startup probe
  • Loading branch information
rmweir committed Jan 20, 2023
2 parents 1fd6c33 + 7296609 commit fbfb16c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ spec:
port: 80
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds | default 5}}
periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 30}}
{{- if .Values.startupProbe }}
startupProbe:
httpGet:
path: /healthz
port: 80
failureThreshold: {{.Values.startupProbe.failureThreshold | default 1}}
periodSeconds: {{ .Values.startupProbe.periodSeconds | default 30}}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
Expand Down
36 changes: 36 additions & 0 deletions chart/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,3 +342,39 @@ tests:
- equal:
path: spec.template.spec.containers[0].readinessProbe.periodSeconds
value: 60
- it: should set startupProbe periodSeconds to 60
set:
startupProbe.periodSeconds: 60
asserts:
- equal:
path: spec.template.spec.containers[0].startupProbe.periodSeconds
value: 60
- equal:
path: spec.template.spec.containers[0].startupProbe.failureThreshold
value: 1
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.port
value: 80
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.path
value: /healthz
- it: should set startupProbe failureThreshold to 10
set:
startupProbe.failureThreshold: 10
asserts:
- equal:
path: spec.template.spec.containers[0].startupProbe.periodSeconds
value: 30
- equal:
path: spec.template.spec.containers[0].startupProbe.failureThreshold
value: 10
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.port
value: 80
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.path
value: /healthz
- it: should not have startupProbe if no startupProbe fields set
asserts:
- isNull:
path: spec.template.spec.containers[0].startupProbe

0 comments on commit fbfb16c

Please sign in to comment.