Skip to content
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

DNM - POC: Expose Affinity and let the service operators override the default policy #582

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fmount
Copy link
Contributor

@fmount fmount commented Nov 19, 2024

No description provided.

This patch introduces a first, basic implementation that allows to
expose the Pod Affinity/Antiaffinity interface as part of the CR
spec and allows to override it.

Signed-off-by: Francesco Pantano <[email protected]>
@fmount fmount requested review from stuggi and olliewalsh November 19, 2024 13:40
@fmount fmount force-pushed the affinity-1 branch 2 times, most recently from d38e076 to 4bf6fe5 Compare November 19, 2024 14:14
@fmount fmount force-pushed the affinity-1 branch 6 times, most recently from 4171d5e to 92d5e02 Compare November 21, 2024 12:10
This patch introduces some more wrapping around corev1.PodAffinitySpec
to simplify what is exposed in the service operators. In particular,
it is possible to consume the AffinityOverrides struct that can
implement either affinity or antiaffinity rules. They uses the same
structs behind the scenes (PodAffinityTerm and WeightedPodAffinityTerm),
for both RequiredDuringSchedulingIgnoredDuringExecution and
PreferredDuringSchedulingIgnoredDuringExecution, but they have a
different semantic when included in the corev1.Affinity k8s object.
The old behavior of distributing Pods is currently preserved for
operators where we do not want to provide this interface.

Signed-off-by: Francesco Pantano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant