KubeDirector app support for cgroup v2 environment

ERE 5.7.4 adds KubeDirector (KD) app support for cgroup v2. ERE supports cgroup v2 only from Kubernetes 1.35. The HPE-shipped KD apps are fixed in 5.7.4. Custom or older apps that use an old systemd or cgroup v1 mounts can still fail on cgroup v2 hosts. Follow this procedure to enable KD app support for cgroup v2.

Prerequisites

  1. The platform is upgraded to ERE 5.7.4 with Kubernetes 1.35.

  2. Run the add-on upgrade after the Kubernetes 1.35 upgrade. See the add-on upgrade script.

  3. Use this only after the nodes move to cgroup v2.

Procedure

Known Issue

A KD app pod that uses systemd (for example the Jupyter notebook or CentOS app) fails with Failed to get D-Bus connection . The pod stays in the creating state.

Reason

Old app images (CentOS 7, old systemd ) do not support cgroup v2. The pod is not privileged, so it cannot manage its own cgroup, and systemd cannot start.

Migration
If you use an old KD CentOS or KD notebook app, move to the new cgroup v2 supported app (Rocky 8 based). The old app cannot be changed in place, so move your data manually:
  1. Take a backup of the PVC data of the old notebook or app.

  2. Create a new notebook or app from the new cgroup v2 supported KD app.

  3. Restore the data from the backup to the PVC of the new one.

  4. Check that the new one works, then delete the old one.

NOTE
The add-on upgrade fixes the HPE-shipped apps only. It does the following:
  • Installs the new Rocky 8 KD apps (KD notebook and KD CentOS) with a systemd that supports cgroup v2.
  • Sets nativeSystemdSupport=true in the KubeDirector global config.
  • Installs Gatekeeper policies that run these pods as privileged. containerd 1.7.x needs this for cgroup v2 access. We plan to move to containerd 2.x (2.1 or later) in an upcoming release, so this privileged mode will no longer be needed in future releases.
Limitation
Custom or older KD apps with an old systemd or cgroup v1 mounts may still fail on cgroup v2. Move them to an image that supports cgroup v2. COndider the following:
  • Migration to the new app is manual (see Migration).
  • The KD training and serving apps are deprecated (since ERE 5.5.0) and are end of life (EOL). They use CentOS images with an old systemd . They do not work with cgroup v2, and we are not updating them. Move to a supported app. See Tutorial: KubeDirector Training and Serving for more information, and Contact HPE Support if you have any concern.
  • If you installed a fresh 5.7.4 cluster on Kubernetes 1.34/1.33 and later upgrade to 1.35, nativeSystemdSupport stays false . The flag is set only at install time or when the KubeDirector version changes. The add-on upgrade does not change it here. This is not needed from ERE 5.7.5, where the latest KD add-on is the default.

Manual patch (if nativeSystemdSupport is missing or false ) is as follows:

  1. Check the value:
    kubectl get kubedirectorconfig kd-global-config -n hpecp -o yaml | grep nativeSystemdSupport
  2. If it is missing or false , patch it:
    kubectl patch kubedirectorconfig kd-global-config -n hpecp --type=merge -p '
    {"spec":{"nativeSystemdSupport":true}}'
  3. Check again. Expected Result: nativeSystemdSupport: true.
Steps to validate KD Apps
  1. Upgrade the platform from 5.7.3 (Kubernetes 1.34) to 5.7.4 (Kubernetes 1.35).

  2. Run the add-on upgrade Kubernetes Add-On Upgrade Script. It installs the new KD apps, the Gatekeeper policies and set nativeSystemdSupport to true .

  3. Check the Gatekeeper policies:
    kubectl get assign,K8sPSPPrivilegedContainer -A
    Expected:
    NAME                                                          AGE
    assign.mutations.gatekeeper.sh/kdnotebook-set-privileged      4h56m
    assign.mutations.gatekeeper.sh/kdrockylinux8-set-privileged   4h56m
    assign.mutations.gatekeeper.sh/kdubuntu18x-set-privileged     4h56m
  4. Check nativeSystemdSupport :
    kubectl get kubedirectorconfig kd-global-config -n hpecp -o yaml | grep nativeSystemdSupport
    Expected:
      nativeSystemdSupport: true
  5. Check notebook and KD Rocky app in the UI:
  6. Create KD cluster using new notebook app/rocky app and validate .(It picks up the new image and runs on cgroup v2).