Skip to content

Commit 23e7835

Browse files
authored
Merge pull request #61003 from ShaunaDiaz/OSDOCS-6393
/lgtm, merging! OSDOCS-6393: revise install instructions embedding in image
2 parents c6ea9c0 + ea110de commit 23e7835

8 files changed

+323
-28
lines changed
File renamed without changes.

microshift_install/microshift-embed-in-rpm-ostree.adoc

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,51 @@ toc::[]
99
You can embed {product-title} into a {op-system-ostree-first} {op-system-version} image. Use this guide to build a {op-system} image containing {product-title}.
1010

1111
include::snippets/microshift-tech-preview-snip.adoc[leveloffset=+1]
12+
1213
include::modules/microshift-preparing-for-image-building.adoc[leveloffset=+1]
14+
1315
include::modules/microshift-adding-repos-to-image-builder.adoc[leveloffset=+1]
1416

1517
[role="_additional-resources"]
1618
.Additional resources
1719

18-
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/composing_installing_and_managing_rhel_for_edge_images/setting-up-image-builder_composing-installing-managing-rhel-for-edge-images#edge-image-builder-system-requirements_setting-up-image-builder[Image Builder system requirements].
19-
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/composing_installing_and_managing_rhel_for_edge_images/setting-up-image-builder_composing-installing-managing-rhel-for-edge-images#edge-installing-image-builder_setting-up-image-builder[Installing Image Builder].
20+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/composing_installing_and_managing_rhel_for_edge_images/setting-up-image-builder_composing-installing-managing-rhel-for-edge-images#edge-image-builder-system-requirements_setting-up-image-builder[Image Builder system requirements]
21+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/composing_installing_and_managing_rhel_for_edge_images/setting-up-image-builder_composing-installing-managing-rhel-for-edge-images#edge-installing-image-builder_setting-up-image-builder[Installing Image Builder]
22+
2023
2124
include::modules/microshift-adding-service-to-blueprint.adoc[leveloffset=+1]
2225

26+
include::modules/microshift-creating-ostree-iso.adoc[leveloffset=+1]
27+
28+
include::modules/microshift-add-blueprint-build-iso.adoc[leveloffset=+1]
29+
30+
include::modules/microshift-download-iso-prep-for-use.adoc[leveloffset=+1]
31+
2332
[role="_additional-resources"]
2433
.Additional resources
2534

26-
* For more details on creating a blueprint, read link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/composing_installing_and_managing_rhel_for_edge_images/composing-a-rhel-for-edge-image-using-image-builder-command-line_composing-installing-managing-rhel-for-edge-images#proc_creating-a-rhel-for-edge-container-image-blueprint-using-image-builder-cli_composing-a-rhel-for-edge-image-using-image-builder-command-line[creating a RHEL for Edge Container blueprint using image builder CLI].
27-
* For further customizations such as adding users, firewall rules, or kernel arguments to a blueprint, read link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/composing_installing_and_managing_rhel_for_edge_images/composing-a-rhel-for-edge-image-using-image-builder-command-line_composing-installing-managing-rhel-for-edge-images#image-customizations_composing-a-rhel-for-edge-image-using-image-builder-command-line[supported image customizations].
28-
* For more about the composer cli, read https://www.osbuild.org/guides/user-guide/building-an-image-from-cli.html?highlight=push%20bluepring#blueprints-management-using-composer-cli[blueprint management using composer cli].
35+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/composing_installing_and_managing_rhel_for_edge_images/composing-a-rhel-for-edge-image-using-image-builder-command-line_composing-installing-managing-rhel-for-edge-images[Creating a RHEL for Edge Container blueprint using image builder CLI]
36+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/composing_installing_and_managing_rhel_for_edge_images/composing-a-rhel-for-edge-image-using-image-builder-command-line_composing-installing-managing-rhel-for-edge-images#image-customizations_composing-a-rhel-for-edge-image-using-image-builder-command-line[Supported image customizations]
37+
* link:https://www.osbuild.org/guides/image-builder-on-premises/building-ostree-images.html#building-ostree-image[Building ostree images]
38+
* link:https://www.osbuild.org/guides/image-builder-on-premises/blueprint-reference.html[Blueprint reference]
39+
* link:https://podman.io/docs/installation[Installing podman]
2940
30-
//include::modules/microshift-adding-containers-to-blueprint.adoc[leveloffset=+2]
3141
include::modules/microshift-provisioning-ostree.adoc[leveloffset=+1]
3242

