Skip to content

Commit

Permalink
feat: allow defining startupProbe
Browse files Browse the repository at this point in the history
  • Loading branch information
demolitionmode committed Nov 6, 2023
1 parent 2045843 commit f061628
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@
port: {{ $healthchecksPort }}
scheme: {{ $healthchecksScheme }}
{{- toYaml .Values.livenessProbe | nindent 10 }}
{{- with .Values.startupProbe}}
startupProbe:
{{- toYaml . | nindent 10 }}
{{- end }}
lifecycle:
{{- with .Values.deployment.lifecycle }}
{{- toYaml . | nindent 10 }}
Expand Down
19 changes: 19 additions & 0 deletions traefik/tests/traefik-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,22 @@ tests:
- contains:
path: spec.template.spec.containers[0].args
content: "--accesslog.bufferingsize=100"
- it: should set custom startupProbe
set:
startupProbe:
exec:
command:
- mycommand
- foo
initialDelaySeconds: 5
periodSeconds: 5
asserts:
- equal:
path: spec.template.spec.containers[0].startupProbe.exec.command
value: ["mycommand", "foo"]
- equal:
path: spec.template.spec.containers[0].startupProbe.initialDelaySeconds
value: 5
- equal:
path: spec.template.spec.containers[0].startupProbe.periodSeconds
value: 5
11 changes: 11 additions & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@ livenessProbe:
# -- The number of seconds to wait for a probe response before considering it as failed.
timeoutSeconds: 2

# -- Define Startup Probe for container: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-startup-probes
# eg.
# `startupProbe:
# exec:
# command:
# - mycommand
# - foo
# initialDelaySeconds: 5
# periodSeconds: 5`
startupProbe:

providers:
kubernetesCRD:
# -- Load Kubernetes IngressRoute provider
Expand Down

0 comments on commit f061628

Please sign in to comment.