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

Delegate cgroup exists to systemd and libcontainer #102250

Closed
wants to merge 1 commit into from

Conversation

odinuge
Copy link
Member

@odinuge odinuge commented May 24, 2021

What type of PR is this?

/kind bug
/kind failing-test

What this PR does / why we need it:

When systemd cgroup driver is used, systemd is responsible for ensuring
the correct controllers are propagated. If we try to propagate a
controller controlled by systemd, it can remove it for us, creating a
mess.

This fixes issues when burstable.slice exists, but systemd removes the cpuset controller since it isn't in use. In this case, trying to recreate the slice will cause a fatal error in kubelet.

Which issue(s) this PR fixes:

Fixes #

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


When systemd cgroup driver is used, systemd is responsible for ensuring
the correct controllers are propagated. If we try to propagate a
controller controlled by systemd, it can remove it for us, creating a
mess.
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. 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. labels May 24, 2021
@odinuge
Copy link
Member Author

odinuge commented May 24, 2021

/test pull-kubernetes-node-kubelet-serial-crio-cgroupv2

@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 24, 2021
@odinuge
Copy link
Member Author

odinuge commented May 24, 2021

/test pull-kubernetes-node-kubelet-serial-crio-cgroupv1

@odinuge
Copy link
Member Author

odinuge commented May 24, 2021

Still WIP and testing, but;

/cc @harche

@k8s-ci-robot k8s-ci-robot requested a review from harche May 24, 2021 12:22
@k8s-ci-robot k8s-ci-robot added area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels May 24, 2021
@odinuge
Copy link
Member Author

odinuge commented May 24, 2021

/test pull-kubernetes-node-kubelet-serial-crio-cgroupv1
/test pull-kubernetes-node-kubelet-serial-crio-cgroupv2

1 similar comment
@odinuge
Copy link
Member Author

odinuge commented May 24, 2021

/test pull-kubernetes-node-kubelet-serial-crio-cgroupv1
/test pull-kubernetes-node-kubelet-serial-crio-cgroupv2

@ehashman ehashman added this to Waiting on Author in SIG Node PR Triage May 24, 2021
@kolyshkin
Copy link
Contributor

By the way, since opencontainers/runc@9087f2e all runc/libcontainer's cgroup controllers have Exists() method which might be used here. The difference though is the libcontainer Exists do not check the presence of all the controllers, assuming that if Apply() was called, they all either do or do not exist.

If it is possible to relax the "exists" check in here, this might result in removing a lot of code :)

@kolyshkin
Copy link
Contributor

I would also audit all the uses of Exists (there are 6, excluding tests) and maybe drop some of them.

Say, calling Exists before Create does not make much sense as Create is relatively fast and (AFAICS) repeated Create is won't break anything, while Exists (before this PR at least) is somewhat heavy.

Calling Exists before Update does not make much sense either -- if cgroup does not exists, Update will return an error anyway.

@odinuge
Copy link
Member Author

odinuge commented May 25, 2021

By the way, since opencontainers/runc@9087f2e all runc/libcontainer's cgroup controllers have Exists() method which might be used here. The difference though is the libcontainer Exists do not check the presence of all the controllers, assuming that if Apply() was called, they all either do or do not exist.

Ahh, I see. I just saw this issues opencontainers/runc#1440 and thought it wasn't fixed.

Say, calling Exists before Create does not make much sense as Create is relatively fast and (AFAICS) repeated Create is won't break anything, while Exists (before this PR at least) is somewhat heavy.

Well, it kinda depends. Calling create in case the systemd slice/scope already exists results in an error that is fatal to kubelet. This is essentially whan happen in case of a kubelet restart. In case of cgroupfs we could probably just use Create anyways, since that will ensure all controllers are enabled.

Calling Exists before Update does not make much sense either -- if cgroup does not exists, Update will return an error anyway.

Well, yeah. If we want to create it, we would of course need to verify if we should run create or update.

@odinuge
Copy link
Member Author

odinuge commented May 25, 2021

/test pull-kubernetes-node-kubelet-serial-crio-cgroupv1
/test pull-kubernetes-node-kubelet-serial-crio-cgroupv2

@dims
Copy link
Member

dims commented Jul 14, 2021

/milestone v1.22

/assign @mrunalp @Random-Liu

@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jul 14, 2021
@odinuge
Copy link
Member Author

odinuge commented Jul 14, 2021

Test failures are btw. because those test suites have a huuuge amount of failing tests (that we are still working on). This one helps a bit on the overall health.

/skip

@liggitt liggitt removed their request for review July 15, 2021 19:45
@ehashman
Copy link
Member

/test pull-kubernetes-node-kubelet-serial-crio-cgroupv2
/test pull-kubernetes-node-kubelet-serial-crio-cgroupv1

@k8s-ci-robot
Copy link
Contributor

@odinuge: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
pull-kubernetes-node-kubelet-serial-crio-cgroupv2 d4c3d55 link /test pull-kubernetes-node-kubelet-serial-crio-cgroupv2
pull-kubernetes-node-kubelet-serial-crio-cgroupv1 d4c3d55 link /test pull-kubernetes-node-kubelet-serial-crio-cgroupv1

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.

@voigt
Copy link

voigt commented Jul 20, 2021

Hi (@bobbypage, @yujuhong, @harche, @dims)
Bug-Triage here:
we are already past code freeze, so I suggest moving this PR to milestone v1.23. WDYT?

@georgyo
Copy link

georgyo commented Jul 20, 2021

Hi (@bobbypage, @yujuhong, @harche, @dims)
Bug-Triage here:
we are already past code freeze, so I suggest moving this PR to milestone v1.23. WDYT?

This regression affects me. Since it is a regression I don't think it should be affected by the code freeze. During a code freeze, bug fixes can still go in.

@liggitt
Copy link
Member

liggitt commented Jul 20, 2021

if this is fixing a release-blocking regression, that should be linked prominently in the PR description so it doesn't get bumped from the release incorrectly

@ehashman
Copy link
Member

Hi (@bobbypage, @yujuhong, @harche, @dims)
Bug-Triage here:
we are already past code freeze, so I suggest moving this PR to milestone v1.23. WDYT?

I believe we may end up closing this PR in favour of #103743. As @liggitt pointed out the description is a bit coy, this addresses a serious issue.

@ehashman
Copy link
Member

/milestone clear

from SIG Node CI subgroup today, this isn't release-critical -- we will handle this via the runc bump

@odinuge
Copy link
Member Author

odinuge commented Aug 26, 2021

while we wait for runc 1.0.0

We are now on runc v1.0.2, and that should hopefully have fixed all these major issues.

/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 Aug 26, 2021
@ehashman
Copy link
Member

ehashman commented Sep 3, 2021

/remove-kind failing-test

@k8s-ci-robot k8s-ci-robot removed the kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. label Sep 3, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 2, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 1, 2022
@dims
Copy link
Member

dims commented Jan 11, 2022

@ehashman @odinuge do we still need this?

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

SIG Node PR Triage automation moved this from Needs Reviewer to Done Feb 10, 2022
@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubelet area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence. 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/testing Categorizes an issue or PR as relevant to SIG Testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Development

Successfully merging this pull request may close these issues.

None yet