Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add startup probe #40190

Merged
merged 2 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
cbron marked this conversation as resolved.
Show resolved Hide resolved
- it: should not have startupProbe if no startupProbe fields set
asserts:
- isNull:
path: spec.template.spec.containers[0].startupProbe