3343
[role="_additional-resources"]
3444
.Additional resources
3545

36-
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/composing_installing_and_managing_rhel_for_edge_images/index[{op-system-ostree} documentation].
37-
* xref:../microshift_install/microshift-install-rpm.adoc#microshift-install-system-requirements_microshift-install-rpm[System requirements for installing MicroShift].
38-
* Red Hat Hybrid Cloud Console link:https://console.redhat.com/openshift/install/pull-secret[pull secret].
39-
* xref:../microshift_networking/microshift-firewall.adoc#microshift-firewall-req-settings_microshift-firewall[Required firewall settings].
40-
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/performing_an_advanced_rhel_9_installation/creating-kickstart-files_installing-rhel-as-an-experienced-user[Creating a Kickstart file].
41-
* link:https://access.redhat.com/solutions/60959[How to embed a Kickstart file into an ISO image].
46+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/composing_installing_and_managing_rhel_for_edge_images/index[{op-system-ostree} documentation]
47+
* xref:../microshift_install/microshift-install-rpm.adoc#microshift-install-system-requirements_microshift-install-rpm[System requirements for installing MicroShift]
48+
* link:https://console.redhat.com/openshift/install/pull-secret[Red Hat Hybrid Cloud Console pull secret]
49+
* xref:../microshift_networking/microshift-firewall.adoc#microshift-firewall-req-settings_microshift-firewall[Required firewall settings]
50+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/performing_an_advanced_rhel_9_installation/creating-kickstart-files_installing-rhel-as-an-experienced-user[Creating a Kickstart file]
51+
* link:https://access.redhat.com/solutions/60959[How to embed a Kickstart file into an ISO image]
4252
4353
include::modules/microshift-accessing.adoc[leveloffset=+1]
54+
4455
include::modules/microshift-accessing-cluster-locally.adoc[leveloffset=+2]
56+
4557
include::modules/microshift-accessing-cluster-open-firewall.adoc[leveloffset=+2]
46-
include::modules/microshift-accessing-cluster-remotely.adoc[leveloffset=+2]
4758

