Skip to content

Conversation

atwamahmoud
Copy link
Contributor

@atwamahmoud atwamahmoud commented Sep 22, 2023

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:

Following up on PR #5659,

  • startup-taint flag is added and combined with ignore-taint flag so both will have the same effect
  • Prefix startup-taint.cluster-autoscaler.kubernetes.io/ is added to be similar to ignore-taint.cluster-autoscaler.kubernetes.io/ and behaves the same
  • status-taint flag is added and passed to autoscaling options
  • Prefix status-taint.cluster-autoscaler.kubernetes.io/ is added to ignore nodes with taints starting with it when scaling up.
  • Updates TaintConfig to have prefixes list instead of relying on constant hardcoded values

Updates ToBeDeletedByClusterAutoscaler & NodeNotReadyReason.IgnoreTaint might have side effects which affect third party providers which rely on these taints

Which issue(s) this PR fixes:

Allows status-taints to be specified by the users in addition to supporting taints with prefix status-taint.cluster-autoscaler.kubernetes.io/

Does this PR introduce a user-facing change?

2 new flags have been added
- `startup-taint` flag which is identical to `ignore-taint`
- `status-taint` flag which allows users to specify taints of nodes which should be ignored when scaling up (similar to `ignore-taint` behaviour but without treating such nodes as unready
In addition to these flags, 2 new prefixes are also supported which are
- Taints starting with `startup-taint.cluster-autoscaler.kubernetes.io/` will be treated as `status-taint` (identical to `ignore-taint.cluster-autoscaler.kubernetes.io/`)
- Taints starting with `status-taint.cluster-autoscaler.kubernetes.io/` will be treated as `startup-taint`

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 22, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 26, 2023
Copy link
Contributor

@BigDarkClown BigDarkClown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments and missing renaming of variables.

// FilterOutNodesWithIgnoredTaints override the condition status of the given nodes to mark them as NotReady when they have
// filtered taints.
func FilterOutNodesWithIgnoredTaints(ignoredTaints TaintKeySet, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node) {
func FilterOutNodesWithIgnoredTaints(taintConfig TaintConfig, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FilterOutNodesWithStartupTaints

Copy link
Contributor Author

@atwamahmoud atwamahmoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be alright now

@BigDarkClown
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 27, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: atwamahmoud, BigDarkClown

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

The pull request process is described 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 27, 2023
@k8s-ci-robot k8s-ci-robot merged commit 5d00f07 into kubernetes:master Sep 27, 2023
panicstevenson pushed a commit to airbnb/autoscaler that referenced this pull request Aug 24, 2024
…port

Adds support for startup taints and extends support for status taints
panicstevenson pushed a commit to airbnb/autoscaler that referenced this pull request Aug 24, 2024
…port

Adds support for startup taints and extends support for status taints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants