Migrate to cgroup v2

Google Distributed Cloud software-only on VMware version 1.35 requires cgroup v2. As of version 1.35, Kubernetes no longer supports cgroup v1. This document explains how to migrate your clusters to cgroup v2.

Before you begin

To install or upgrade Google Distributed Cloud software-only on VMware with Kubernetes 1.35, check the following:

  • Verify software version: You must use Google Distributed Cloud software-only on VMware version 1.35.00 or later.
  • OS cgroup v2 compatibility: You must use an operating system that supports cgroup v2.
  • Configure cgroup v2 (if required): If your OS doesn't default to cgroup v2 (for example, Ubuntu 18.04/20.04), you must configure it manually. For more information, see Migrating to cgroup v2 in the Kubernetes documentation.
  • Update Cluster Configuration: Change the osImageType field from ubuntu, ubuntu_containerd, or cos to either ubuntu_cgv2 or cos_cgv2 before upgrading to version 1.35.
  • Prepare vSphere Images: Run gkectl prepare if images are missing from vSphere.
  • Update Automation Scripts: Review and update any automation scripts to use the new ubuntu_cgv2 or cos_cgv2 image types.

Update OS image type

Before you run gkectl upgrade, change the osImageType to a cgroup v2 compatible image in your cluster YAML file.

Admin cluster

  1. Open your admin cluster configuration file.
  2. Locate the osImageType field.
  3. Change the value to ubuntu_cgv2 (if you use Ubuntu) or cos_cgv2 (if you use COS).

For more information about this field, see documentation for osImageType.

User cluster

  1. Open your user cluster configuration file.
  2. Locate the osImageType field within the nodePools section.
  3. Change the value to ubuntu_cgv2 (if you use Ubuntu) or cos_cgv2 (if you use COS).

For more information about this field, see documentation for nodePools[i].osImageType.

Upgrade your cluster

After updating the osImageType in your configuration file, upgrade your cluster.

  1. Run the following command to upgrade your cluster:

    gkectl upgrade cluster --config USER_CLUSTER_CONFIG --admin-config ADMIN_CLUSTER_CONFIG
    

    Replace USER_CLUSTER_CONFIG with the path to your user cluster configuration file. Replace ADMIN_CLUSTER_CONFIG with the path to your admin cluster configuration file.

Preflight checks

GKE on VMware 1.35 does not support the ubuntu, ubuntu_containerd, and cos OS image types. If you attempt to create or upgrade a cluster or node pool with these image types, the system blocks the request during preflight checks.

New default OS image type

The default osImageType for GKE on VMware 1.35 is ubuntu_cgv2. If you create a new cluster configuration and leave the osImageType field blank, the system deploys nodes with cgroup v2 enabled by default.

If you prefer Container-Optimized OS (COS) over Ubuntu, explicitly set the osImageType field to cos_cgv2 in your configuration file.

What's next