Skip to content

Commit a442739

Browse files
authored
Merge pull request #90445 from ShaunaDiaz/OSDOCS-12318
OSDOCS-12318: adds bootc image use to MicroShift
2 parents 7999f89 + 6fb36bf commit a442739

11 files changed

+329
-50
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ Name: Installing with RHEL image mode
7676
Dir: microshift_install_bootc
7777
Distros: microshift
7878
Topics:
79-
- Name: Installing with RHEL image mode
80-
File: microshift-install-rhel-image-mode
79+
- Name: Understanding image mode for RHEL
80+
File: microshift-about-rhel-image-mode
81+
- Name: Installing a bootc image
82+
File: microshift-install-bootc-image
83+
- Name: Running the bootc image
84+
File: microshift-install-running-bootc-image-vm
8185
---
8286
Name: Using RHEL Kickstarts
8387
Dir: microshift_install_kickstarts
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
:_mod-docs-content-type: ASSEMBLY
2-
[id="microshift-install-rhel-image-mode"]
2+
[id="microshift-about-rhel-image-mode"]
33
include::_attributes/attributes-microshift.adoc[]
4-
= Using image mode for RHEL with {microshift-short}
5-
:context: microshift-install-rhel-image-mode
4+
= Understanding image mode for RHEL with {microshift-short}
5+
:context: microshift-about-rhel-image-mode
66

77
toc::[]
88

@@ -12,14 +12,10 @@ You can embed {microshift-short} into an operating system image using image mode
1212

1313
include::snippets/technology-preview.adoc[]
1414

15-
include::modules/microshift-install-rhel-image-mode-conc.adoc[leveloffset=+1]
16-
17-
include::modules/microshift-install-rhel-image-mode-build-image.adoc[leveloffset=+1]
18-
19-
include::modules/microshift-install-rhel-image-mode-publish-image.adoc[leveloffset=+1]
15+
include::modules/microshift-install-bootc-conc.adoc[leveloffset=+1]
2016

2117
[id="_additional-resources_microshift-install-rhel-image-mode_{context}"]
2218
== Additional resources
2319
* link:https://developers.redhat.com/products/rhel-image-mode/getting-started[Image mode for Red Hat Enterprise Linux learning exercises]
2420

25-
* link:https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_image_mode_for_rhel_to_build_deploy_and_manage_operating_systems/index[Using image mode for RHEL to build, deploy, and manage operating systems]
21+
* link:https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/{op-system-version-major}/html/using_image_mode_for_rhel_to_build_deploy_and_manage_operating_systems/index[Using image mode for RHEL to build, deploy, and manage operating systems]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-install-publish-bootc-image"]
3+
include::_attributes/attributes-microshift.adoc[]
4+
= Installing and publishing a bootc image to a registry
5+
:context: microshift-install-rhel-bootc-image
6+
7+
toc::[]
8+
9+
{microshift-short} is built and published as image mode containers. When installing a {op-system-base-full} bootable container image with {microshift-short}, use either a prebuilt bootable container image or build your own custom bootable container image.
10+
11+
:FeatureName: Image mode for {op-system-base}
12+
13+
include::snippets/technology-preview.adoc[]
14+
15+
include::modules/microshift-install-bootc-workflow.adoc[leveloffset=+1]
16+
17+
[id="microshift-get-build-bootc-image_{context}"]
18+
== Get or build your bootc image
19+
20+
Either get an existing bootc image or create one, then you can publish that image to a remote registry for use.
21+
22+
include::modules/microshift-install-bootc-get-published-image.adoc[leveloffset=+2]
23+
24+
include::modules/microshift-install-bootc-build-image.adoc[leveloffset=+2]
25+
26+
include::modules/microshift-install-bootc-publish-image.adoc[leveloffset=+1]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-install-running-bootc-image-in-vm"]
3+
include::_attributes/attributes-microshift.adoc[]
4+
= Running the bootc image in a virtual machine
5+
:context: microshift-install-running-bootc-image-in-vm
6+
7+
toc::[]
8+
9+
Use the bootable container image as an installation source to set up a {op-system-base-full} virtual machine.
10+
11+
:FeatureName: Image mode for {op-system-base}
12+
13+
include::snippets/technology-preview.adoc[]
14+
15+
include::modules/microshift-install-bootc-prepare-kickstart.adoc[leveloffset=+1]
16+
17+
include::modules/microshift-install-bootc-creating-vm.adoc[leveloffset=+1]

