-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add topologySpreadConstraints configuration to pod spec. #2530
base: master
Are you sure you want to change the base?
Add topologySpreadConstraints configuration to pod spec. #2530
Conversation
b948c94
to
44fcb1f
Compare
We need that feature too. |
@@ -465,6 +465,11 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa | |||
needsRollUpdate = true | |||
reasons = append(reasons, "new statefulset's pod affinity does not match the current one") | |||
} | |||
if !reflect.DeepEqual(c.Statefulset.Spec.Template.Spec.TopologySpreadConstraints, statefulSet.Spec.Template.Spec.TopologySpreadConstraints) { | |||
needsReplace = true | |||
needsRollUpdate = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this really need to trigger a rolling update of pods executed by operator? Will not K8s take care of it then once the statefulset is replaced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, but is this wrong too?
https://github.com/zalando/postgres-operator/blob/master/pkg/cluster/cluster.go#L472
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm good point. Maybe we can leave as is for now. With rolling update we make sure pods immediately adhere the new constraints.
Can you also write an e2e test that tests that the constraints work as expected, please? |
530f847
to
18023cb
Compare
d52f435
to
909b45f
Compare
434c6c5
to
ee2b43d
Compare
Dear @FxKu |
ee2b43d
to
24b9f65
Compare
Dear @FxKu |
@laiminhtrung1997 thanks a lot for the update. I think, in this state you can be sure we will merge it for the next release. We have to focus on the new status feature first but I will get back to you in September. |
c5c4713
to
256fd9f
Compare
256fd9f
to
fbac974
Compare
Dear all,
I think we should configure topologySpreadConstraints to pod spec so these pods can spread zones for high availability.
Could someone review it, please? Thank you very much.
Best regards.