From 6095129c25b9bef79461f108d47f6db61ee1c174 Mon Sep 17 00:00:00 2001 From: Hiranmoy Das Chowdhury Date: Thu, 2 Jan 2025 17:00:57 +0600 Subject: [PATCH 1/5] Add Pgpool HBA File Constant Signed-off-by: Hiranmoy Das Chowdhury --- apis/kubedb/constants.go | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/kubedb/constants.go b/apis/kubedb/constants.go index d72051d08..834feb32c 100644 --- a/apis/kubedb/constants.go +++ b/apis/kubedb/constants.go @@ -649,6 +649,7 @@ const ( PgpoolDatabasePortName = "db" PgpoolPcpPortName = "pcp" PgpoolCustomConfigFile = "pgpool.conf" + PgpoolCustomHBAConfigFile = "pool_hba.conf" // ========================================== ZooKeeper Constants =================================================// KubeDBZooKeeperRoleName = "kubedb:zookeeper-version-reader" From 84aa7832cfae2dd9ef093291d3071ba7e859443e Mon Sep 17 00:00:00 2001 From: Hiranmoy Das Chowdhury Date: Thu, 2 Jan 2025 17:03:14 +0600 Subject: [PATCH 2/5] add pcp.conf Signed-off-by: Hiranmoy Das Chowdhury --- apis/kubedb/constants.go | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/kubedb/constants.go b/apis/kubedb/constants.go index 834feb32c..e88225786 100644 --- a/apis/kubedb/constants.go +++ b/apis/kubedb/constants.go @@ -650,6 +650,7 @@ const ( PgpoolPcpPortName = "pcp" PgpoolCustomConfigFile = "pgpool.conf" PgpoolCustomHBAConfigFile = "pool_hba.conf" + PgpoolCustomPCPFile = "pcp.conf" // ========================================== ZooKeeper Constants =================================================// KubeDBZooKeeperRoleName = "kubedb:zookeeper-version-reader" From edc0d1d969f4d7a1eb0aad84486d91eb0086a7f4 Mon Sep 17 00:00:00 2001 From: Hiranmoy Das Chowdhury Date: Fri, 3 Jan 2025 17:44:50 +0600 Subject: [PATCH 3/5] PGPOOL_INSTALL_DIR added Signed-off-by: Hiranmoy Das Chowdhury --- apis/kubedb/constants.go | 1 + 1 file changed, 1 insertion(+) diff --git a/apis/kubedb/constants.go b/apis/kubedb/constants.go index e88225786..e69e3f097 100644 --- a/apis/kubedb/constants.go +++ b/apis/kubedb/constants.go @@ -651,6 +651,7 @@ const ( PgpoolCustomConfigFile = "pgpool.conf" PgpoolCustomHBAConfigFile = "pool_hba.conf" PgpoolCustomPCPFile = "pcp.conf" + PGPOOL_INSTALL_DIR = "/opt/pgpool-II" // ========================================== ZooKeeper Constants =================================================// KubeDBZooKeeperRoleName = "kubedb:zookeeper-version-reader" From 9c56f578e5b0b9b964df6b36dd9b2cf17db7e00d Mon Sep 17 00:00:00 2001 From: Hiranmoy Das Chowdhury Date: Wed, 8 Jan 2025 18:12:22 +0600 Subject: [PATCH 4/5] constant for reconfiguration Signed-off-by: Hiranmoy Das Chowdhury --- apis/ops/v1alpha1/constant.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apis/ops/v1alpha1/constant.go b/apis/ops/v1alpha1/constant.go index 4ccc60179..b91586ab5 100644 --- a/apis/ops/v1alpha1/constant.go +++ b/apis/ops/v1alpha1/constant.go @@ -358,3 +358,8 @@ const ( UpdatePgBouncerBackendSecret = "UpdateBackendSecret" ConfigSecretDelete = "ConfigSecretDeleted" ) + +// Pgpool Constants +const ( + UpdateConfigSecret = "UpdateConfigSecret" +) From 06d5bfa59f5687e1cac9f02e25d5e272804b62aa Mon Sep 17 00:00:00 2001 From: Hiranmoy Das Chowdhury Date: Fri, 10 Jan 2025 18:55:35 +0600 Subject: [PATCH 5/5] added pcp.conf and remove pcp user and pass from env of petset Signed-off-by: Hiranmoy Das Chowdhury --- apis/kubedb/constants.go | 1 + apis/kubedb/v1alpha2/pgpool_helpers.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/apis/kubedb/constants.go b/apis/kubedb/constants.go index e69e3f097..cd4e94738 100644 --- a/apis/kubedb/constants.go +++ b/apis/kubedb/constants.go @@ -626,6 +626,7 @@ const ( EnvSkipPasswdEncryption = "PGPOOL_SKIP_PASSWORD_ENCRYPTION" PgpoolConfigSecretMountPath = "/config" PgpoolConfigVolumeName = "pgpool-config" + PgpoolPcpConfigVolumeName = "pgpool-pcp-config" PgpoolContainerName = "pgpool" PgpoolDefaultServicePort = 9999 PgpoolMonitoringDefaultServicePort = 9719 diff --git a/apis/kubedb/v1alpha2/pgpool_helpers.go b/apis/kubedb/v1alpha2/pgpool_helpers.go index 9fc3e1454..2fab05093 100644 --- a/apis/kubedb/v1alpha2/pgpool_helpers.go +++ b/apis/kubedb/v1alpha2/pgpool_helpers.go @@ -160,6 +160,10 @@ func (p *Pgpool) GetAuthSecretName() string { return meta_util.NameWithSuffix(p.OffshootName(), "auth") } +func (p *Pgpool) GetPcpConfigSecretName() string { + return meta_util.NameWithSuffix(p.OffshootName(), "pcp-config") +} + func (p *Pgpool) SetHealthCheckerDefaults() { if p.Spec.HealthChecker.PeriodSeconds == nil { p.Spec.HealthChecker.PeriodSeconds = pointer.Int32P(10)