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 MachineConfig objects:

    • Migrate your worker nodes to crun by running the following command:

      $ oc delete machineconfig 00-override-worker-generated-crio-default-container-runtime
    • Migrate 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:

    1. Create a YAML file for the ContainerRuntimeConfig CR:

      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, either crun or runc.
    2. Create the ContainerRuntimeConfig CR:

      $ oc create -f <file_name>.yaml

Verification

  1. After the nodes return to a ready state, open an oc debug session to a node by running the following command:

    $ oc debug node/<node_name>
  2. Set /host as the root directory within the debug shell by running the following command:

    sh-5.1# chroot /host
  3. Check the container runtime by using the following command:

    sh-5.1# crio status config | grep default_runtime

    Example 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_runtime parameter specifies the container runtime that OpenShift Container Platform uses for new workloads on this node, either crun or runc, depending on what you have configured.

Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동