48-
//note: System requirements for installing MicroShift xref works on Netlify and local previews
59+
include::modules/microshift-accessing-cluster-remotely.adoc[leveloffset=+2]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-embed-into-rpm-ostree.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="microshift-add-blueprint-build-iso_{context}"]
7+
= Add the blueprint to Image Builder and build the ISO
8+
9+
. Add the blueprint to the Image Builder by running the following command:
10+
+
11+
[source,terminal]
12+
+
13+
----
14+
$ sudo composer-cli blueprints push microshift-installer.toml
15+
----
16+
17+
. Start the `ostree` ISO build by running the following command:
18+
+
19+
[source,terminal]
20+
----
21+
$ BUILDID=$(sudo composer-cli compose start-ostree --url http://localhost:8085/repo/ --ref "rhel/9/$(uname -m)/edge" microshift-installer edge-installer | awk '{print $2}')
22+
----
23+
+
24+
This command also returns the identification (ID) of the build for monitoring.
25+
26+
. You can check the status of the build periodically by running the following command:
27+
+
28+
[source,terminal]
29+
----
30+
$ sudo composer-cli compose status
31+
----
32+
+
33+
.Example output for a running build
34+
+
35+
[source,terminal]
36+
----
37+
ID Status Time Blueprint Version Type Size
38+
c793c24f-ca2c-4c79-b5b7-ba36f5078e8d RUNNING Wed Jun 7 13:22:20 2023 microshift-installer 0.0.0 edge-installer
39+
----
40+
+
41+
.Example output for a completed build
42+
+
43+
[source,terminal]
44+
----
45+
ID Status Time Blueprint Version Type Size
46+
c793c24f-ca2c-4c79-b5b7-ba36f5078e8d FINISHED Wed Jun 7 13:34:49 2023 microshift-installer 0.0.0 edge-installer
47+
----

modules/microshift-adding-repos-to-image-builder.adoc

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,69 @@ Use the following procedure to add the {product-title} repositories to Image Bui
1111
.Prerequisites
1212
* Your build host meets the Image Builder system requirements.
1313
* You have installed and set up Image Builder and the `composer-cli` tool.
14-
* You have root user access to your build host.
14+
* You have root-user access to your build host.
1515
1616
.Procedure
1717

18-
* Enable the {product-title} RPM repositories on the build host by running the following command:
18+
. Create an Image Builder configuration file for adding the `rhocp-4.13` RPM repository source required to pull {product-title} RPMs by running the following command:
1919
+
20-
[source,terminal,subs="attributes+"]
20+
[source,terminal]
2121
----
22-
$ sudo subscription-manager repos \
23-
--enable rhocp-{ocp-version}-for-{rhel-major}-$(uname -i)-rpms \
24-
--enable fast-datapath-for-{rhel-major}-$(uname -i)-rpms
22+
$ cat > rhocp-4.13.toml <<EOF
23+
id = "rhocp-4.13"
24+
name = "Red Hat OpenShift Container Platform 4.13 for RHEL 9"
25+
type = "yum-baseurl"
26+
url = "https://cdn.redhat.com/content/dist/layered/rhel9/$(uname -m)/rhocp/4.13/os"
27+
check_gpg = true
28+
check_ssl = true
29+
system = false
30+
rhsm = true
31+
EOF
2532
----
33+
34+
. Create an Image Builder configuration file for adding the `fast-datapath` RPM repository by running the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ cat > fast-datapath.toml <<EOF
39+
id = "fast-datapath"
40+
name = "Fast Datapath for RHEL 9"
41+
type = "yum-baseurl"
42+
url = "https://cdn.redhat.com/content/dist/layered/rhel9/$(uname -m)/fast-datapath/os"
43+
check_gpg = true
44+
check_ssl = true
45+
system = false
46+
rhsm = true
47+
EOF
48+
----
49+
50+
. Add the sources to the Image Builder by running the following commands:
51+
+
52+
[source,terminal]
53+
----
54+
$ sudo composer-cli sources add rhocp-4.13.toml
55+
----
56+
+
57+
[source,terminal]
58+
----
59+
$ sudo composer-cli sources add fast-datapath.toml
60+
----
61+
62+
.Verification
63+
64+
* Confirm that the sources were added properly by running the following command:
65+
+
66+
[source,terminal]
67+
----
68+
$ sudo composer-cli sources list
69+
----
70+
+
71+
.Example output
72+
+
73+
[source,terminal]
74+
----
75+
appstream
76+
baseos
77+
fast-datapath
78+
rhocp-4.13
79+
----

modules/microshift-adding-service-to-blueprint.adoc

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22
//
33
// microshift/microshift-embed-into-rpm-ostree.adoc
44

5-
:_content-type: CONCEPT
6-
[id="adding-microshift-service_{context}"]
7-
= Example Image Builder blueprint with {product-title}
5+
:_content-type: PROCEDURE
6+
[id="adding-microshift-service-to-blueprint_{context}"]
7+
= Adding the {product-title} service to a blueprint
88

99
Adding the {product-title} RPM package to an Image Builder blueprint enables the build of a {op-system-ostree} image with {product-title} embedded.
1010

11-
.Image Builder blueprint example
11+
.Procedure
1212

13-
[source,text]
13+
. Use the following example to create your blueprint:
14+
+
15+
.Image Builder blueprint example
16+
+
17+
[source,terminal]
1418
----
19+
$ cat > minimal-microshift.toml <<EOF
1520
name = "minimal-microshift"
1621

1722
description = ""
@@ -21,13 +26,55 @@ groups = []
2126

2227
[[packages]]
2328
name = "microshift"
24-
version = "4.13.0-1"
29+
version = "*"
2530
2631
[[packages]]
2732
name = "microshift-greenboot" <1>
28-
version = "4.13.0-1"
33+
version = "*"
2934

3035
[customizations.services]
3136
enabled = ["microshift"]
37+
EOF
3238
----
39+
[.small]
3340
<1> Optional `microshift-greenboot` RPM. For more information, read the "Greenboot health check" guide in the "Running Applications" section.
41+
+
42+
[NOTE]
43+
====
44+
The wildcard `*` in the commands uses the latest {product-title} RPMs. If you need a specific version, substitute the wildcard for the version you want. For example, insert `4.13.1` to download the {product-title} 4.13.1 RPMs.
45+
====
46+
47+
. Add the blueprint to the Image Builder by running the following command:
48+
+
49+
[source,terminal]
50+
----
51+
$ sudo composer-cli blueprints push minimal-microshift.toml
52+
----
53+
54+
.Verification
55+
56+
. Verify the Image Builder configuration listing only {product-title} packages by running the following command:
57+
+
58+
[source,terminal]
59+
----
60+
$ sudo composer-cli blueprints depsolve minimal-microshift | grep microshift
61+
----
62+
+
63+
.Example output
64+
+
65+
[source,terminal]
66+
----
67+
blueprint: minimal-microshift v0.0.1
68+
microshift-greenboot-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch
69+
microshift-networking-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.x86_64
70+
microshift-release-info-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch
71+
microshift-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.x86_64
72+
microshift-selinux-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch
73+
----
74+
75+
. Optional: Verify the Image Builder configuration listing all components to be installed by running the following command:
76+
+
77+
[source,terminal]
78+
----
79+
$ sudo composer-cli blueprints depsolve minimal-microshift
80+
----
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-embed-into-rpm-ostree.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="microshift-creating-ostree-iso_{context}"]
7+
= Creating the {op-system-ostree-first} image
8+
9+
Use the following procedure to create the ISO. The {op-system-ostree} Installer image pulls the commit from the running container and creates an installable boot ISO with a Kickstart file configured to use the embedded OSTree commit.
10+
11+
.Prerequisites
12+
* Your build host meets the Image Builder system requirements.
13+
* You have installed and set up Image Builder and the `composer-cli` tool.
14+
* You have root-user access to your build host.
15+
* You have the `podman` tool.
16+
17+
.Procedure
18+
19+
. Start an `ostree` container image build by running the following command:
20+
+
21+
[source,terminal]
22+
----
23+
$ BUILDID=$(sudo composer-cli compose start-ostree --ref "rhel/9/$(uname -m)/edge" minimal-microshift edge-container | awk '{print $2}')
24+
----
25+
+
26+
This command also returns the identification (ID) of the build for monitoring.
27+
28+
. You can check the status of the build periodically by running the following command:
29+
+
30+
[source,terminal]
31+
----
32+
$ sudo composer-cli compose status
33+
----
34+
+
35+
.Example output of a running build
36+
37+
[source,terminal]
38+
----
39+
ID Status Time Blueprint Version Type Size
40+
cc3377ec-4643-4483-b0e7-6b0ad0ae6332 RUNNING Wed Jun 7 12:26:23 2023 minimal-microshift 0.0.1 edge-container
41+
----
42+
+
43+
.Example output of a completed build
44+
45+
[source,terminal]
46+
----
47+
ID Status Time Blueprint Version Type Size
48+
cc3377ec-4643-4483-b0e7-6b0ad0ae6332 FINISHED Wed Jun 7 12:32:37 2023 minimal-microshift 0.0.1 edge-container
49+
----
50+
+
51+
[NOTE]
52+
====
53+
You can use the `watch` command to monitor your build if you are familiar with how to start and stop it.
54+
====
55+
56+
. Download the container image using the ID and get the image ready for use by running the following command:
57+
+
58+
[source,terminal]
59+
----
60+
$ sudo composer-cli compose image ${BUILDID}
61+
----
62+
63+
. Change the ownership of the downloaded container image to the current user by running the following command:
64+
+
65+
[source,terminal]
66+
----
67+
$ sudo chown $(whoami). ${BUILDID}-container.tar
68+
----
69+
70+
. Add read permissions for the current user to the image by running the following command:
71+
+
72+
[source,terminal]
73+
----
74+
$ sudo chmod a+r ${BUILDID}-container.tar
75+
----
76+
77+
. Bootstrap a server on port 8085 for the `ostree` container image to be consumed by the ISO build by completing the following steps:
78+
79+
.. Get the `IMAGEID` variable result by running the following command:
80+
+
81+
[source,terminal]
82+
----
83+
$ IMAGEID=$(cat < "./${BUILDID}-container.tar" | sudo podman load | grep -o -P '(?<=sha256[@:])[a-z0-9]*')
84+
----
85+
86+
.. Use the `IMAGEID` variable result to execute the podman command step by running the following command:
87+
+
88+
[source,terminal]
89+
----
90+
$ sudo podman run -d --name=minimal-microshift-server -p 8085:8080 ${IMAGEID}
91+
----
92+
+
93+
This command also returns the ID of the container saved in the `IMAGEID` variable for monitoring.
94+
95+
. Generate the installer blueprint file by running the following command:
96+
+
97+
[source,terminal]
98+
----
99+
$ cat > microshift-installer.toml <<EOF
100+
name = "microshift-installer"
101+
102+
description = ""
103+
version = "0.0.0"
104+
modules = []
105+
groups = []
106+
packages = []
107+
EOF
108+
----

0 commit comments

Comments
 (0)