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

kubeadm should ignore cgroup driver check on Windows node #97764

Merged
merged 1 commit into from Jan 20, 2021

Conversation

pacoxu
Copy link
Member

@pacoxu pacoxu commented Jan 6, 2021

What type of PR is this?
/kind bug
/sig windows
/sig cluster-lifecycle
/area kubeadm

What this PR does / why we need it:

kubeadm doesn't do anything about cgroup drivers on Windows because cgroups don't exist on Windows.
ideally the kubelet checks about this should be skipped entirely in dockershim for non-Linux.

Which issue(s) this PR fixes:

Fixes #97759

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. sig/windows Categorizes an issue or PR as relevant to SIG Windows. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. labels Jan 6, 2021
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

/remove-area kubeadm
/remove-sig cluster-lifecycle

@k8s-ci-robot k8s-ci-robot removed area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. labels Jan 6, 2021
@neolit123
Copy link
Member

i think it should be:

if runtime.GOOS == "linux" {
	// NOTE: cgroup driver is only detectable in docker 1.11+
	cgroupDriver := defaultCgroupDriver
	dockerInfo, err := ds.client.Info()
	klog.Infof("Docker Info: %+v", dockerInfo)
	if err != nil {
		klog.Errorf("Failed to execute Info() call to the Docker client: %v", err)
		klog.Warningf("Falling back to use the default driver: %q", cgroupDriver)
	} else if len(dockerInfo.CgroupDriver) == 0 {
		klog.Warningf("No cgroup driver is set in Docker")
		klog.Warningf("Falling back to use the default driver: %q", cgroupDriver)
	} else {
		cgroupDriver = dockerInfo.CgroupDriver
	}
	if len(kubeCgroupDriver) != 0 && kubeCgroupDriver != cgroupDriver {
		return nil, fmt.Errorf("misconfiguration: kubelet cgroup driver: %q is different from docker cgroup driver: %q", kubeCgroupDriver, cgroupDriver)
	}
	klog.Infof("Setting cgroupDriver to %s", cgroupDriver)
	ds.cgroupDriver = cgroupDriver
}

if dockershim complains about an empty ds.cgroupDriver on Windows it should be fixed too.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 6, 2021
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

this looks right to me. SIG Node owners can approve.
/lgtm

@pacoxu
Copy link
Member Author

pacoxu commented Jan 6, 2021

@neolit123 updated.

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

@kubernetes/sig-windows-bugs

Copy link
Contributor

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

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

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 6, 2021
@ehashman ehashman added this to Needs Approver in SIG Node PR Triage Jan 6, 2021
@pacoxu
Copy link
Member Author

pacoxu commented Jan 7, 2021

/triage accepted

@ehashman
Copy link
Member

ping @derekwaynecarr @ehashman for approval

I cannot approve but I'll move it on the board 😄

@pacoxu
Copy link
Member Author

pacoxu commented Jan 14, 2021

thanks @ehashman

@marosset marosset added this to In Review (v1.21) in SIG-Windows Jan 14, 2021
@marosset
Copy link
Contributor

@derekwaynecarr @mrunalp Can one of you take a look for sig-node approval? Thanks!

@marosset marosset moved this from In Review (v1.21) to Reviewed - Needs Approval in SIG-Windows Jan 14, 2021
@mrunalp
Copy link
Contributor

mrunalp commented Jan 20, 2021

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jayunit100, mrunalp, pacoxu

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 Jan 20, 2021
@k8s-ci-robot k8s-ci-robot merged commit cff7d7b into kubernetes:master Jan 20, 2021
SIG-Windows automation moved this from Reviewed - Needs Approval From Other SIGs to Done (v1.21) Jan 20, 2021
SIG Node PR Triage automation moved this from Needs Approver to Done Jan 20, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Jan 20, 2021
@neolit123
Copy link
Member

neolit123 commented Jan 25, 2021

we need to backport this to the support skew:
.18, .19, .20

the kubeadm e2e test jobs for Windows are failing because of it:
kubernetes-sigs/sig-windows-tools#138

@pacoxu would you be able to send the cherry picks?

@pacoxu
Copy link
Member Author

pacoxu commented Jan 25, 2021

@neolit123 OK, I will send the cherry picks.

@neolit123
Copy link
Member

thanks!

@neolit123
Copy link
Member

@pacoxu please change the release note to have "kubelet" instead of "kubeadm" (as the change is in the kubelet).
this applies to the cherry pick PRs too.

@pacoxu
Copy link
Member Author

pacoxu commented Jan 26, 2021

@neolit123 all are updated now. 🤝

k8s-ci-robot added a commit that referenced this pull request Jan 26, 2021
…-upstream-release-1.20

Automated cherry pick of #97764 upstream release 1.20: ignore cgroup driver check in windows node upgrade
k8s-ci-robot added a commit that referenced this pull request Jan 26, 2021
…-upstream-release-1.18

Automated cherry pick of #97764 upstream release 1.18: ignore cgroup driver check in windows node upgrade
k8s-ci-robot added a commit that referenced this pull request Jan 27, 2021
…-upstream-release-1.19

Automated cherry pick of #97764 upstream release 1.19: ignore cgroup driver check in windows node upgrade
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 29, 2021
@pacoxu pacoxu deleted the fix/windows-cgroup branch June 23, 2021 05:34
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/kubelet 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/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. 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. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Development

Successfully merging this pull request may close these issues.

kubelet: don't check for the Docker cgroup driver on Windows
9 participants