From b3540ccfdfa6956fb20c62e5e5bb76af56d2ab63 Mon Sep 17 00:00:00 2001 From: Robert Church Date: Wed, 12 May 2021 22:36:23 -0400 Subject: [PATCH] Update the liveness probe to verify postgres connectivity Change the tillerLivenessProbeTemplate to test the connectivity to the postgres backend. We will override the periodSeconds and failureThreshold when installing the helm chart to trigger a restart of the tiller pod over a swact when the postgres DB/server moves from one controller to the other. This will help guarantee that the tiller connection is always re-established if the connectivity to the postgres backend fails. Change-Id: I7fbed33a8c821f6c9254f58d5953e2115cf4141a Related-Bug: #1917308 Signed-off-by: Robert Church --- kubernetes/armada/centos/armada.spec | 2 + ...ess-probe-to-verify-postgres-connect.patch | 45 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 kubernetes/armada/centos/files/0003-Update-the-liveness-probe-to-verify-postgres-connect.patch diff --git a/kubernetes/armada/centos/armada.spec b/kubernetes/armada/centos/armada.spec index bd9860c2b..28ab3b6e3 100644 --- a/kubernetes/armada/centos/armada.spec +++ b/kubernetes/armada/centos/armada.spec @@ -17,6 +17,7 @@ Source0: %{name}-%{git_sha}.tar.gz Patch1: 0001-Add-Helm-v2-client-initialization-using-tiller-postS.patch Patch2: 0002-Tiller-wait-for-postgres-database-ping.patch +Patch3: 0003-Update-the-liveness-probe-to-verify-postgres-connect.patch BuildArch: noarch @@ -31,6 +32,7 @@ BuildRequires: chartmuseum %setup -n armada %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build # Package the armada chart tarball using methodology derived from: diff --git a/kubernetes/armada/centos/files/0003-Update-the-liveness-probe-to-verify-postgres-connect.patch b/kubernetes/armada/centos/files/0003-Update-the-liveness-probe-to-verify-postgres-connect.patch new file mode 100644 index 000000000..ecd3f8939 --- /dev/null +++ b/kubernetes/armada/centos/files/0003-Update-the-liveness-probe-to-verify-postgres-connect.patch @@ -0,0 +1,45 @@ +From be3167e5342f2730ef43012d8fe4f3782c6ef468 Mon Sep 17 00:00:00 2001 +From: Robert Church +Date: Wed, 12 May 2021 02:38:52 -0400 +Subject: [PATCH 3/3] Update the liveness probe to verify postgres connectivity + +Change the tillerLivenessProbeTemplate to test the connectivity to the +postgres backend. We will override the periodSeconds and +failureThreshold when installing the helm chart to trigger a restart of +the tiller pod over a swact when the postgres DB/server moves from one +controller to the other. + +This will help guarantee that the tiller connection is always +reestablished if the connectivity to the postgres backend fails. + +Signed-off-by: Robert Church +--- + charts/armada/templates/deployment-api.yaml | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/charts/armada/templates/deployment-api.yaml b/charts/armada/templates/deployment-api.yaml +index bf23fb2..2b65494 100644 +--- a/charts/armada/templates/deployment-api.yaml ++++ b/charts/armada/templates/deployment-api.yaml +@@ -28,10 +28,14 @@ httpGet: + {{- end }} + + {{- define "tillerLivenessProbeTemplate" }} +-httpGet: +- path: /liveness +- port: {{ .Values.conf.tiller.probe_port }} +- scheme: HTTP ++exec: ++ command: ++ - nc ++ - -vz ++ - -w ++ - "1" ++ - {{ .Values.conf.tiller.sql_endpoint_ip}} ++ - "5432" + {{- end }} + + {{- if .Values.manifests.deployment_api }} +-- +2.16.6 +