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

Kubegres replication can leave primary stuck in read-only mode #187

Open
hach-que opened this issue Nov 12, 2024 · 0 comments
Open

Kubegres replication can leave primary stuck in read-only mode #187

hach-que opened this issue Nov 12, 2024 · 0 comments

Comments

@hach-que
Copy link

Kubegres needs to run the following command to fix up primaries after they've been promoted at the Kubernetes level:

NAMESPACE=...
KUBEGRES_NAME=...
KUBEGRES_SECRET_NAME=...
kubectl -n $NAMESPACE exec -it $(kubectl -n $NAMESPACE get pod -l replicationRole=primary,app=$KUBEGRES_NAME -o=name) -- /bin/bash -c "PGPASSWORD=$(kubectl -n $NAMESPACE get secret $KUBEGRES_SECRET_NAME --template '{{.data.superUserPassword}}' | base64 --decode) /bin/psql -U postgres -c 'SELECT pg_promote();'"
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

1 participant