4.3. Configuring the container runtime
You can configure the container runtime used with new workloads on your nodes, based on which runtime you or your organization prefers. You can use either crun, which is considered a faster and more lightweight runtime, or runc, which is more widely used than crun.
For information on crun and runc, see "About the container engine and container runtime".
Starting in OpenShift Container Platform 4.18, crun is the default container runtime for new installations. You can change between the runtimes by using a ContainerRuntimeConfig object, as described in the following procedure. Changing the container runtime affects new workloads only. Existing workloads continue to use their existing container runtime.
If you updated your cluster from OpenShift Container Platform 4.17, the runc container runtime remains unchanged as the default. During the upgrade, two MachineConfig objects, one for the control plane nodes and one for the worker nodes, were created to override the new default runtime. You can migrate the container runtime to crun, on a schedule of your choosing, by removing either or both of the MachineConfig objects.
Procedure
If your cluster is updated from OpenShift Container Platform 4.17, you can use the crun container runtime by deleting the following
MachineConfigobjects:Migrate your worker nodes to crun by running the following command:
$ oc delete machineconfig 00-override-worker-generated-crio-default-container-runtimeMigrate your control plane nodes to crun by running the following command:
$ oc delete machineconfig 00-override-master-generated-crio-default-container-runtime
For any OpenShift Container Platform 4.18 or greater cluster, you can configure crun or runc as the container runtime for specific nodes by creating a container runtime configuration:
Create a YAML file for the
ContainerRuntimeConfigCR:apiVersion: machineconfiguration.openshift.io/v1 kind: ContainerRuntimeConfig metadata: name: configure-runc spec: machineConfigPoolSelector: matchLabels: pools.operator.machineconfiguration.openshift.io/worker: '' containerRuntimeConfig: defaultRuntime: "runc"where:
-
spec.machineConfigPoolSelector.matchLabels:: Specifies a label for the machine config pool that you want you want to modify. -
spec.containerRuntimeConfig.defaultRuntime:: Specifies the container runtime to use with new workloads on the nodes in the specified machine config pool, eithercrunorrunc.
-
Create the
ContainerRuntimeConfigCR:$ oc create -f <file_name>.yaml
Verification
After the nodes return to a ready state, open an
oc debugsession to a node by running the following command:$ oc debug node/<node_name>Set
/hostas the root directory within the debug shell by running the following command:sh-5.1# chroot /hostCheck the container runtime by using the following command:
sh-5.1# crio status config | grep default_runtimeExample output
INFO[2026-01-27 23:09:18.413462914Z] Starting CRI-O, version: 1.30.14-6.rhaos4.17.gitfa27f6f.el9, git: unknown(clean) default_runtime = "runc"The
default_runtimeparameter specifies the container runtime that OpenShift Container Platform uses for new workloads on this node, eithercrunorrunc, depending on what you have configured.