postgres-operator
postgres-operator copied to clipboard
Cluster Env Variable Updates Require Operator Restart
Please, answer some short questions which should help us to understand your problem / question better?
- Which image of the operator are you using? registry.opensource.zalan.do/acid/postgres-operator:v1.8.2
- Where do you run it - cloud or metal? Kubernetes or OpenShift? [AWS K8s]
- Are you running Postgres Operator in production? [no]
- Type of issue? [question]
Hi, is it expected behavior that env variable updates to the Postgresql CR are not propagated to pods by the operator unless the operator is bounced? Looks like a difference between how the operator is handling an update
vs. add
event. Thanks!
Gist with CR, configmap, and logs: https://gist.github.com/zpear/76802a09810bba3df10fa4a7657be80d
Oh! I also faced this problem :( I think the problem is started from this place https://github.com/zalando/postgres-operator/blob/master/pkg/cluster/cluster.go#L830 For starting syncing statefulsets process oldSs and newSs have to be different. Olds and newSs is initialized by generate of StatefulSet function And this function doesn't see custom env vars. Seems like a bug. This is my guess and I could be wrong. I think the guys from zolando will be able to comment in more details.
UPD. I think this function generates env vars https://github.com/zalando/postgres-operator/blob/d209612b18122ae42250bd0517533fd7cbad5c66/pkg/cluster/k8sres.go#L1189
Yes, @FactorT you are totally right, the problem is inside the generateSpiloPodEnvVars
as it getting env variable data from the Cluster.Spec
data which is not compatible with the StatefulSet comparison function.