Skip to content

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

@hach-que

Description

@hach-que

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();'"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions