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

Validate cgroups-per-qos for Windows #62984

Merged
merged 1 commit into from
May 26, 2018

Conversation

feiskyer
Copy link
Member

What this PR does / why we need it:

cgroups-per-qos and enforce-node-allocatable is not supported on Windows, but kubelet allows it on Windows. And then Pods may stuck in terminating state because of it. Refer #61716.

This PR adds validation for them and make kubelet refusing to start in this case.

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

Special notes for your reviewer:

Release note:

Fail fast if cgroups-per-qos is set on Windows

@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 Apr 23, 2018
@k8s-ci-robot k8s-ci-robot requested a review from tmrts April 23, 2018 05:52
@feiskyer
Copy link
Member Author

/sig windows
/sig node

@k8s-ci-robot k8s-ci-robot added sig/windows Categorizes an issue or PR as relevant to SIG Windows. sig/node Categorizes an issue or PR as relevant to SIG Node. labels Apr 23, 2018
// +build !windows

/*
Copyright 2017 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

s/2017/2018

// +build windows

/*
Copyright 2017 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

s/2017/2018

allErrors := []error{}

if kc.CgroupsPerQOS {
allErrors = append(allErrors, fmt.Errorf("invalid configuration: CgroupsPerQOS (--cgroups-per-qos) %v is not supported on Windows", kc.CgroupsPerQOS))
Copy link
Member

Choose a reason for hiding this comment

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

Have a common formatted string for these two checking? Like

formatStr := "invalid configuration: %s %v is not supported on Windows"

Copy link
Member Author

Choose a reason for hiding this comment

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

ACK

@dixudx
Copy link
Member

dixudx commented Apr 24, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2018
@feiskyer
Copy link
Member Author

/retest

@feiskyer
Copy link
Member Author

/retest

ping @Random-Liu @dchen1107

1 similar comment
@feiskyer
Copy link
Member Author

feiskyer commented May 8, 2018

/retest

ping @Random-Liu @dchen1107

@feiskyer
Copy link
Member Author

/retest

@feiskyer
Copy link
Member Author

ping @Random-Liu @yujuhong

@yujuhong
Copy link
Contributor

Looks good but would like @mtaufen to take a look.

/assign @mtaufen

@feiskyer
Copy link
Member Author

/retest

@feiskyer
Copy link
Member Author

/retest

ping @mtaufen

@feiskyer
Copy link
Member Author

/retest

)

// ValidatePlatformConfiguration validates platform specific configuration and returns an error if it is invalid.
func ValidatePlatformConfiguration(kc *kubeletconfig.KubeletConfiguration) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably put KubeletConfiguration somewhere in the name of this function, to keep with the naming scheme of ValidateKubeletConfiguration.

Since it's included in ValidateKubeletConfiguration, it can probably be private as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

We use OS instead of Platform in other contexts (see osflags_windows.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.

ACK

Copy link
Member Author

Choose a reason for hiding this comment

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

@mtaufen Renamed to validateKubeletOSConfiguration. PTAL

@mtaufen
Copy link
Contributor

mtaufen commented May 23, 2018

couple nits otherwise looks good

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 23, 2018
@feiskyer
Copy link
Member Author

/retest

@feiskyer
Copy link
Member Author

/retest

@mtaufen Renamed to validateKubeletOSConfiguration. PTAL

@feiskyer
Copy link
Member Author

/retest

@mtaufen
Copy link
Contributor

mtaufen commented May 25, 2018

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dixudx, feiskyer, mtaufen

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 May 25, 2018
@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 comment for consistent failures.

1 similar comment
@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 comment for consistent failures.

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented May 26, 2018

@feiskyer: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce-device-plugin-gpu 40abe94 link /test pull-kubernetes-e2e-gce-device-plugin-gpu

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@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.

@k8s-github-robot k8s-github-robot merged commit 2cb7ab0 into kubernetes:master May 26, 2018
@feiskyer feiskyer deleted the klet-validation branch May 27, 2018 00:00
@feiskyer feiskyer restored the klet-validation branch July 20, 2018 06:59
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. 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/node Categorizes an issue or PR as relevant to SIG Node. sig/windows Categorizes an issue or PR as relevant to SIG Windows. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pods stuck in terminating state on Windows nodes
8 participants