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

kubernetes.io/hostname label not working in NodeAffinity for Aerospike Kubernetes Operator #6844

Closed
abhishekdwivedi3060 opened this issue Aug 22, 2024 · 2 comments

Comments

@abhishekdwivedi3060
Copy link

abhishekdwivedi3060 commented Aug 22, 2024

Similar issue in Karpenter: #4671
Related issue in Aerospike: aerospike/aerospike-kubernetes-operator#305

Use-case: There is a feature in Aerospike Kubernetes Operator (AKO) called k8sNodeBlockList (list of K8s node names) where a user can define a list of K8s nodes that should be ignored from scheduling for Aerospike Cluster pods. This feature of AKO helps users in K8s cluster maintenance by migrating pods to other K8s nodes. It uses kubernetes.io/hostname label along with NotIn operator in the NodeAffinity to move pods away from those nodes.

        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: kubernetes.io/hostname
                  operator: NotIn
                  values:
                  - gke-abhisek-test-default-pool-d04arw3-r5ts

Issue: Karpenter has a sweeping check where it blocks the kubernetes.io/hostname in NodeAffinity. Ref code: https://github.com/kubernetes-sigs/karpenter/blob/d5660acf4472db796d5f4fac58a147d14b320451/pkg/apis/v1beta1/labels.go#L90
As a result if there are pending pods with kubernetes.io/hostname NodeAffinity, they remain in pending state as Karpenter doesn't scale K8s node.

Questions:

  1. Is there a plan to remove that sweeping check for kubernetes.io/hostname label?
  2. Is it possible to only block In operator and allow NotIn operator for kubernetes.io/hostname label?
  3. Is there a work-around possible to bypass that check?
@jmdeal
Copy link
Contributor

jmdeal commented Aug 22, 2024

Could you reopen this issue in kubernetes-sigs/karpenter?

@jmdeal
Copy link
Contributor

jmdeal commented Aug 26, 2024

Closing to track upstream.

@jmdeal jmdeal closed this as completed Aug 26, 2024
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

No branches or pull requests

2 participants