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

Rule ordering #6187

Closed
wants to merge 1 commit into from
Closed

Rule ordering #6187

wants to merge 1 commit into from

Conversation

artemvmin
Copy link
Contributor

@artemvmin artemvmin commented Oct 11, 2023

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Adds priority to drainability rules. This allows custom rules that return a lower priority outcome (e.g. DrainOk) to not get blocked by higher priority outcomes (e.g. SkipDrain).

Special notes for your reviewer:

Parent rebase: #6164

The one complication is that the legacy replica count check is now run after DrainOk rules (i.e. daemonset, safetoevict, and terminal). See drainability/rules.go and the now-combined replicated rule. If this is not okay, I have some alternatives:

  1. How far out are we from completely deprecating the legacy logic? Can we remove this logic?
  2. Temporarily add duplicate "legacy checks" to the DrainOk rules, so that they are skipped. This is the least ideal, but should be a reasonable last resort.

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Oct 11, 2023
@k8s-ci-robot k8s-ci-robot requested review from feiskyer and x13n October 11, 2023 00:15
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 11, 2023
@artemvmin
Copy link
Contributor Author

/assign x13n

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 11, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: artemvmin
Once this PR has been reviewed and has the lgtm label, please ask for approval from x13n. 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 k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 11, 2023
@x13n
Copy link
Member

x13n commented Oct 13, 2023

I'm not a fan of this approach. It implies rule ordering doesn't matter - only outcome priority does, which is not true (see #6077 for an example why).

Another issue is that it will be impossible to create custom rules blocking drain if there's an existing rule resulting in DrainOk/SkipDrain.

@artemvmin
Copy link
Contributor Author

artemvmin commented Oct 13, 2023

I'm not a fan of this approach. It implies rule ordering doesn't matter - only outcome priority does, which is not true (see #6077 for an example why).

Another issue is that it will be impossible to create custom rules blocking drain if there's an existing rule resulting in DrainOk/SkipDrain.

Agreed. Consider this alternate implementation, which makes the framework more flexible, not less: #6196

@x13n
Copy link
Member

x13n commented Oct 16, 2023

Thanks. Reviewed the other PR and closing this one.

/close

@k8s-ci-robot
Copy link
Contributor

@x13n: Closed this PR.

In response to this:

Thanks. Reviewed the other PR and closing this one.

/close

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/test-infra repository.

@artemvmin artemvmin deleted the rule-ordering branch October 16, 2023 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants