From a3d2c0d6c87211003f20d9d8da8640c145cb5879 Mon Sep 17 00:00:00 2001 From: slavogiez Date: Mon, 15 May 2023 17:05:02 +0200 Subject: [PATCH] feat: add support for startupProbe on kong pods (#792) When Kong dataplanes need to load a large config, pods may take some time to be ready. Without the startup probe, we would need to increase failureThreshold or play with initialDelaySeconds, which would have a negative side effect on the responsiveness of these probes in case of real issues. --- charts/kong/CHANGELOG.md | 3 +++ charts/kong/README.md | 1 + charts/kong/templates/deployment.yaml | 4 ++++ charts/kong/values.yaml | 12 ++++++++++++ 4 files changed, 20 insertions(+) diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index 96885a85a..791bcda3d 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -4,6 +4,9 @@ ### Improvements +* Added support for `startupProbe` on Kong pods. This can be configured via + `.Values.startupProbe`. To maintain backward compatibility, it is disabled by default. + [#792](https://github.com/Kong/charts/pull/792) * Customize Admission Webhook namespaceSelectors and compose them from values. [#794](https://github.com/Kong/charts/pull/794) diff --git a/charts/kong/README.md b/charts/kong/README.md index 414dc657f..bc60c4bf8 100644 --- a/charts/kong/README.md +++ b/charts/kong/README.md @@ -841,6 +841,7 @@ On the Gateway release side, set either `admin.tls.client.secretName` to the nam | updateStrategy | update strategy for deployment | `{}` | | readinessProbe | Kong readiness probe | | | livenessProbe | Kong liveness probe | | +| startupProbe | Kong startup probe | | | lifecycle | Proxy container lifecycle hooks | see `values.yaml` | | terminationGracePeriodSeconds | Sets the [termination grace period](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution) for Deployment pods | 30 | | affinity | Node/pod affinities | | diff --git a/charts/kong/templates/deployment.yaml b/charts/kong/templates/deployment.yaml index a4bb4c0b7..81174655c 100644 --- a/charts/kong/templates/deployment.yaml +++ b/charts/kong/templates/deployment.yaml @@ -273,6 +273,10 @@ spec: {{ toYaml .Values.readinessProbe | indent 10 }} livenessProbe: {{ toYaml .Values.livenessProbe | indent 10 }} + {{- if .Values.startupProbe }} + startupProbe: +{{ toYaml .Values.startupProbe | indent 10 }} + {{- end }} resources: {{ toYaml .Values.resources | indent 10 }} {{- end }} {{/* End of Kong container spec */}} diff --git a/charts/kong/values.yaml b/charts/kong/values.yaml index 5d0e16763..4db4b720e 100644 --- a/charts/kong/values.yaml +++ b/charts/kong/values.yaml @@ -790,6 +790,18 @@ livenessProbe: successThreshold: 1 failureThreshold: 3 +# startupProbe for Kong pods +# startupProbe: +# httpGet: +# path: "/status" +# port: status +# scheme: HTTP +# initialDelaySeconds: 5 +# timeoutSeconds: 5 +# periodSeconds: 2 +# successThreshold: 1 +# failureThreshold: 40 + # Proxy container lifecycle hooks # Ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/ lifecycle: