diff --git a/traefik/templates/_podtemplate.tpl b/traefik/templates/_podtemplate.tpl index 578b3fc56..82add59fd 100644 --- a/traefik/templates/_podtemplate.tpl +++ b/traefik/templates/_podtemplate.tpl @@ -66,12 +66,14 @@ {{- $healthchecksPort := (default (.Values.ports.traefik).port .Values.deployment.healthchecksPort) }} {{- $healthchecksHost := (default (.Values.ports.traefik).hostIP .Values.deployment.healthchecksHost) }} {{- $healthchecksScheme := (default "HTTP" .Values.deployment.healthchecksScheme) }} + {{- $readinessPath := (default "/ping" .Values.deployment.readinessPath) }} + {{- $livenessPath := (default "/ping" .Values.deployment.livenessPath) }} readinessProbe: httpGet: {{- with $healthchecksHost }} host: {{ . }} {{- end }} - path: /ping + path: {{ $readinessPath }} port: {{ $healthchecksPort }} scheme: {{ $healthchecksScheme }} {{- toYaml .Values.readinessProbe | nindent 10 }} @@ -80,7 +82,7 @@ {{- with $healthchecksHost }} host: {{ . }} {{- end }} - path: /ping + path: {{ $livenessPath }} port: {{ $healthchecksPort }} scheme: {{ $healthchecksScheme }} {{- toYaml .Values.livenessProbe | nindent 10 }} diff --git a/traefik/tests/traefik-config_test.yaml b/traefik/tests/traefik-config_test.yaml index 015f8e245..7376f90a3 100644 --- a/traefik/tests/traefik-config_test.yaml +++ b/traefik/tests/traefik-config_test.yaml @@ -278,12 +278,18 @@ tests: - equal: path: spec.template.spec.containers[0].livenessProbe.httpGet.port value: 9001 + - equal: + path: spec.template.spec.containers[0].livenessProbe.httpGet.path + value: "/ping" - equal: path: spec.template.spec.containers[0].readinessProbe.httpGet.port value: 9001 - equal: path: spec.template.spec.containers[0].readinessProbe.httpGet.scheme value: "HTTP" + - equal: + path: spec.template.spec.containers[0].readinessProbe.httpGet.path + value: "/ping" - contains: path: spec.template.spec.containers[0].args content: "--ping" @@ -318,6 +324,20 @@ tests: - contains: path: spec.template.spec.containers[0].args content: "--ping.entrypoint=websecure" + - it: should set custom probe paths + set: + additionalArguments: + - --ping + deployment: + readinessPath: /ready + livenessPath: /alive + asserts: + - equal: + path: spec.template.spec.containers[0].livenessProbe.httpGet.path + value: /alive + - equal: + path: spec.template.spec.containers[0].readinessProbe.httpGet.path + value: /ready - it: should enable tls on websecure entrypoints by default asserts: - contains: diff --git a/traefik/values.yaml b/traefik/values.yaml index 08199f952..2bff10de4 100644 --- a/traefik/values.yaml +++ b/traefik/values.yaml @@ -38,6 +38,12 @@ deployment: ## Override the liveness/readiness scheme. Useful for getting ping to ## respond on websecure entryPoint. # healthchecksScheme: HTTPS + ## Override the readiness path. + ## Default: /ping + # readinessPath: /ping + # Override the liveness path. + # Default: /ping + # livenessPath: /ping # -- Additional deployment annotations (e.g. for jaeger-operator sidecar injection) annotations: {} # -- Additional deployment labels (e.g. for filtering deployment by custom labels)