1.4. Configuring networking and storage to run MicroShift in a bootc container


1.4.1. Configuring the MicroShift bootc image for the CNI

Configure a workaround for a kernel mismatch to enable the MicroShift OVN-Kubernetes (OVN-K) Container Network Interface (CNI).

重要

The MicroShift OVN-K CNI requires the openvswitch kernel module to be available in the bootc image. A bootc image is started as a container that uses the host kernel. The host kernel might be different from the one used for building the image, resulting in a mismatch. A kernel version mismatch with the modules present in the /lib/modules directory means that the openvswitch module cannot be loaded in the container and the container fails to run. You can work around this problem by pre-loading the openvswitch module on the host.

Prerequisites

  • A Red Hat Enterprise Linux (RHEL) 9.4 host with an active Red Hat subscription for building MicroShift bootc images and running containers.
  • You are logged into the RHEL 9.4 host using the user credentials that have sudo permissions.

Procedure

  1. Check if the openvswitch module is available for the current host kernel version by running the following command:

    $ find /lib/modules/$(uname -r) -name "openvswitch*"

    Example output

    /lib/modules/5.14.0-427.28.1.el9_4.x86_64/kernel/net/openvswitch
    /lib/modules/5.14.0-427.28.1.el9_4.x86_64/kernel/net/openvswitch/openvswitch.ko.xz

  2. Set the IMAGE_NAME environment variable by running the following command:

    $ IMAGE_NAME=microshift-4.17-bootc
  3. Check the version of the kernel-core package used in the bootc image by running the following command:

    $ sudo podman inspect "${IMAGE_NAME}" | grep kernel-core

    Example output

    "created_by": "kernel-core-5.14.0-427.26.1.el9_4.x86_64" 
    1

    1
    The kernel version does not match the output of the /lib/modules directory.
  4. Preinstall the openvswitch module on the host as a workaround by running the following command:

    $ sudo modprobe openvswitch

1.4.2. Checking the host configuration for the MicroShift CSI

If the host is already configured to have a volume group (VG) with free space, that configuration is inherited by the container. The VG can be used by the MicroShift Logical Volume Manager (LVM) Container Storage Interface (CSI) to allocate storage.

Prerequisites

  • A Red Hat Enterprise Linux (RHEL) 9.4 host with an active Red Hat subscription for building MicroShift bootc images and running containers.
  • You are logged into the RHEL 9.4 host using the user credentials that have sudo permissions.

Procedure

  1. Determine if the volume group exists and it has the necessary free space by running the following command:

    $ sudo vgs

    Example output for existing volume group

      VG   #PV #LV #SN Attr   VSize   VFree 
    1
    
      rhel   1   1   0 wz--n- <91.02g <2.02g

    1
    If no free volume group is present, the output is either empty or the VFree value is 0.
    注記

    If the host has a volume group with the available needed storage, you can run your container now. You do not need to configure the MicroShift CSI further.

    重要

    If you do not have a volume group, you must set one up for the LVM CSI to allocate storage in bootc MicroShift containers. See the additional resources for more information.

1.4.3. Configuring container storage for the bootc image and the MicroShift CSI

Use this procedure when a volume group with the necessary storage is not available on the host. Create and allocate an additional LVM volume group loop device to be shared with the container and used by the MicroShift Logical Volume Manager (LVM) Container Storage Interface (CSI).

注記

If you found a volume group with adequate space when you checked the host configuration for the MicroShift CSI, you do not need to complete this step. Proceed to running your bootc image.

Prerequisites

  • A Red Hat Enterprise Linux (RHEL) 9.4 host with an active Red Hat subscription for building MicroShift bootc images and running containers.
  • You are logged into the RHEL 9.4 host using the user credentials that have sudo permissions.

Procedure

  1. Create a file to be used for LVM partitioning by running the following command:

    VGFILE=/var/lib/microshift-lvm-storage.img
    
    sudo losetup -f "${VGFILE}"
  2. Resize the file to your specified size by running the following command:

    VGSIZE=1G 
    1
    
    
    $ sudo truncate --size="${VGSIZE}" "${VGFILE}"
    1
    Specify the size for the file.
  3. Query the loop device name by running the following command:

    $ VGLOOP=$(losetup -j ${VGFILE} | cut -d: -f1)
  4. Create a free volume group on the loop device by running the following command:

    $ sudo vgcreate -f -y <my-volume-group> "${VGLOOP}" 
    1
    1
    Replace <my-volume-group> with the name of the volume group you are creating.
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る