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

[Experimental] Implemented Hostname AntiAffinity #1221

Closed
wants to merge 2 commits into from

Conversation

ellistarn
Copy link
Contributor

@ellistarn ellistarn commented Jan 25, 2022

1. Issue, if available:
#942

2. Description of changes:
Implements hostname antiaffinity by translating these rules into topology rules.

Requested feedback:

  • Are the limitations going to work for users? Do we need a fully fledged implementation?
  • Am I missing edge cases where my assumptions don't hold?
  • Is anyone able to build this from HEAD and test it out?

3. How was this change tested?

4. Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: link to issue
  • No

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@netlify
Copy link

netlify bot commented Jan 25, 2022

✔️ 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

@ellistarn ellistarn changed the title Experimental Implementation for Hostname AntiAffinity [Experimental] Implemented Hostname AntiAffinity Jan 25, 2022
return errs
}

// Transform pod anti affinity into topology rules
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@felix-zhe-huang felix-zhe-huang left a 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.

@ellistarn ellistarn closed this Feb 21, 2022
@ellistarn ellistarn deleted the affinity branch August 23, 2022 23:16
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.

3 participants