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

Use systemd as cgroup driver #5325

Open
7 tasks
rfranzke opened this issue Jan 26, 2022 · 12 comments
Open
7 tasks

Use systemd as cgroup driver #5325

rfranzke opened this issue Jan 26, 2022 · 12 comments
Assignees
Labels
area/open-source Open Source (community, enablement, contributions, conferences, CNCF, etc.) related kind/enhancement Enhancement, improvement, extension lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@rfranzke
Copy link
Member

rfranzke commented Jan 26, 2022

How to categorize this issue?

/area open-source
/kind enhancement

What would you like to be added:
With #5255 we have switched the cgroup driver from cgroupfs to systemd for shoots >= 1.23. However, this change was reverted with #5324.

Let's look into that the consequences of this change are, how the container runtime needs to be configured and how to properly roll this out.

Why is this needed:
Following upstream recommendations.

Work Items

Open Questions

  • How do we prevent running with systemd as cgroupfs driver when the OS extensions have not been updated to respect this in their bootstrapping logic?
  • Should we have a killswitch e.g. in cloud-config/kubelet reconfiguration that throws and error when there's a mismatch between kubelet config and containerruntime?
@rfranzke rfranzke added the kind/enhancement Enhancement, improvement, extension label Jan 26, 2022
@gardener-robot gardener-robot added the area/open-source Open Source (community, enablement, contributions, conferences, CNCF, etc.) related label Jan 26, 2022
@vpnachev
Copy link
Member

Thinking again on this topic, Gardener can configure both kubelet and containerd (similarly to how it control the pause image) to use the wanted cgroup driver, so from this point of view the OS extensions should not do anything. What do you think?

@voelzmo
Copy link
Member

voelzmo commented Mar 3, 2022

Thinking again on this topic, Gardener can configure both kubelet and containerd (similarly to how it control the pause image) to use the wanted cgroup driver, so from this point of view the OS extensions should not do anything. What do you think?

I can see how gardener modifies the containerd configuration file to inject the pause image and was thinking about something similar for the cgroup driver setting as well. This would, however, mean that we bootstrap a node first with the containerd configuration file from the OS extensions (flatcar example here, and later on change the cgroup driver, when the cloud-config is applied. My understanding was that changing the cgroup driver for a running node was something we would want to avoid? Or do you think in this scenario this would be okay?

@voelzmo
Copy link
Member

voelzmo commented Apr 6, 2022

@vpnachev do you have some thoughts on the above discussion? It may be that we have some time to pick this up in the near future.

@gardener-ci-robot
Copy link
Contributor

The Gardener 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

/lifecycle stale

@gardener-prow gardener-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 5, 2022
@rfranzke
Copy link
Member Author

rfranzke commented Jul 8, 2022

/remove-lifecycle stale
cc @MrBatschner

@gardener-prow gardener-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 8, 2022
@voelzmo
Copy link
Member

voelzmo commented Jul 11, 2022

I understand that this is only a prerequisite for enabling cgroupsv2, but please be aware that additional things need to be done before switching the cgroup:

And a few interesting things from https://blog.kintone.io/entry/2022/03/08/170206

For example (taken from the above link) regarding uber-go/automaxprocs:

If you're using a version until v1.4.0, you need to patch it with a cgroup v2 PR or set GOMAXPROCS manually for a while.

And regarding the JDK version

We need to use JDK 15 or later to run Java applications properly in the cgroup v2 environment. Let me describe it briefly.

JDK has built-in support for the container environment from version 8u131. JDK 10 introduced the +UseContainerSupport option and enabled it by default. With this option, JDK inspects the cgroup filesystem and reads the CPU and memory quotas for its use. The CPU quota information is available on Runtime.availableProcessors() (see Docker blog for details). The memory quota affects its heap memory usage. This mechanism should be adjusted for cgroup v2, and the fix became available with JDK 15.

@gardener-ci-robot
Copy link
Contributor

The Gardener 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

/lifecycle stale

@gardener-prow gardener-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 9, 2022
@ialidzhikov
Copy link
Member

/remove-lifecycle stale
/lifecycle frozen

@gardener-prow gardener-prow bot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 9, 2022
@dkistner dkistner assigned MrBatschner and unassigned dkistner Nov 9, 2022
@MrBatschner
Copy link
Contributor

/assign @danielfoehrKn

@rfranzke
Copy link
Member Author

@danielfoehrKn @MrBatschner Could you check the PR description and tell whether this is still up-to-date/the plan you are pursuing?

@rfranzke
Copy link
Member Author

ping @danielfoehrKn @MrBatschner

@MrBatschner
Copy link
Contributor

@danielfoehrKn @MrBatschner Could you check the PR description and tell whether this is still up-to-date/the plan you are pursuing?

Sorry for the delay in answering. The PR linked above is meant to configure containerd and kubelet on Garden Linux to use systemd as cgroup driver if cgroup v2/unified hierarchy is detected (as Garden Linux 934 came with cgroup v2 support). However, this is just for Garden Linux. The CoreOS/FlatCar extension contains similar code and eventually, the Ubuntu and cHost extensions would require such code too - especially since the systemd announced to drop cgroup v1 support in a future release. Instead of having quite similar code to deal with the cgroup versions in each operating system extension separately, we should explore if this can be moved into the OS config part of Gardener itself - and that is the direction @danielfoehrKn and myself were looking into so far. Thus, this issue in my opinion is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/open-source Open Source (community, enablement, contributions, conferences, CNCF, etc.) related kind/enhancement Enhancement, improvement, extension lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
None yet
Development

No branches or pull requests

9 participants