-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow configuring a NodeSelector in the Postgres kind #209
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
alexeyklyukin
left a comment
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.
The code at cluster.go:compareStatefulSetWith needs to be extended to replace the statefulset when the nodeSelector changes and to report the differences (in the logs). That should require a rolling upgrade, as old pods might have been scheduled to the wrong node according to the new nodeSelector.
| ClusterName string `json:"-"` | ||
| Databases map[string]string `json:"databases,omitempty"` | ||
| Tolerations []v1.Toleration `json:"tolerations,omitempty"` | ||
| NodeSelector map[string]string `json:"NodeSelector,omitempty"` |
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.
Please, use the camelCase for the parameter name
|
I think having per cluster node affinity is useful. Did you know this can be done for all postgresql cluster operator config key node_readiness_label: "px/enabled:true" |
|
Yes, this does sounds like a reasonable use case. But maybe our naming of the variable is confusing then or there should be a second one that is explicit for this. I also see this as a possible per cluster config option, in a way to add additional labels. |
|
@ksala I think what you are doing here can be indeed achieved with a Do you see any use case outside of choosing the ready/not-ready nodes that can be covered by setting node labels per-cluster? |
Given that, and also the fact that the |
This add support for adding the NodeSelector label to the Postgresql kind.
We use this in a GKE cluster which has two node pools, default and preemptible, to have the Postgres pods scheduled only on the normal nodes.