From 6f2d86a1b4fce00a0f568fbf50f2b89ee8e82c86 Mon Sep 17 00:00:00 2001 From: lzzhang Date: Wed, 17 Apr 2024 21:29:51 +0800 Subject: [PATCH] change livenessProbe command --- .../postgres-operator/postgres/pgsqlclusters/create.py | 4 ++-- .../postgres-operator/postgres/pgsqlcommons/constants.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/create.py b/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/create.py index 527d88d..2e36cfa 100644 --- a/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/create.py +++ b/platforms/kubernetes/postgres-operator/postgres/pgsqlclusters/create.py @@ -232,11 +232,11 @@ def create_statefulset( CONTAINER_NAME] == PODSPEC_CONTAINERS_POSTGRESQL_CONTAINER: container["args"] = ["auto_failover"] container["env"] = env - container["readinessProbe"] = { + container["livenessProbe"] = { "initialDelaySeconds": 20, "periodSeconds": 5, "exec": { - "command": WAITING_POSTGRESQL_READY_COMMAND + "command": POD_READY_COMMAND } } if container[CONTAINER_NAME] == PODSPEC_CONTAINERS_EXPORTER_CONTAINER: diff --git a/platforms/kubernetes/postgres-operator/postgres/pgsqlcommons/constants.py b/platforms/kubernetes/postgres-operator/postgres/pgsqlcommons/constants.py index c1cbd22..6b9ae4e 100644 --- a/platforms/kubernetes/postgres-operator/postgres/pgsqlcommons/constants.py +++ b/platforms/kubernetes/postgres-operator/postgres/pgsqlcommons/constants.py @@ -357,6 +357,7 @@ PRIMARY_FORMATION = " --formation primary " FIELD_DELIMITER = "-" WAITING_POSTGRESQL_READY_COMMAND = ["pgtools", "-a"] +POD_READY_COMMAND = ["echo"] INIT_FINISH_MESSAGE = "init postgresql finish" STOP_FAILED_MESSAGE = "stop auto_failover failed" POSTGRESQL_NOT_RUNNING_MESSAGE = "can't connect database."