1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00

OSDOCS-6393: revise install instructions embedding in image

This commit is contained in:
“Shauna Diaz”
2023-06-08 14:19:04 -04:00
committed by openshift-cherrypick-robot
parent 2347e776ac
commit cbccaa8090
8 changed files with 325 additions and 30 deletions

View File

@@ -9,40 +9,51 @@ toc::[]
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}.
include::snippets/microshift-tech-preview-snip.adoc[leveloffset=+1]
include::modules/microshift-preparing-for-image-building.adoc[leveloffset=+1]
include::modules/microshift-adding-repos-to-image-builder.adoc[leveloffset=+1]
[role="_additional-resources"]
.Additional resources
* 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].
* 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].
* 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]
* 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]
include::modules/microshift-adding-service-to-blueprint.adoc[leveloffset=+1]
include::modules/microshift-creating-ostree-iso.adoc[leveloffset=+1]
include::modules/microshift-add-blueprint-build-iso.adoc[leveloffset=+1]
include::modules/microshift-download-iso-prep-for-use.adoc[leveloffset=+1]
[role="_additional-resources"]
.Additional resources
* 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].
* 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].
* 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].
* 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]
* 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]
* link:https://www.osbuild.org/guides/image-builder-on-premises/building-ostree-images.html#building-ostree-image[Building ostree images]
* link:https://www.osbuild.org/guides/image-builder-on-premises/blueprint-reference.html[Blueprint reference]
* link:https://podman.io/docs/installation[Installing podman]
//include::modules/microshift-adding-containers-to-blueprint.adoc[leveloffset=+2]
include::modules/microshift-provisioning-ostree.adoc[leveloffset=+1]
[role="_additional-resources"]
.Additional resources
* 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].
* xref:../microshift_install/microshift-install-rpm.adoc#microshift-install-system-requirements_microshift-install-rpm[System requirements for installing MicroShift].
* Red Hat Hybrid Cloud Console link:https://console.redhat.com/openshift/install/pull-secret[pull secret].
* xref:../microshift_networking/microshift-firewall.adoc#microshift-firewall-req-settings_microshift-firewall[Required firewall settings].
* 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].
* link:https://access.redhat.com/solutions/60959[How to embed a Kickstart file into an ISO image].
* 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]
* xref:../microshift_install/microshift-install-rpm.adoc#microshift-install-system-requirements_microshift-install-rpm[System requirements for installing MicroShift]
* link:https://console.redhat.com/openshift/install/pull-secret[Red Hat Hybrid Cloud Console pull secret]
* xref:../microshift_networking/microshift-firewall.adoc#microshift-firewall-req-settings_microshift-firewall[Required firewall settings]
* 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]
* link:https://access.redhat.com/solutions/60959[How to embed a Kickstart file into an ISO image]
include::modules/microshift-accessing.adoc[leveloffset=+1]
include::modules/microshift-accessing-cluster-locally.adoc[leveloffset=+2]
include::modules/microshift-accessing-cluster-open-firewall.adoc[leveloffset=+2]
include::modules/microshift-accessing-cluster-remotely.adoc[leveloffset=+2]
//note: System requirements for installing MicroShift xref works on Netlify and local previews
include::modules/microshift-accessing-cluster-locally.adoc[leveloffset=+2]
include::modules/microshift-accessing-cluster-open-firewall.adoc[leveloffset=+2]
include::modules/microshift-accessing-cluster-remotely.adoc[leveloffset=+2]

View File

@@ -0,0 +1,47 @@
// Module included in the following assemblies:
//
// microshift/microshift-embed-into-rpm-ostree.adoc
:_content-type: PROCEDURE
[id="microshift-add-blueprint-build-iso_{context}"]
= Add the blueprint to Image Builder and build the ISO
. Add the blueprint to the Image Builder by running the following command:
+
[source,terminal]
+
----
$ sudo composer-cli blueprints push microshift-installer.toml
----
. Start the `ostree` ISO build by running the following command:
+
[source,terminal]
----
$ 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}')
----
+
This command also returns the identification (ID) of the build for monitoring.
. You can check the status of the build periodically by running the following command:
+
[source,terminal]
----
$ sudo composer-cli compose status
----
+
.Example output for a running build
+
[source,terminal]
----
ID Status Time Blueprint Version Type Size
c793c24f-ca2c-4c79-b5b7-ba36f5078e8d RUNNING Wed Jun 7 13:22:20 2023 microshift-installer 0.0.0 edge-installer
----
+
.Example output for a completed build
+
[source,terminal]
----
ID Status Time Blueprint Version Type Size
c793c24f-ca2c-4c79-b5b7-ba36f5078e8d FINISHED Wed Jun 7 13:34:49 2023 microshift-installer 0.0.0 edge-installer
----