modules/microshift-install-rhel-image-mode-build-image.adoc renamed to modules/microshift-install-bootc-build-image.adoc

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Module included in the following assemblies:
22
//
3-
// microshift_install_bootc/microshift-install-rhel-image-mode.adoc
3+
// microshift_install_bootc/microshift-install-rhel-bootc-image.adoc
44

55
:_mod-docs-content-type: PROCEDURE
6-
[id="microshift-rhel-image-mode-build-image_{context}"]
6+
[id="microshift-install-bootc-build-image_{context}"]
77
= Building the bootc image
88

99
Build your {op-system-base-full} that contains {microshift-short} as a bootable container image by using a Containerfile.
@@ -14,8 +14,9 @@ Image mode for {op-system-base} is Technology Preview. Using a bootc image in pr
1414
====
1515

1616
.Prerequisites
17-
* A {op-system-base-full} {op-system-version} host with an active Red Hat subscription for building {microshift-short} bootc images and running containers.
18-
* You are logged into the {op-system-base} {op-system-version} host using the user credentials that have `sudo` permissions.
17+
18+
* A {op-system-base} {op-system-version} host with an active Red{nbsp}Hat subscription for building {microshift-short} bootc images and running containers.
19+
* You logged into the {op-system-base} {op-system-version} host by using the user credentials that have `sudo` permissions.
1920
* The `rhocp` and `fast-datapath` repositories are accessible in the host subscription. The repositories do not necessarily need to be enabled on the host.
2021
* You have a remote registry such as link:https://quay.io[Red Hat quay] for storing and accessing bootc images.
2122
@@ -71,19 +72,36 @@ RUN systemctl enable microshift-make-rshared.service
7172
Podman uses the host subscription information and repositories inside the container when building the container image. If the `rhocp` and `fast-datapath` repositories are not available on the host, the build fails.
7273
====
7374

74-
. Create a local bootc image by running the following image build command:
75+
. Set the `PULL_SECRET` environment variable:
7576
+
76-
[source,terminal,subs="+quotes"]
77+
[source,terminal]
7778
----
7879
PULL_SECRET=~/.pull-secret.json
79-
USER_PASSWD=_<your-redhat-user-password>_ # <1>
80+
----
81+
82+
. Configure the `USER_PASSWD` environment variable:
83+
+
84+
[source,terminal,subs="+quotes"]
85+
----
86+
USER_PASSWD=_<redhat_user_password>_ <1>
87+
----
88+
<1> Replace _<redhat_user_password>_ with your password.
89+
90+
. Configure the `IMAGE_NAME` environment variable:
91+
+
92+
[source,terminal,subs="attributes+"]
93+
----
8094
IMAGE_NAME=microshift-{product-version}-bootc
95+
----
8196

97+
. Create a local bootc image by running the following image build command:
98+
+
99+
[source,terminal,subs="+quotes"]
100+
----
82101
$ sudo podman build --authfile "${PULL_SECRET}" -t "${IMAGE_NAME}" \
83102
--build-arg USER_PASSWD="${USER_PASSWD}" \
84103
-f Containerfile
85104
----
86-
<1> Replace _<your_redhat_user_password>_ with your password.
87105
+
88106
[NOTE]
89107
====
@@ -95,16 +113,16 @@ How secrets are used during the image build:
95113

96114
.Verification
97115

