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

Added unschedulable and network-unavailable toleration. #64954

Merged
merged 1 commit into from
Sep 10, 2018

Conversation

k82cn
Copy link
Member

@k82cn k82cn commented Jun 11, 2018

Signed-off-by: Da K. Ma klaus1982.cn@gmail.com

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
part of #61312
fixes: #67606

Release note:

If `TaintNodesByCondition` is enabled, add `node.kubernetes.io/unschedulable` and `node.kubernetes.io/network-unavailable` automatically to DaemonSet pods.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 11, 2018
@k82cn
Copy link
Member Author

k82cn commented Jun 11, 2018

/sig apps

@k8s-ci-robot k8s-ci-robot added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label Jun 11, 2018
@k82cn
Copy link
Member Author

k82cn commented Jun 11, 2018

In #61312, TaintNodeNetworkUnavailable should be added by user when TaintNodesByCondition enabled. For DaemonSet controller, this PR add it automatically to keep the behviour consistent.

@k82cn
Copy link
Member Author

k82cn commented Jun 12, 2018

/assign @janetkuo
/unassign @kow3ns

@k8s-ci-robot k8s-ci-robot assigned janetkuo and unassigned kow3ns Jun 12, 2018
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2018
@k82cn k82cn force-pushed the k8s_61312_2 branch 2 times, most recently from b5938f9 to f4be9e7 Compare June 24, 2018 02:47
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 24, 2018
@k82cn
Copy link
Member Author

k82cn commented Jun 24, 2018

/retest

Copy link
Member

@bsalamat bsalamat left a comment

Choose a reason for hiding this comment

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

Could you please add a test to ensure that the tolerations are added properly?

@k82cn
Copy link
Member Author

k82cn commented Jun 28, 2018

Could you please add a test to ensure that the tolerations are added properly?

Sure :)

@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 Jul 17, 2018
@k82cn
Copy link
Member Author

k82cn commented Jul 23, 2018

/retest

@k82cn
Copy link
Member Author

k82cn commented Jul 23, 2018

Added integration test, PTAL :)

@k82cn
Copy link
Member Author

k82cn commented Jul 24, 2018

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2018
})
}
isCritical := utilfeature.DefaultFeatureGate.Enabled(features.ExperimentalCriticalPodAnnotation) &&
kubelettypes.IsCriticalPod(newPod)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be just kubelettypes.IsCriticalPod(newPod)?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes !

node := newNode("unschedulable-node", nil)
node.Spec.Unschedulable = true
// If ScheduleDaemonSetPods enabled, simulate TaintsNodeByCondition to avoid
// race condition.
Copy link
Member

Choose a reason for hiding this comment

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

Remove "avoid race condition" because we just simulate to avoid the need to start nodelifecycle controller.

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

}

// If ScheduleDaemonSetPods enabled, simulate TaintsNodeByCondition to avoid
// race condition.
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

enabled := utilfeature.DefaultFeatureGate.Enabled(features.ExperimentalCriticalPodAnnotation)
defer func() {
utilfeature.DefaultFeatureGate.Set(fmt.Sprintf("%s=%t",
features.ExperimentalCriticalPodAnnotation, enabled))
Copy link
Member

Choose a reason for hiding this comment

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

Check error

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, sorry for the miss; and done :)

Copy link
Member Author

Choose a reason for hiding this comment

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

also go through the whole file and updated :)

Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
@Huang-Wei
Copy link
Member

/retest

1 similar comment
@Huang-Wei
Copy link
Member

/retest

@janetkuo
Copy link
Member

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bsalamat, janetkuo, k82cn, mikedanese, ravisantoshgudimetla

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-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k82cn
Copy link
Member Author

k82cn commented Sep 10, 2018

/sig scheduling

@k8s-ci-robot k8s-ci-robot added the sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. label Sep 10, 2018
@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

@k8s-github-robot k8s-github-robot merged commit 323e137 into kubernetes:master Sep 10, 2018
@k82cn k82cn deleted the k8s_61312_2 branch September 10, 2018 02:47
@tpepper
Copy link
Member

tpepper commented Sep 10, 2018

This PR appears to have caused a conformance regression:
a4df698...323e137
https://k8s-testgrid.appspot.com/sig-release-master-blocking#Conformance%20-%20GCE

@k82cn
Copy link
Member Author

k82cn commented Sep 10, 2018

:( i will check it

@k82cn
Copy link
Member Author

k82cn commented Sep 12, 2018

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. 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.

Failing test: broad scheduling issues due to TaintNodesByCondition