View File

@@ -11,15 +11,69 @@ Use the following procedure to add the {product-title} repositories to Image Bui
.Prerequisites
* Your build host meets the Image Builder system requirements.
* You have installed and set up Image Builder and the `composer-cli` tool.
* You have root user access to your build host.
* You have root-user access to your build host.
.Procedure
* Enable the {product-title} RPM repositories on the build host by running the following command:
. 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:
+
[source,terminal,subs="attributes+"]
[source,terminal]
----
$ sudo subscription-manager repos \
--enable rhocp-{ocp-version}-for-{rhel-major}-$(uname -i)-rpms \
--enable fast-datapath-for-{rhel-major}-$(uname -i)-rpms
$ cat > rhocp-4.13.toml <<EOF
id = "rhocp-4.13"
name = "Red Hat OpenShift Container Platform 4.13 for RHEL 9"
type = "yum-baseurl"
url = "https://cdn.redhat.com/content/dist/layered/rhel9/$(uname -m)/rhocp/4.13/os"
check_gpg = true
check_ssl = true
system = false
rhsm = true
EOF
----
. Create an Image Builder configuration file for adding the `fast-datapath` RPM repository by running the following command:
+
[source,terminal]
----
$ cat > fast-datapath.toml <<EOF
id = "fast-datapath"
name = "Fast Datapath for RHEL 9"
type = "yum-baseurl"
url = "https://cdn.redhat.com/content/dist/layered/rhel9/$(uname -m)/fast-datapath/os"
check_gpg = true
check_ssl = true
system = false
rhsm = true
EOF
----
. Add the sources to the Image Builder by running the following commands:
+
[source,terminal]
----
$ sudo composer-cli sources add rhocp-4.13.toml
----
+
[source,terminal]
----
$ sudo composer-cli sources add fast-datapath.toml
----
.Verification
* Confirm that the sources were added properly by running the following command:
+
[source,terminal]
----
$ sudo composer-cli sources list
----
+
.Example output
+
[source,terminal]
----
appstream
baseos
fast-datapath
rhocp-4.13
----

View File

@@ -2,16 +2,21 @@
//
// microshift/microshift-embed-into-rpm-ostree.adoc
:_content-type: CONCEPT
[id="adding-microshift-service_{context}"]
= Example Image Builder blueprint with {product-title}
:_content-type: PROCEDURE
[id="adding-microshift-service-to-blueprint_{context}"]
= Adding the {product-title} service to a blueprint
Adding the {product-title} RPM package to an Image Builder blueprint enables the build of a {op-system-ostree} image with {product-title} embedded.
.Image Builder blueprint example
.Procedure
[source,text]
. Use the following example to create your blueprint:
+
.Image Builder blueprint example
+
[source,terminal]
----
$ cat > minimal-microshift.toml <<EOF
name = "minimal-microshift"
description = ""
@@ -21,13 +26,55 @@ groups = []
[[packages]]
name = "microshift"
version = "4.13.0-1"
version = "*"
[[packages]]
name = "microshift-greenboot" <1>
version = "4.13.0-1"
version = "*"
[customizations.services]
enabled = ["microshift"]
EOF
----
[.small]
<1> Optional `microshift-greenboot` RPM. For more information, read the "Greenboot health check" guide in the "Running Applications" section.
+
[NOTE]
====
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.
====
. Add the blueprint to the Image Builder by running the following command:
+
[source,terminal]
----
$ sudo composer-cli blueprints push minimal-microshift.toml
----
.Verification
. Verify the Image Builder configuration listing only {product-title} packages by running the following command:
+
[source,terminal]
----
$ sudo composer-cli blueprints depsolve minimal-microshift | grep microshift
----
+
.Example output
+
[source,terminal]
----
blueprint: minimal-microshift v0.0.1
microshift-greenboot-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch
microshift-networking-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.x86_64
microshift-release-info-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch
microshift-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.x86_64
microshift-selinux-4.13.1-202305250827.p0.g4105d3b.assembly.4.13.1.el9.noarch
----
. Optional: Verify the Image Builder configuration listing all components to be installed by running the following command:
+
[source,terminal]
----
$ sudo composer-cli blueprints depsolve minimal-microshift
----

