Cgroups version 2 on Red Hat OpenShift Container Platform: general information
Environment
- Red Hat OpenShift Container Platform (RHOCP).
- 4.
Issue
- What are the advantages of Cgroups version 2 over version 1?
- Which Cgroups versions are supported for every RHOCP release?
- What are the deprecation and removal dates of Cgroups 1?
- If the nodes of a cluster are running Cgroups 1 and it is tried to upgrade it to a RHOCP version only compatible with Cgroups 2, what would be the consequences? Would the upgrade be blocked?
- Can the Cgroups version in an existing cluster be upgraded or downgraded?
- Is it supported to mix nodes with Cgroups version 1 and version 2 in the same cluster?
Resolution
Application workloads perspective
-
Cgroups version 2 provides significant improvements over version 1.
-
All the nodes in a cluster must run the same Cgroups version, meaning hybrid configurations (Cgroups v1 nodes mixed with Cgroups v2 nodes) are not supported.
-
For Java/OpenJDK details on Cgroups see Cgroups v2 in OpenJDK container in RHOCP 4 and for EAP containers see EAP 7 images Cgroups version.
RHOCP 4.19 and later versions
-
Prior to upgrading to 4.19 or later versions, identification and adaptation for working with Cgroupsv2 on impacted application workloads is needed.
-
All the nodes in a cluster must run Cgroups version 2 before being upgraded to RHOCP 4.19 or a later version. Otherwise the upgrade will be blocked with the following message:
clusteroperator/machine-config is not upgradeable because Cluster is using deprecated cgroup v1, which is removed in 4.19. Please update the ‘cgroupMode’ in the ‘cluster’ object of nodes.config.openshift.io resource type to ‘v2’. This can be changed back to ‘v1’ while on 4.18, but must be ‘v2’ before you update to 4.19. Once updated to 4.19, cgroup v1 is no longer an option. Please refer to https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html-single/nodes/index#nodes-clusters-cgroups-2_nodes-cluster-cgroups-2
- On RHOCP 4.19 and later versions, Cgroups cannot be downgraded to version 1.
RHOCP 4.13 to 4.18 versions
-
Cgroups version 2 is available and supported for RHOCP starting on version 4.13, but it is installed by default only on RHOCP 4.14 and later releases.
-
To switch to version 2 in a cluster upgraded from RHOCP 4.13 and earlier versions, the configuration steps described in the documentation will have to be followed.
- If a cluster is being upgraded, Cgroups is not updated automatically.
-
If needed, Cgroups can be also downgraded from version 2 to version 1.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments