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 EKS
Are you running Postgres Operator in production? yes
Type of issue? Bug report
We experienced an issue similar to #924 due to changes in ordering of nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions across syncs of clusters.
Our operator configuration was setting two node_readiness_labels via:
We've worked around this for now by removing the node_readiness_label configuration, but would like to be able to use this again the future.
We were able to capture the StatefulSet before and after and confirmed that the order of nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions was changing. Which caused the cluster to be re-synced due to Cluster.compareStatefulSetWith.
I'm happy to work on a PR that fixes this if you agree that changes to Cluster.compareStatefulSetWith is the appropriate approach. Thanks!
Ok, so it seems we need a method that compares the matchExpression of an affinity ignoring the order. I'd welcome a PR on that. Please also add unit tests, too. Thanks :)
We experienced an issue similar to #924 due to changes in ordering of
nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions
across syncs of clusters.Our operator configuration was setting two
node_readiness_labels
via:And an additional label via the
Cluster
spec:We've worked around this for now by removing the
node_readiness_label
configuration, but would like to be able to use this again the future.We were able to capture the
StatefulSet
before and after and confirmed that the order ofnodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms.matchExpressions
was changing. Which caused the cluster to be re-synced due toCluster.compareStatefulSetWith
.I'm happy to work on a PR that fixes this if you agree that changes to
Cluster.compareStatefulSetWith
is the appropriate approach. Thanks!