-
Notifications
You must be signed in to change notification settings - Fork 986
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
[Experimental] Implemented Hostname AntiAffinity #1221
Conversation
✔️ Deploy Preview for karpenter-docs-prod canceled. 🔨 Explore the source changes: d59991e 🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/61f1a750e9192a0007563326 |
return errs | ||
} | ||
|
||
// Transform pod anti affinity into topology rules |
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.
Oh this is interesting. Is this how this works under the hood in K8s as well or a new approach that gets us there quicker in Karpenter?
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.
This is absolutely not how it works under the hood. It's a bit of a hack that takes advantage of simplifying antiaffinity enough until it's translatable to topology.
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.
From https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ I saw this.
"Note: Pod anti-affinity requires nodes to be consistently labelled, in other words every node in the cluster must have an appropriate label matching topologyKey. If some or all nodes are missing the specified topologyKey label, it can lead to unintended behavior."
So it seems that we also need to create a mechanism to label the existing nodes with the topologKey in order for this to work.
1. Issue, if available:
#942
2. Description of changes:
Implements hostname antiaffinity by translating these rules into topology rules.
Requested feedback:
3. How was this change tested?
4. Does this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.