Skip to content

Make enable_pod_antiaffinity configurable #370

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

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

eberlep
Copy link
Collaborator

@eberlep eberlep commented May 18, 2022

For cases when it is unfavourable to have more than one pod of the same postgres cluster on the same worker node, the ability to enable pod anti affinity (which is already exists as a built-in feature of the postgres-operator) should be implemented. Once enabled, only one pod of the same postgres cluster will be scheduled on the same node at a time.

@eberlep eberlep linked an issue May 18, 2022 that may be closed by this pull request
@eberlep
Copy link
Collaborator Author

eberlep commented May 30, 2022

When enabling the setting in the postgreslet configmap, it is handed down to the operator itself:

 ~ $ k get cm postgres-operator -o jsonpath="{ .data.enable_pod_antiaffinity }"
true

Now when privisioning a 3-replica postgres cluster in a single kubernetes cluster, the scheuler (expectetly) refuses to start more than one pod:

 ~  $ k get po -o wide
NAME                                 READY   STATUS    RESTARTS   AGE     IP             NODE                                           NOMINATED NODE   READINESS GATES
pgfits-podantiaffinity3d002-0        3/3     Running   0          2m49s   10.244.0.208   shoot--abcdef--pgaas-dev-group-0-79985-t6zvn   <none>           <none>
pgfits-podantiaffinity3d002-1        0/3     Pending   0          2m43s   <none>         <none>                                         <none>           <none>
postgres-operator-7f5b947b89-fb6zd   1/1     Running   0          2m59s   10.244.0.206   shoot--abcdef--pgaas-dev-group-0-79985-t6zvn   <none>           <none>

@eberlep eberlep marked this pull request as ready for review May 30, 2022 12:52
@eberlep eberlep requested a review from majst01 May 30, 2022 12:56
@eberlep eberlep merged commit 364ed9a into main Jun 23, 2022
@eberlep eberlep deleted the 339-make-pod-anti-affinity-configurable branch July 15, 2022 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Pod Anti Affinity Configurable
1 participant