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

[1.24] cgmgr: create cgroups for systemd cgroup driver for dropped infra pods #6949

Conversation

haircommander
Copy link
Member

@haircommander haircommander commented May 22, 2023

 The history here is a bit convoluted. Originally, runc created the cgroup for the infra container.
cAdvisor was built to assume the cgroup for the infra container would be created, and it uses
this to find the network metrics for the pod. When we dropped the infra container, cri-o needed to make this
cgroup so cAdvisor could still find the network metrics.

However, systemd didn't like the way we did it, and would remove the cgroup mid pod creation, which was fixed in
https://github.com/cri-o/cri-o/pull/6196. This actually caused the cgroup to not be created at all, which then caused
the networking metrics to not be gathered at all.

Thus, we do need to create a cgroup underneath the systemd cgroup. Attempt to use a slice for this, as systemd won't require a
process be underneath it.

What type of PR is this?

/kind bug

What this PR does / why we need it:

reverts #6196
fixes #6657

Which issue(s) this PR fixes:

Special notes for your reviewer:

partial cherry-pick of #6856, ignoring the last commit because it's not relevant for 1.24

Does this PR introduce a user-facing change?

Fix a bug where network metrics collection is broken with systemd cgroup driver and dropped infra containers.

The history here is a bit convoluted. Originally, runc created the cgroup for the infra container.
cAdvisor was built to assume the cgroup for the infra container would be created, and it uses
this to find the network metrics for the pod. When we dropped the infra container, cri-o needed to make this
cgroup so cAdvisor could still find the network metrics.

However, systemd didn't like the way we did it, and would remove the cgroup mid pod creation, which was fixed in
cri-o#6196. This actually caused the cgroup to not be created at all, which then caused
the networking metrics to not be gathered at all.

Thus, we do need to create a cgroup underneath the systemd cgroup. Attempt to use a slice for this, as systemd won't require a
process be underneath it.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
- skip test for cgroupfs
- remove skip for runc 1.0.0-rc11 (very old now)
- drop removal of cgroup parent (not required)

Signed-off-by: Peter Hunt <pehunt@redhat.com>
@openshift-ci openshift-ci bot 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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels May 22, 2023
@openshift-ci openshift-ci bot requested review from klihub and QiWang19 May 22, 2023 17:58
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2023
@haircommander
Copy link
Member Author

/hold

to allow testing against 1.25

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 22, 2023
Signed-off-by: Peter Hunt <pehunt@redhat.com>
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #6949 (1edcf7f) into release-1.24 (b007cb6) will decrease coverage by 0.11%.
The diff coverage is 6.81%.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-1.24    #6949      +/-   ##
================================================
- Coverage         42.89%   42.78%   -0.11%     
================================================
  Files               124      124              
  Lines             12749    12784      +35     
================================================
+ Hits               5469     5470       +1     
- Misses             6754     6788      +34     
  Partials            526      526              

@haircommander
Copy link
Member Author

testing CI in #6969

@haircommander
Copy link
Member Author

similar CI state as a README change, this is ready

@cri-o/cri-o-maintainers PTAL

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 25, 2023
Copy link
Member

@sohankunkerkar sohankunkerkar left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Member

@sohankunkerkar sohankunkerkar left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 25, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, sohankunkerkar

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

1 similar comment
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, sohankunkerkar

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

@openshift-merge-robot openshift-merge-robot merged commit 8bf967b into cri-o:release-1.24 May 26, 2023
31 of 37 checks passed
@haircommander
Copy link
Member Author

/cherry-pick release-1.23

@openshift-cherrypick-robot

@haircommander: #6949 failed to apply on top of branch "release-1.23":

Applying: cgmgr: create cgroups for systemd cgroup driver for dropped infra pods
Using index info to reconstruct a base tree...
M	internal/config/cgmgr/cgmgr.go
M	test/cgroups.bats
Falling back to patching base and 3-way merge...
Auto-merging test/cgroups.bats
Auto-merging internal/config/cgmgr/cgmgr.go
CONFLICT (content): Merge conflict in internal/config/cgmgr/cgmgr.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 cgmgr: create cgroups for systemd cgroup driver for dropped infra pods
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.23

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
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. lgtm 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants