Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Kubegres cluster deployment #145

Open
rrpatil7279 opened this issue Jan 24, 2023 · 1 comment
Open

Issue with Kubegres cluster deployment #145

rrpatil7279 opened this issue Jan 24, 2023 · 1 comment

Comments

@rrpatil7279
Copy link

Hello,

I need your help to troubleshoot the following issue I am facing with the Kubegres deployment.

I have a K8S environment having 2 nodes, 1 Master & 1 Worker. I followed the instructions to deploy the Kubegres-controller and it is up & running. I am trying to deploy the Postgres Cluster with 2 replicas. Primary Pod is up & running however Secondary Pod is getting into the error. Looking at the logs I figured out that the “replication” role & user is not created by the Primary Pod hence Secondary Pod is not able to connect and is failing. I am using the base config and I can see that the .sh files are mounted successfully on Primary Pod but unable to figure out why it did not execute .sh? Please help.

k get pods
NAME READY STATUS RESTARTS AGE
ssodb-1-0 1/1 Running 0 10m
ssodb-2-0 0/1 Init:CrashLoopBackOff 6 (2m15s ago) 10m

< -- Copied form ssodb-1-0 Pod description -- >
Mounts:
/docker-entrypoint-initdb.d/primary_create_replication_role.sh from base-config (rw,path="primary_create_replication_role.sh")
/docker-entrypoint-initdb.d/primary_init_script.sh from base-config (rw,path="primary_init_script.sh")
/etc/pg_hba.conf from base-config (rw,path="pg_hba.conf")
/etc/postgres.conf from base-config (rw,path="postgres.conf")
/var/lib/postgresql/data from postgres-db (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-dcnfz (ro)
< -- end -- >

k logs ssodb-2-0 -c setup-replica-data-directory
20/01/2023 05:32:05 - Attempting to copy Primary DB to Replica DB...
ls: cannot access '/var/lib/postgresql/data/pgdata': No such file or directory
20/01/2023 05:32:05 - Copying Primary DB to Replica DB folder: /var/lib/postgresql/data/pgdata
20/01/2023 05:32:05 - Running: pg_basebackup -R -h ssodb -D /var/lib/postgresql/data/pgdata -P -U replication;
pg_basebackup: error: connection to server at "ssodb" (192.168.191.126), port 5432 failed: FATAL: password authentication failed for user "replication"

@am4am5
Copy link

am4am5 commented Feb 7, 2023

Hi, rrpatil7279,

I have the same issue after editing the secret, containing passwords with kubectl edit or trying to create it from YAML.

Try to make yor secret with kubectl create like this:

kubectl create secret generic <secret_name> \
    --from-literal=<name1>='<password1>' \
    --from-literal=<name2>='<password2>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants