karpenter icon indicating copy to clipboard operation
karpenter copied to clipboard

fix: allow restricted labels in pod affinity/nodeSelector

Open jwcesign opened this issue 1 year ago • 7 comments

Fixes #1596

Description

In general, we should not filter out the pending pods that could trigger the node scaling out by label key. If the pods can't be scheduled, it will be ignored in the scheduling simulation process: https://github.com/kubernetes-sigs/karpenter/blob/75fcd2abcae13b7677a2c4d9ee2799662b2e9445/pkg/controllers/provisioning/scheduling/scheduler.go#L197

So, let's remove the limitations of the restricted label. Also, I checked the git blame, the related PR is: https://github.com/aws/karpenter-provider-aws/pull/2051

This PR, only tries to solve: Implemented support for GT and LT requirement operators in pods It doesn't want to limit label key kubernetes.io/hostname, so let's cancel the limitations.

How was this change tested?

make e2etests

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

jwcesign avatar Aug 29 '24 12:08 jwcesign

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jwcesign Once this PR has been reviewed and has the lgtm label, please assign ellistarn for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Aug 29 '24 12:08 k8s-ci-robot

Hi @jwcesign. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Aug 29 '24 12:08 k8s-ci-robot

Pull Request Test Coverage Report for Build 10615581376

Details

  • 16 of 16 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 80.716%

Totals Coverage Status
Change from base Build 10606693127: 0.1%
Covered Lines: 8346
Relevant Lines: 10340

💛 - Coveralls

coveralls avatar Aug 29 '24 13:08 coveralls

Please take a look: cc @ellistarn @jonathan-innis @tzneal @bwagner5 @njtran

jwcesign avatar Aug 29 '24 16:08 jwcesign

In the PR description, consider explaining why these changes are the right way to fix it.

sftim avatar Sep 04 '24 10:09 sftim

In the PR description, consider explaining why these changes are the right way to fix it.

Thanks, I added

jwcesign avatar Sep 04 '24 13:09 jwcesign

This PR has been inactive for 14 days. StaleBot will close this stale PR after 14 more days of inactivity.

github-actions[bot] avatar Oct 03 '24 12:10 github-actions[bot]