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

scheduler CC: add v1beta2 API, deprecate plugins #99597

Merged
merged 1 commit into from
Jun 8, 2021

Conversation

adtac
Copy link
Member

@adtac adtac commented Mar 1, 2021

What type of PR is this?

/kind api-change

What this PR does / why we need it:

Adds scheduler config v1beta2 API. This PR builds on top of #95308.

xref: #95446 - things completed in this PR:

Which issue(s) this PR fixes:

Related to #94008

Special notes for your reviewer:

Commits in @hprateek43's PR are preserved as-is. See everything after the 3rd commit for the changes I've made on top.

Does this PR introduce a user-facing change?

kube-scheduler component config v1beta2 API available
Three scheduler plugins deprecated (NodeLabel, ServiceAffinity, NodePreferAvoidPods)

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


cc @hprateek43 @alculquicondor @ahg-g @liggitt

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 1, 2021
Copy link
Member Author

@adtac adtac left a comment

Choose a reason for hiding this comment

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

Just to double-check, I did a diff of all files in v1beta1 and v1beta2 and here's a list of all differences minus v1beta1/v1beta2 differences: http://ix.io/2RjG/diff

pkg/scheduler/apis/config/v1beta2/defaults.go Outdated Show resolved Hide resolved
@adtac
Copy link
Member Author

adtac commented Mar 1, 2021

/sig scheduling

@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Mar 1, 2021
Copy link
Member

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

Looking good. Could you start a PR for #94008 already?

cmd/kube-scheduler/app/options/options_test.go Outdated Show resolved Hide resolved
cmd/kube-scheduler/app/options/options_test.go Outdated Show resolved Hide resolved
pkg/scheduler/apis/config/v1beta2/conversion.go Outdated Show resolved Hide resolved
pkg/scheduler/apis/config/v1beta2/defaults.go Outdated Show resolved Hide resolved
pkg/scheduler/apis/config/v1beta2/defaults.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 1, 2021
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Mar 2, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 2, 2021
@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@adtac
Copy link
Member Author

adtac commented Mar 10, 2021

I've squashed some commits and added a new commit. The second commit in this PR adds the infrastructure to deprecate plugins in CC; in v1beta2, we want to deprecate NodeLabel and ServiceAffinity. The second commit was a bit tricky from a API point-of-view, so please lmk if I'm doing something wrong. cc @alculquicondor and @ahg-g for the scheduler re the 2nd commit.

@adtac
Copy link
Member Author

adtac commented Mar 10, 2021

I know we're past the 1.21 code freeze, so we'll be targetting v1beta2 in 1.22 (with possibly more changes than there are in this PR)

@adtac adtac changed the title kube-scheduler config: add v1beta2 API scheduler CC: add v1beta2 API, deprecate plugins Mar 10, 2021
@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Mar 10, 2021
@liggitt
Copy link
Member

liggitt commented Mar 10, 2021

I know we're past the 1.21 code freeze, so we'll be targetting v1beta2 in 1.22 (with possibly more changes than there are in this PR)

sounds good

/milestone v1.22

@k8s-ci-robot k8s-ci-robot modified the milestones: v1.21, v1.22 Mar 10, 2021
Copy link
Member

@msau42 msau42 left a comment

Choose a reason for hiding this comment

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

latest api changes lgtm

// because the field will be cleared later by API machinery during
// conversion. To work around that, we set the API version field of the
// internal object here to the default version (latest). We need this for
// later when we need to make decisions based on the external version.
Copy link
Member

Choose a reason for hiding this comment

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

IIUC, we set this in two places:

  • When generating the default options
  • After loading config from file

And the places we're using this field after setting it is:

  • validateKubeSchedulerProfile
  • LogOrWriteConfig
  • scheduler.New

All other places should be getting the version from frameworkOptions.componentConfigVersion right?

Can we add this information as a comment in the internal types.go?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is correct. I've added a comment in the internal KubeSchedulerConfiguration type definition.

// conversion. To work around that, we set the API version field of the
// internal object here to the version we read from file. We need this for
// later when we need to make decisions based on the external version.
cfgObj.TypeMeta.APIVersion = gvk.GroupVersion().String()
Copy link
Member

Choose a reason for hiding this comment

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

do you have a pointer to the decisions made based on this field? it's pretty strange for the external version source to change the interpretation of the converted internal config

Copy link
Member

Choose a reason for hiding this comment

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

if the only decision made is a pass/fail validation decision, that would be helpful to clarify here. we explicitly don't want the internal configuration getting interpreted differently based on version

Copy link
Member

Choose a reason for hiding this comment

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

There are two places, the validation and the plugin config defaulting logic inside the framework. The former will continue to exist, the latter will be removed as a followup to this PR (#102211).

Copy link
Member Author

Choose a reason for hiding this comment

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

*three places. We also use this in --write-config-to. I've added a comment in the internal KubeSchedulerConfiguration with references to exactly what places use this field.

gvk = v1beta1.SchemeGroupVersion.WithKind(name + "Args")
case v1beta2.SchemeGroupVersion.String():
gvk = v1beta2.SchemeGroupVersion.WithKind(name + "Args")
default:
Copy link
Member

@liggitt liggitt Jun 4, 2021

Choose a reason for hiding this comment

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

should we default to this even if componentConfigVersion is non-empty and is an unknown version, or only if it is ""?

Copy link
Member

@ahg-g ahg-g Jun 4, 2021

Choose a reason for hiding this comment

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

The original code was doing it regardless of componentConfigVersion, I think this is fine as is. In any case, this defaulting logic will be removed in a followup PR as part of #102211

pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
@liggitt
Copy link
Member

liggitt commented Jun 4, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adtac, alculquicondor, liggitt

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 Jun 4, 2021
@ahg-g
Copy link
Member

ahg-g commented Jun 4, 2021

/hold

pls squash :)

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 4, 2021
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
@ahg-g
Copy link
Member

ahg-g commented Jun 8, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 8, 2021
@ahg-g
Copy link
Member

ahg-g commented Jun 8, 2021

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 8, 2021
@adtac
Copy link
Member Author

adtac commented Jun 8, 2021

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Status: API review completed, 1.22
Development

Successfully merging this pull request may close these issues.

None yet

7 participants