cluster stuck in init state if pgbackrest secret doesn't exist
General
Escalation
General
Escalation
Description
If I specify pgbackrest secret which doesn’t exist cluster is stuck in init state and there’s no obvious error in operator.
Operator is waiting for the backup in the loop:
Pods:
But in kubernetes events we see the actual error:
Probably it would be better if we checked if this secret exists, throw an error if not and not try to start a cluster.
Environment
None
Activity
inel.pandzic August 21, 2024 at 6:59 AM
After checking the behavior, the conclusion is that we shouldn’t check if a secret is present and these are the reasons:
In our other operators we don’t check them
When you describe a pod that is not running it is clear what is the problem (MountVolume.SetUp failed for volume "pgbackrest-config" : secret "cluster1-pgbackrest-secrets" not found)
Also, it is a K8S way that a error is shown for a particular object, not the one that created it. For example, for a missing secret, it will not be seen on a STS that created the pod, but rather on that particular pod. We should have the same approach with our controller.
If I specify pgbackrest secret which doesn’t exist cluster is stuck in init state and there’s no obvious error in operator.
Operator is waiting for the backup in the loop:
Pods:
But in kubernetes events we see the actual error:
Probably it would be better if we checked if this secret exists, throw an error if not and not try to start a cluster.