98-
. Verify that the local {microshift} bootc image was created by running the following command:
116+
. Verify that the local {microshift-short} bootc image was created by running the following command:
99117
+
100118
[source,terminal]
101119
----
102120
$ sudo podman images "${IMAGE_NAME}"
103121
----
104122
+
105123
.Example output
106-
[source,text]
124+
[source,text,subs="attributes+"]
107125
----
108126
REPOSITORY TAG IMAGE ID CREATED SIZE
109-
localhost/microshift-4.19-bootc latest 193425283c00 2 minutes ago 2.31 GB
127+
localhost/microshift-{product-version}-bootc latest 193425283c00 2 minutes ago 2.31 GB
110128
----
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Module included in the following assemblies:
22
//
3-
// microshift_install_bootc/microshift-install-rhel-image-mode.adoc
3+
// microshift_install_bootc/microshift-about-rhel-image-mode
44

55
:_mod-docs-content-type: CONCEPT
6-
[id="microshift-rhel-image-mode-conc_{context}"]
7-
= Image mode for {op-system-base-full}
6+
[id="microshift-bootc-conc_{context}"]
7+
= About image mode for {op-system-base-full}
88

99
Image mode for {op-system-base-full} is a Technology Preview deployment method that uses a container-native approach to build, deploy, and manage the operating system as a bootc image. By using bootc, you can build, deploy, and manage the operating system as if it is any other container.
1010

