Closed bsakweson closed 4 years ago
Here is what I think caused that error. I believe I ran it the first time and for reason it failed. I deleted the deployment without deleting the PV and then try to deploy it again using the same PV but this time around and several times afterwards it failed. After I deleted the PV I redeployed a fresh deployment, it worked. I'd say remember to delete the PVC if deployment fail before redeploying.
Thanks for letting us know, passwords are stored in the PV (in a secure way), as the password is randomly generated (or if you manually specify a different password) you need to delete the PVC in order to match the new password.
Hi
If I delete the PV (to deal with the repmgr ipassword being randomly reset) then would it also delete all the data in the database?
The pods in my AWS-EKS cluster got recreated (when we changed the instance types), now I am getting this log line
[2020-04-22 13:25:52] [DETAIL] attempted to connect using:
user=repmgr password=*******redacted****** connect_timeout=5 dbname=repmgr host=hapgdb-postgresql-ha-postgresql-0.hapgdb-postgresql-ha-postgresql-headless.hapgdb.svc.cluster.local port=5432 fallback_application_name=repmgr
Thanks
It should be fine for pods to be recreated. However, if you delete the data in the PV you would lose the data.
Note that the passwords/secrets are set initially when creating the deployments/statefulsets. If you have launched your chart with existing PVs and using random passwords, it is very likely they are different.
I have a similar issue popping up; my case was that I didnt touch the PVs or PVCs; I just resized the nodes (different T-shirt sizes in my AWS EKS Kubernetes Cluster). So yes, all pods got re-created.
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.17 [0m
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.17 [0m[1mWelcome to the Bitnami postgresql-repmgr container[0m
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.17 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/bitnami-docker-postgresql-repmgr[0m
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.18 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/bitnami-docker-postgresql-repmgr/issues[0m
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.18 [0mSend us your feedback at [1mcontainers@bitnami.com[0m
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.18 [0m
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.19 [0m[38;5;2mINFO [0m ==> ** Starting PostgreSQL with Replication Manager setup **
[38;5;6mrepmgr [38;5;5m12:46:46.24 [0m[38;5;2mINFO [0m ==> Validating settings in REPMGR_* env vars...
[38;5;6mpostgresql [38;5;5m12:46:46.25 [0m[38;5;2mINFO [0m ==> Validating settings in POSTGRESQL_* env vars..
[38;5;6mrepmgr [38;5;5m12:46:46.25 [0m[38;5;2mINFO [0m ==> Querying all partner nodes for common upstream node...
[38;5;6mrepmgr [38;5;5m12:46:46.29 [0m[38;5;2mINFO [0m ==> There are no nodes with primary role. Assuming the primary role...
[38;5;6mrepmgr [38;5;5m12:46:46.30 [0m[38;5;2mINFO [0m ==> Preparing PostgreSQL configuration...
[38;5;6mpostgresql [38;5;5m12:46:46.30 [0m[38;5;2mINFO [0m ==> postgresql.conf file not detected. Generating it...
[38;5;6mrepmgr [38;5;5m12:46:46.35 [0m[38;5;2mINFO [0m ==> Preparing repmgr configuration...
[38;5;6mrepmgr [38;5;5m12:46:46.36 [0m[38;5;2mINFO [0m ==> Initializing Repmgr...
[38;5;6mpostgresql [38;5;5m12:46:46.36 [0m[38;5;2mINFO [0m ==> Initializing PostgreSQL database...
[38;5;6mpostgresql [38;5;5m12:46:46.36 [0m[38;5;2mINFO [0m ==> Cleaning stale /bitnami/postgresql/data/postmaster.pid file
[38;5;6mpostgresql [38;5;5m12:46:46.37 [0m[38;5;2mINFO [0m ==> Custom configuration /opt/bitnami/postgresql/conf/postgresql.conf detected
[38;5;6mpostgresql [38;5;5m12:46:46.37 [0m[38;5;2mINFO [0m ==> Custom configuration /opt/bitnami/postgresql/conf/pg_hba.conf detected
[38;5;6mpostgresql [38;5;5m12:46:46.38 [0m[38;5;2mINFO [0m ==> Deploying PostgreSQL with persisted data...
[38;5;6mpostgresql [38;5;5m12:46:46.39 [0m[38;5;2mINFO [0m ==> Stopping PostgreSQL...
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.40 [0m[38;5;2mINFO [0m ==> ** PostgreSQL with Replication Manager setup finished! **
[38;5;6mpostgresql [38;5;5m12:46:46.45 [0m[38;5;2mINFO [0m ==> Starting PostgreSQL in background...
[38;5;6mpostgresql-repmgr [38;5;5m12:46:46.57 [0m[38;5;2mINFO [0m ==> ** Starting repmgrd **
[2020-05-09 12:46:46] [NOTICE] repmgrd (repmgrd 5.0.0) starting up
[2020-05-09 12:46:46] [ERROR] connection to database failed
[2020-05-09 12:46:46] [DETAIL]
FATAL: password authentication failed for user "repmgr"
[2020-05-09 12:46:46] [DETAIL] attempted to connect using:
user=repmgr password=******** connect_timeout=5 dbname=repmgr host=hapgdb-postgresql-ha-postgresql-0.hapgdb-postgresql-ha-postgresql-headless.hapgdb.svc.cluster.local port=5432 fallback_application_name=repmgr
The repmgr_password was randomly generated in the installation.
Could you share some steps so we can reproduce this issue from a clean Helm chart deployment?
I tried to reproduce by deploying and suddenly removing all nodes at once a few times, but the chart keeps working properly.
Thanks for your message.
In order to reproduce the error (in Amazon EKS at least),
Create a HA cluster using the default values.yaml file.
Delete all the nodes in the K8s cluster (note all block storage comes from EBS volumes so those are not deleted). Deleting all nodes simply takes out all pods.
Recreate the nodes so Kubernetes can start re-creating the pods.
The database will not mount; it will complain about the repmgr password as shown in the logs I posted earlier.
I will try later today with explicitly setting the repmgr password in the values.yaml file and then report if that solves the problem.
Thanks
On Mon, May 11, 2020 at 8:46 AM Marcos Bjoerkelund notifications@github.com wrote:
Could you share some steps so we can reproduce this issue from a clean Helm chart deployment?
I tried to reproduce by deploying and suddenly removing all nodes at once a few times, but the chart keeps working properly.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bitnami/charts/issues/1738#issuecomment-626679609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELYTVE66563GI7NGSTTXCLRQ7XSJANCNFSM4J2SDE6A .
-- Sachin Agarwal BigBitBus Inc. http://www.BigBitBus.com
Same issue here
Uninstalled helm chart.
Deleted pvc.
Delete namespace
Recreated namespace.
Reinstalled helm chart.
user=postrepmgr password=mycustompass connect_timeout=5 dbname=postrepdb host=mycompany-postgresql-ha-postgresql-0.mycompany-postgresql-ha-postgresql-headless.mycompany.svc.cluster.local port=5432 fallback_application_name=repmgr
Hi @MrAmbiG, could you share how you deployed the Helm chart? (including any custom values in values.yaml
or --set
options).
Note that the Bitnami PostgreSQL HA chart creates two secrets by default, postgresql-password
and repmgr-password
.
If you don't set the values for those passwords in values.yaml
or via --set
, they will be overridden/changed for each deployment, meaning if you deploy a new PostgreSQL HA chart with the previous volume, using old (correct) credentials, it would try to connect with the new (wrong) credentials, and therefore the authentication fails.
Hi @MrAmbiG, could you share how you deployed the Helm chart? (including any custom values in
values.yaml
or--set
options).Note that the Bitnami PostgreSQL HA chart creates two secrets by default,
postgresql-password
andrepmgr-password
.If you don't set the values for those passwords in
values.yaml
or via--set
, they will be overridden/changed for each deployment, meaning if you deploy a new PostgreSQL HA chart with the previous volume, using old (correct) credentials, it would try to connect with the new (wrong) credentials, and therefore the authentication fails.
Everytime i deployed/redeployed, I made sure to delete pvc and the namespace that it was deployed to, after deleting the helm chart itself. So, there is no way it would have tried to use the old volume where old credentials were stored. I tried
In that case, it seems like your issue is not when recreating the Helm chart, instead even the first chart installation fails for you.
We're sorry to hear it did not work for you. I tried again with the following changed values and the deployment went fine without any issues:
diff --git a/bitnami/postgresql-ha/values.yaml b/bitnami/postgresql-ha/values.yaml
index 565b6e25f..54b5e37af 100644
--- a/bitnami/postgresql-ha/values.yaml
+++ b/bitnami/postgresql-ha/values.yaml
@@ -236,9 +236,9 @@ postgresql:
## Repmgr configuration parameters
##
- repmgrUsername: repmgr
- # repmgrPassword:
- repmgrDatabase: repmgr
+ repmgrUsername: postrepmgr
+ repmgrPassword: mycustompass
+ repmgrDatabase: postrepdb
repmgrLogLevel: NOTICE
repmgrConnectTimeout: 5
repmgrReconnectAttempts: 3
Even deleting the deployment (including volumes) and re-creating it worked. So it is most likely something related to your Kubernetes environment that is causing these issues.
Which chart: bitnami/postgresql-ha 1.1.0, postgresql version 11.6.0 Chart for PostgreSQL with HA architecture (using Replicat...
Description
I basically did not do much here, I just setup my parameters as shown in my customized
values.yaml
shown belowSteps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
Installation did not succeed.
values.yaml
Version of Helm and Kubernetes: *NOTE I am running serverless helm