View File

@@ -0,0 +1,108 @@
// Module included in the following assemblies:
//
// microshift/microshift-embed-into-rpm-ostree.adoc
:_content-type: PROCEDURE
[id="microshift-creating-ostree-iso_{context}"]
= Creating the {op-system-ostree-first} image
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.
.Prerequisites
* Your build host meets the Image Builder system requirements.
* You have installed and set up Image Builder and the `composer-cli` tool.
* You have root-user access to your build host.
* You have the `podman` tool.
.Procedure
. Start an `ostree` container image build by running the following command:
+
[source,terminal]
----
$ BUILDID=$(sudo composer-cli compose start-ostree --ref "rhel/9/$(uname -m)/edge" minimal-microshift edge-container | awk '{print $2}')
----
+
This command also returns the identification (ID) of the build for monitoring.
. You can check the status of the build periodically by running the following command:
+
[source,terminal]
----
$ sudo composer-cli compose status
----
+
.Example output of a running build
[source,terminal]
----
ID Status Time Blueprint Version Type Size
cc3377ec-4643-4483-b0e7-6b0ad0ae6332 RUNNING Wed Jun 7 12:26:23 2023 minimal-microshift 0.0.1 edge-container
----
+
.Example output of a completed build
[source,terminal]
----
ID Status Time Blueprint Version Type Size
cc3377ec-4643-4483-b0e7-6b0ad0ae6332 FINISHED Wed Jun 7 12:32:37 2023 minimal-microshift 0.0.1 edge-container
----
+
[NOTE]
====
You can use the `watch` command to monitor your build if you are familiar with how to start and stop it.
====
. Download the container image using the ID and get the image ready for use by running the following command:
+
[source,terminal]
----
$ sudo composer-cli compose image ${BUILDID}
----
. Change the ownership of the downloaded container image to the current user by running the following command:
+
[source,terminal]
----
$ sudo chown $(whoami). ${BUILDID}-container.tar
----
. Add read permissions for the current user to the image by running the following command:
+
[source,terminal]
----
$ sudo chmod a+r ${BUILDID}-container.tar
----
. Bootstrap a server on port 8085 for the `ostree` container image to be consumed by the ISO build by completing the following steps:
.. Get the `IMAGEID` variable result by running the following command:
+
[source,terminal]
----
$ IMAGEID=$(cat < "./${BUILDID}-container.tar" | sudo podman load | grep -o -P '(?<=sha256[@:])[a-z0-9]*')
----
.. Use the `IMAGEID` variable result to execute the podman command step by running the following command:
+
[source,terminal]
----
$ sudo podman run -d --name=minimal-microshift-server -p 8085:8080 ${IMAGEID}
----
+
This command also returns the ID of the container saved in the `IMAGEID` variable for monitoring.
. Generate the installer blueprint file by running the following command:
+
[source,terminal]
----
$ cat > microshift-installer.toml <<EOF
name = "microshift-installer"
description = ""
version = "0.0.0"
modules = []
groups = []
packages = []
EOF
----

View File

@@ -0,0 +1,28 @@
// Module included in the following assemblies:
//
// microshift/microshift-embed-into-rpm-ostree.adoc
:_content-type: PROCEDURE
[id="microshift-download-iso-prep-for-use_{context}"]
= Download the ISO and prepare it for use
. Download the ISO using the ID by running the following command:
+
[source,terminal]
----
$ sudo composer-cli compose image ${BUILDID}
----
. Change the ownership of the downloaded container image to the current user by running the following command:
+
[source,terminal]
----
$ sudo chown $(whoami). ${BUILDID}-installer.iso
----
. Add read permissions for the current user to the image by running the following command:
+
[source,terminal]
----
$ sudo chmod a+r ${BUILDID}-installer.iso
----

View File

@@ -50,7 +50,7 @@ For more information, read "Additional resources."
# └─sda2 8:2 0 19G 0 part
# └─rhel-root 253:0 0 10G 0 lvm /sysroot
#
ostreesetup --nogpg --osname=rhel --remote=edge
ostreesetup --nogpg --osname=rhel --remote=edge \
--url=file:///run/install/repo/ostree/repo --ref=rhel/<RHEL VERSION NUMBER>/x86_64/edge
zerombr
clearpart --all --initlabel