-
Notifications
You must be signed in to change notification settings - Fork 1k
Add Pod Anti Affinity #489
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
Conversation
related #479 |
In some cases it is OK to have 2 PG pods on the same node, for instance when testing switchover/failover |
This def. needs a toggle, maybe incl. a toggle per cluster. While initially this may sound bad for availability it all depends. In our K8S infrastructure on AWS this is also largely not happening for a single Postgres cluster as pods are bound to different AZs via the different EBS volumes. But if your storage is EBS it may sometimes in a single AZ not matter so much if pods are on the same host. Regarding #479 I am looking forward to ideas. In our initial impl. in Python this was somehow neater having the statefulset spec just injected as a String template. |
@Jan-M I think it's a good idea to have a switch in the cluster config to enable pod anti affinity and a addtional property to set the pod affinity |
* use `cluster_labels` for pod anti affinity * use `node_readiness_label` when defined * added property `enable_pod_antiaffinity` to operator config * added property `pod_antiaffinity_topology_key`
@Jan-M Switch for pod anti affinity is implemented as well as the |
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.
-
Could you also update the admin docs and the operator params' reference to mention the new option ?
-
pls also propagate the option to/from the CRD-based operator configuration
* use `cluster_labels` for pod anti affinity * use `node_readiness_label` when defined * added property `enable_pod_antiaffinity` to operator config * added property `pod_antiaffinity_topology_key`
lgtm. thank you, @ocaner-biz |
Add pod anti affinity to enforce that postgres pods does not spawn on the same k8s node.