From f0616285efd812e94c3e83cedcda4c4e6e24c8a3 Mon Sep 17 00:00:00 2001 From: Dan Marshall <16818261+demolitionmode@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:12:05 +0000 Subject: [PATCH] feat: allow defining startupProbe --- traefik/templates/_podtemplate.tpl | 4 ++++ traefik/tests/traefik-config_test.yaml | 19 +++++++++++++++++++ traefik/values.yaml | 11 +++++++++++ 3 files changed, 34 insertions(+) diff --git a/traefik/templates/_podtemplate.tpl b/traefik/templates/_podtemplate.tpl index 07119cca5..4e122d68d 100644 --- a/traefik/templates/_podtemplate.tpl +++ b/traefik/templates/_podtemplate.tpl @@ -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 }} diff --git a/traefik/tests/traefik-config_test.yaml b/traefik/tests/traefik-config_test.yaml index 6521340cb..16249dcec 100644 --- a/traefik/tests/traefik-config_test.yaml +++ b/traefik/tests/traefik-config_test.yaml @@ -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 diff --git a/traefik/values.yaml b/traefik/values.yaml index 71e377e69..416d7b2b3 100644 --- a/traefik/values.yaml +++ b/traefik/values.yaml @@ -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