@@ -17,23 +17,3 @@ Image mode splits the creation and installation of software changes into two ste
1717
* In the build-system step, a Podman build inspects the RPM files available for installation, determines any dependencies, and creates an ordered list of chained steps to complete, with the end result being a new operating system available to install.
1818
1919
* In the running-target-system step, a bootc update downloads, unpacks, and makes the new operating system bootable alongside the currently running system. Local configuration changes are carried forward to the new operating system, but do not take effect until the system is rebooted and the new operating system image replaces the running image.
20-
21-
[id="microshift-install-rhel-image-mode-conc_{context}"]
22-
== Using image mode for {op-system-base} with {microshift-short}
23-
24-
To use image mode for {op-system-base}, ensure that the following resources are available:
25-
26-
* A {op-system-base} {op-system-version} host with an active Red Hat subscription for building {microshift-short} bootc images.
27-
* A remote registry for storing and accessing bootc images.
28-
* You can use image mode for RHEL with a {microshift-short} cluster on AArch64 or x86_64 system architectures.
29-
30-
The workflow for using image mode with {microshift-short} includes the following steps:
31-
32-
. Build the {microshift-short} bootc image.
33-
. Publish the image.
34-
. Run the image. This step includes configuring {microshift-short} networking and storage.
35-
36-
[IMPORTANT]
37-
====
38-
The `rpm-ostree` file system is not supported in image mode and must not be used to make changes to deployments that use image mode.
39-
====
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift_install_bootc/microshift-install-running-bootc-image-in-VM.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-install-bootc-creating-vm_{context}"]
7+
= Creating a virtual machine
8+
9+
You can create a virtual machine by using the {op-system-base-full} boot ISO image.
10+
11+
.Prerequisites
12+
13+
* You created the Kickstart file.
14+
15+
* You installed the {oc-first}.
16+
17+
* You have `redhat` credentials.
18+
19+
.Procedure
20+
21+
. Download the {op-system-base-full} boot ISO image from the link:https://developers.redhat.com/products/rhel/download[Download Red{nbsp}Hat Enterprise Linux].
22+
23+
. Copy the downloaded file to the `/var/lib/libvirt/images` directory.
24+
25+
. Use your values to configure the following environment variables:
26+
+
27+
[source,terminal,subs="attributes+"]
28+
----
29+
VMNAME=microshift-{product-version}-bootc
30+
NETNAME=default
31+
----
32+
33+
. Create a {op-system-base-full} virtual machine with 2 cores, 2GB of RAM and 20GB of storage by running the following command:
34+
+
35+
[source,terminal,subs="attributes+"]
36+
----
37+
$ sudo virt-install \
38+
--name ${VMNAME} \
39+
--vcpus 2 \
40+
--memory 2048 \
41+
--disk path=/var/lib/libvirt/images/${VMNAME}.qcow2,size=20 \
42+
--network network=${NETNAME},model=virtio \
43+
--events on_reboot=restart \
44+
--location /var/lib/libvirt/images/rhel-{op-system-version}-$(uname -m)-boot.iso \
45+
--initrd-inject kickstart.ks \
46+
--extra-args "inst.ks=file://kickstart.ks" \
47+
--wait
48+
----
49+
+
50+
[NOTE]
51+
====
52+
The `sudo virt-install` command uses the Kickstart file to pull a bootc image from the remote registry and install the {op-system-base-full} operating system.
53+
====
54+
55+
. Log in to the virtual machine by using your `redhat` credentials.
56+
57+
.Verification
58+
59+
. Verify that all the {microshift-short} pods are running without error, by running the following command:
60+
+
61+
[source,terminal]
62+
----
63+
$ watch sudo oc get pods -A \
64+
--kubeconfig /var/lib/microshift/resources/kubeadmin/kubeconfig
65+
----
66+
+
67+
.Example output
68+
[source,text]
69+
----
70+
NAMESPACE NAME READY STATUS RESTARTS AGE
71+
kube-system csi-snapshot-controller-7cfb9df49c-kc9dx 1/1 Running 0 31s
72+
kube-system csi-snapshot-webhook-5c6b978878-jzk5r 1/1 Running 0 28s
73+
openshift-dns dns-default-rpnlt 2/2 Running 0 14s
74+
openshift-dns node-resolver-rxvdk 1/1 Running 0 31s
75+
openshift-ingress router-default-69cd7b5545-7zcw7 1/1 Running 0 29s
76+
openshift-ovn-kubernetes ovnkube-master-c7hlh 4/4 Running 1 (16s ago) 31s
77+
openshift-ovn-kubernetes ovnkube-node-mkpht 1/1 Running 1 (17s ago) 31s
78+
openshift-service-ca service-ca-5d5d96459d-5pd5s 1/1 Running 0 28s
79+
openshift-storage topolvm-controller-677cbfcdb9-28dqr 5/5 Running 0 31s
80+
openshift-storage topolvm-node-6fzbl 3/3 Running 0 14s
81+
----
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift_install_bootc/microshift-install-rhel-bootc-image.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-install-bootc-get-published-image_{context}"]
7+
= Getting the published bootc image for {microshift-short}
8+
9+
You can find and use the {microshift-short} container images to install {op-system-base-full}.
10+
11+
.Prerequisites
12+
13+
* You have an x86_64 or AArch64 platform.
14+
15+
* You have access to the `registry.redhat.io` registry.
16+
17+
.Procedure
18+
19+
. Navigate to the link:https://catalog.redhat.com/[Red{nbsp}Hat Ecosystem Catalog].
20+
21+
. Search for the {microshift-short} container image by using the `microshift-bootc` keyword.
22+
23+
. Open the container image page of the {microshift-short} container image.
24+
25+
. See the `Overview` and `Technical Information` tabs to get more details about the image.
26+
27+
. Select the `Get this image` tab to view instructions for downloading the image.
28+
29+
. Get access to the latest image on x86_64 and AArch64 platforms by logging into the registry using the following command:
30+
+
31+
[source,terminal]
32+
----
33+
$ sudo podman login registry.redhat.io
34+
----
35+
36+
. Download the bootc image by running the following command:
37+
+
38+
[source,terminal,subs="attributes+"]
39+
----
40+
$ podman pull registry.redhat.io/openshift4/microshift-bootc-rhel{op-system-version-major}:v{product-version}
41+
----

0 commit comments

Comments
 (0)