Kubegres is a Kubernetes operator allowing to deploy one or many clusters of PostgreSql instances and manage databases replication, failover and backup.
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal FailoverCannotHappenAsNoReplicaDeployed 25s (x2 over 26s) Kubegres-controller A failover is required for a Primary Pod as it is not healthy. However, a failover cannot happen because there is not any Replica deployed.
The error makes sense because no replica is available. However, its unclear how to recover the cluster. Although the statefulsets were deleted, the PVCs still exist, and the database is intact.
Using promotePod is not possible because we cannot promote a pod that is not running.
As a workaround, I was able to manually create a statefulset out of band, and then promote the pod. But this process was kind of error prone (editing index labels) and unclear. I'm not sure I did it right, but it seemed to work eventually.
Feature idea: maybe a promotePVC option that can start the statefulset from an existing PVC.
Starting with a health cluster with 3 replicas:
Delete the statefulsets:
The following error is seen:
The error makes sense because no replica is available. However, its unclear how to recover the cluster. Although the statefulsets were deleted, the PVCs still exist, and the database is intact.
Using
promotePod
is not possible because we cannot promote a pod that is not running.As a workaround, I was able to manually create a statefulset out of band, and then promote the pod. But this process was kind of error prone (editing index labels) and unclear. I'm not sure I did it right, but it seemed to work eventually.
Feature idea: maybe a
promotePVC
option that can start the statefulset from an existing PVC.