mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
OSDOCS-12461:update the RHEL image mode section
This commit is contained in:
committed by
openshift-cherrypick-robot
parent
a379b6d144
commit
eb4e12cb82
@@ -18,26 +18,6 @@ include::modules/microshift-install-rhel-image-mode-build-image.adoc[leveloffset
|
||||
|
||||
include::modules/microshift-install-rhel-image-mode-publish-image.adoc[leveloffset=+1]
|
||||
|
||||
[id="microshift-install-rhel-image-mode-configure-nw-s_{context}"]
|
||||
== Configuring networking and storage to run {microshift-short} in a bootc container
|
||||
|
||||
include::modules/microshift-install-rhel-image-mode-cni.adoc[leveloffset=+2]
|
||||
|
||||
include::modules/microshift-install-rhel-image-mode-csi-vg.adoc[leveloffset=+2]
|
||||
|
||||
//additional resources for storage module
|
||||
[id="_additional-resources_{context}"]
|
||||
.Additional resources
|
||||
* xref:../microshift_storage/microshift-storage-plugin-overview.adoc#microshift-storage-plugin-overview[Dynamic storage using the LVMS plugin]
|
||||
|
||||
include::modules/microshift-install-rhel-image-mode-csi-vgloop.adoc[leveloffset=+2]
|
||||
|
||||
include::modules/microshift-install-rhel-image-mode-run-container.adoc[leveloffset=+1]
|
||||
|
||||
include::modules/microshift-accessing-cluster-remotely.adoc[leveloffset=+2]
|
||||
|
||||
include::modules/microshift-install-rhel-image-mode-csi-vgcleanup.adoc[leveloffset=+1]
|
||||
|
||||
[id="_additional-resources_microshift-install-rhel-image-mode_{context}"]
|
||||
== Additional resources
|
||||
* link:https://developers.redhat.com/products/rhel-image-mode/getting-started[Image mode for Red Hat Enterprise Linux learning exercises]
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// microshift_install_bootc/microshift-install-rhel-image-mode.adoc
|
||||
|
||||
:_mod-docs-content-type: PROCEDURE
|
||||
[id="microshift-rhel-image-mode-run-image-cni_{context}"]
|
||||
= Configuring the {microshift-short} bootc image for the CNI
|
||||
|
||||
Configure a workaround for a kernel mismatch to enable the {microshift-short} OVN-Kubernetes (OVN-K) Container Network Interface (CNI).
|
||||
|
||||
[IMPORTANT]
|
||||
====
|
||||
The {microshift-short} 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 {op-system-base-full} {op-system-version} host with an active Red Hat subscription for building {microshift-short} bootc images and running containers.
|
||||
* You are logged into the {op-system-base} {op-system-version} host using the user credentials that have `sudo` permissions.
|
||||
|
||||
.Procedure
|
||||
|
||||
. Check if the `openvswitch` module is available for the current host kernel version by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ find /lib/modules/$(uname -r) -name "openvswitch*"
|
||||
----
|
||||
+
|
||||
.Example output
|
||||
[source,terminal]
|
||||
----
|
||||
/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
|
||||
----
|
||||
|
||||
. Set the `IMAGE_NAME` environment variable by running the following command:
|
||||
+
|
||||
[source,termimal]
|
||||
----
|
||||
$ IMAGE_NAME=microshift-4.17-bootc
|
||||
----
|
||||
|
||||
. Check the version of the kernel-core `package` used in the bootc image by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ sudo podman inspect "${IMAGE_NAME}" | grep kernel-core
|
||||
----
|
||||
+
|
||||
.Example output
|
||||
[source,terminal]
|
||||
----
|
||||
"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.
|
||||
+
|
||||
. Preinstall the `openvswitch` module on the host as a workaround by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ sudo modprobe openvswitch
|
||||
----
|
||||
@@ -1,41 +0,0 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// microshift_install_bootc/microshift-install-rhel-image-mode.adoc
|
||||
|
||||
:_mod-docs-content-type: PROCEDURE
|
||||
[id="microshift-rhel-image-mode-csi-vg_{context}"]
|
||||
= Checking the host configuration for the {microshift-short} 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-short} Logical Volume Manager (LVM) Container Storage Interface (CSI) to allocate storage.
|
||||
|
||||
.Prerequisites
|
||||
|
||||
* A {op-system-base-full} {op-system-version} host with an active Red Hat subscription for building {microshift-short} bootc images and running containers.
|
||||
* You are logged into the {op-system-base} {op-system-version} host using the user credentials that have `sudo` permissions.
|
||||
|
||||
.Procedure
|
||||
|
||||
. Determine if the volume group exists and it has the necessary free space by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ sudo vgs
|
||||
----
|
||||
+
|
||||
.Example output for existing volume group
|
||||
[source,terminal]
|
||||
----
|
||||
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.
|
||||
+
|
||||
[NOTE]
|
||||
====
|
||||
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-short} CSI further.
|
||||
====
|
||||
+
|
||||
[IMPORTANT]
|
||||
====
|
||||
If you do not have a volume group, you must set one up for the LVM CSI to allocate storage in bootc {microshift-short} containers. See the additional resources for more information.
|
||||
====
|
||||
@@ -1,32 +0,0 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// microshift_install_bootc/microshift-install-rhel-image-mode.adoc
|
||||
|
||||
:_mod-docs-content-type: PROCEDURE
|
||||
[id="microshift-rhel-image-mode-csi-vgcleanup_{context}"]
|
||||
= Cleaning up container storage for the bootc image and the {microshift-short} CSI
|
||||
|
||||
You can remove an additional LVM volume group loop device that was shared with the container and used by the {microshift-short} Logical Volume Manager (LVM) Container Storage Interface (CSI).
|
||||
|
||||
.Prerequisites
|
||||
|
||||
* A {op-system-base-full} {op-system-version} host with an active Red Hat subscription for building {microshift-short} bootc images and running containers.
|
||||
* You are logged into the {op-system-base} {op-system-version} host using the user credentials that have `sudo` permissions.
|
||||
|
||||
.Procedure
|
||||
|
||||
. Clean up the loop device and additional volume group by using the following commands:
|
||||
+
|
||||
.. Detach the loop device by entering the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ sudo losetup -d "${VGLOOP}"
|
||||
----
|
||||
|
||||
.. Delete the LVM volume group file by entering the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ sudo rm -f "${VGFILE}"
|
||||
----
|
||||
@@ -1,55 +0,0 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// microshift_install_bootc/microshift-install-rhel-image-mode.adoc
|
||||
|
||||
:_mod-docs-content-type: PROCEDURE
|
||||
[id="microshift-rhel-image-mode-csi_{context}"]
|
||||
= Configuring container storage for the bootc image and the {microshift-short} 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-short} Logical Volume Manager (LVM) Container Storage Interface (CSI).
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
If you found a volume group with adequate space when you checked the host configuration for the {microshift-short} CSI, you do not need to complete this step. Proceed to running your bootc image.
|
||||
====
|
||||
|
||||
.Prerequisites
|
||||
|
||||
* A {op-system-base-full} {op-system-version} host with an active Red Hat subscription for building {microshift-short} bootc images and running containers.
|
||||
* You are logged into the {op-system-base} {op-system-version} host using the user credentials that have `sudo` permissions.
|
||||
|
||||
.Procedure
|
||||
|
||||
. Create a file to be used for LVM partitioning by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
VGFILE=/var/lib/microshift-lvm-storage.img
|
||||
|
||||
sudo losetup -f "${VGFILE}"
|
||||
----
|
||||
|
||||
. Resize the file to your specified size by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
VGSIZE=1G # <1>
|
||||
|
||||
$ sudo truncate --size="${VGSIZE}" "${VGFILE}"
|
||||
----
|
||||
<1> Specify the size for the file.
|
||||
|
||||
. Query the loop device name by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ VGLOOP=$(losetup -j ${VGFILE} | cut -d: -f1)
|
||||
----
|
||||
|
||||
. Create a free volume group on the loop device by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ sudo vgcreate -f -y <my-volume-group> "${VGLOOP}" # <1>
|
||||
----
|
||||
<1> Replace _<my-volume-group>_ with the name of the volume group you are creating.
|
||||
@@ -1,66 +0,0 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// microshift_install_bootc/microshift-install-rhel-image-mode.adoc
|
||||
|
||||
:_mod-docs-content-type: PROCEDURE
|
||||
[id="microshift-rhel-image-mode-run-container_{context}"]
|
||||
= Running the {microshift-short} bootc container
|
||||
|
||||
Run your {microshift-short} bootc container to explore its reduced complexity and experiment with new capabilities and dependencies.
|
||||
|
||||
.Prerequisites
|
||||
|
||||
* A {op-system-base-full} {op-system-version} host with an active Red Hat subscription for building {microshift-short} bootc images and running containers.
|
||||
* You are logged into the {op-system-base} {op-system-version} host using the user credentials that have `sudo` permissions.
|
||||
* You have a pull secret file for downloading the required {microshift-short} container images.
|
||||
|
||||
.Procedure
|
||||
|
||||
. Run the container for the {microshift-short} service by entering the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
PULL_SECRET=~/.pull-secret.json
|
||||
IMAGE_NAME=microshift-4.17-bootc
|
||||
|
||||
$ sudo podman run --rm -it --privileged \
|
||||
-v "${PULL_SECRET}":/etc/crio/openshift-pull-secret:ro \
|
||||
-v /var/lib/containers/storage:/var/lib/containers/storage \
|
||||
--name "${IMAGE_NAME}" \
|
||||
"${IMAGE_NAME}"
|
||||
----
|
||||
+
|
||||
[NOTE]
|
||||
====
|
||||
The `systemd-modules-load` service fails to start in the container if the host kernel version is different from the bootc image kernel version. This failure can be safely ignored as all the necessary kernel modules have been loaded by the host.
|
||||
====
|
||||
|
||||
. A login prompt is presented in the terminal after {microshift-short} has started.
|
||||
|
||||
. Log into the running container using the your user credentials.
|
||||
|
||||
. Verify that all the {microshift-short} pods are up and running without errors by running the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ watch sudo oc get pods -A \
|
||||
--kubeconfig /var/lib/microshift/resources/kubeadmin/kubeconfig
|
||||
----
|
||||
+
|
||||
.Example output
|
||||
[source,terminal]
|
||||
----
|
||||
NAMESPACE NAME READY STATUS RESTARTS AGE
|
||||
kube-system csi-snapshot-controller-7cfb9df49c-kc9dx 1/1 Running 0 31s
|
||||
kube-system csi-snapshot-webhook-5c6b978878-jzk5r 1/1 Running 0 28s
|
||||
openshift-dns dns-default-rpnlt 2/2 Running 0 14s
|
||||
openshift-dns node-resolver-rxvdk 1/1 Running 0 31s
|
||||
openshift-ingress router-default-69cd7b5545-7zcw7 1/1 Running 0 29s
|
||||
openshift-ovn-kubernetes ovnkube-master-c7hlh 4/4 Running 1 (16s ago) 31s
|
||||
openshift-ovn-kubernetes ovnkube-node-mkpht 1/1 Running 1 (17s ago) 31s
|
||||
openshift-service-ca service-ca-5d5d96459d-5pd5s 1/1 Running 0 28s
|
||||
openshift-storage topolvm-controller-677cbfcdb9-28dqr 5/5 Running 0 31s
|
||||
openshift-storage topolvm-node-6fzbl 3/3 Running 0 14s
|
||||
----
|
||||
|
||||
. Now you can use your {microshift-short} running in the container the same way you can use any other {microshift-short} cluster.
|
||||
Reference in New Issue
Block a user