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

Pod Antiaffinity Feature #1481

Closed
amitdrana opened this issue Mar 8, 2022 · 2 comments
Closed

Pod Antiaffinity Feature #1481

amitdrana opened this issue Mar 8, 2022 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@amitdrana
Copy link

amitdrana commented Mar 8, 2022

Hi Team,
IS Karpenter supports the Pod anti-affinity feature as we are using it for our application deployment.
also, we are using nodeAffinity with the following match expression.
Not able to set node.kubernetes.io/role label on the pod. any other way I can use this?

 nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node.kubernetes.io/role
                operator: In
                values:
                - ToolsOnDemand
@amitdrana amitdrana added the feature New feature or request label Mar 8, 2022
@tzneal
Copy link
Contributor

tzneal commented Mar 8, 2022

Support for pod affinity and anti-affinity is being tracked at #942 .

You can have Karpenter apply a label to nodes that it creates, but it can't be in the node.kuberntes.io domain. If you modify your provisioner to include labels:

  labels:
    my/role: ToolsOnDemand

and change the nodeAffinity on your pod to select it, it will create nodes with that label and allow your pods to schedule.

@tzneal tzneal self-assigned this Mar 8, 2022
@suket22
Copy link
Contributor

suket22 commented Mar 11, 2022

I'll close this issue since it's a duplicate. Let us know if there's anything else we can help with.

@suket22 suket22 closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants