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

Graduate PodTopologySpread to Beta #88105

Merged
merged 1 commit into from Feb 17, 2020
Merged

Conversation

Huang-Wei
Copy link
Member

@Huang-Wei Huang-Wei commented Feb 13, 2020

What type of PR is this?

/kind feature
/sig scheduling

What this PR does / why we need it:

This PR includes the necessary change to enable featuregate EvenPodsSpread to be beta, by default. Additionally, e2e tests covering basic happy paths have been added.

  • Enable PodTopologySpread in kube_features.go
  • PreFilter & Filter
  • PreScore & Score
  • Preemption

Which issue(s) this PR fixes:

Fixes #88168

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

The feature PodTopologySpread (featuregate `EvenPodsSpread`) has been enabled by default in 1.18.

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

 - [KEP]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-scheduling/20190221-pod-topology-spread.md

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Feb 13, 2020
@Huang-Wei Huang-Wei force-pushed the pts-e2e branch 4 times, most recently from 037c364 to 3c460a8 Compare February 14, 2020 07:05
@Huang-Wei Huang-Wei changed the title [WIP] E2E tests for PodTopologySpread E2E tests for PodTopologySpread Feb 14, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 14, 2020
@Huang-Wei
Copy link
Member Author

Ready for review.

/cc @ahg-g @alculquicondor

@alculquicondor
Copy link
Member

I didn't review yet, but this should have a release note.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Feb 14, 2020
// force it to update
nodeCopy.ResourceVersion = "0"
ginkgo.By(fmt.Sprintf("Apply 10 fake resource to node %v.", node.Name))
nodeCopy.Status.Capacity[fakeRes] = resource.MustParse("10")
Copy link
Member

Choose a reason for hiding this comment

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

is this reliable? will kubelet erase this since no such resource actually exist?

Copy link
Member Author

@Huang-Wei Huang-Wei Feb 14, 2020

Choose a reason for hiding this comment

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

will kubelet erase this since no such resource actually exist?

For extended resources, no. We used to exercise this pattern for another test here:

var _ = SIGDescribe("PreemptionExecutionPath", func() {

test/e2e/scheduling/preemption.go Outdated Show resolved Hide resolved
Copy link
Member

@ahg-g ahg-g left a comment

Choose a reason for hiding this comment

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

Since we are still not GA, I propose we up the weight of the PodTopologySpread score plugin. PodTopologySpread expresses explicit user intent that I think should have higher weight than scoring generic functions (like NodeResources or ImageLocality).

}

// Make the nodes have balanced cpu,mem usage.
err := createBalancedPodForNodes(f, cs, ns, nodes, podRequestedResource, 0.5)
Copy link
Member

@ahg-g ahg-g Feb 14, 2020

Choose a reason for hiding this comment

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

I know we need this so that the "node resource" plugin doesn't influence the score, but this is going to cause flakes because a pod created by a previous test may get deleted after this function is called, and so breaking the "balanced" assumption. I don't have a better suggestion how to fix this though.

Giving PodTopologySpread a higher priority should make this less important.

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly like what I mentioned in #88174 (comment). And this is why I hesitated to add this score test in e2e - you can't adjust the default weight (which is 1) for a given e2e env.

@ahg-g
Copy link
Member

ahg-g commented Feb 16, 2020

Please update the issue title, something like: "Graduate PodTopologySpread to Beta".

Otherwise looks good to me, let's get the features files approved.

@Huang-Wei Huang-Wei changed the title E2E tests for PodTopologySpread Graduate PodTopologySpread to Beta Feb 16, 2020
@Huang-Wei
Copy link
Member Author

@ahg-g Title updated.

You might be able to have the privilege to approve the feature files, due to #88128.

@ahg-g
Copy link
Member

ahg-g commented Feb 16, 2020

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, Huang-Wei

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 Feb 16, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 48def7e into kubernetes:master Feb 17, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Feb 17, 2020
@Huang-Wei Huang-Wei deleted the pts-e2e branch February 17, 2020 18:16
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/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. 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. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

Enable PodTopologySpread in kube_features.go and add e2e tests
5 participants