Skip to content

Commit e8786c2

Browse files
authored
Merge pull request #53537 from stevsmit/install-microshift
Add microshift-install
2 parents fc7381b + c0921dd commit e8786c2

12 files changed

+421
-6
lines changed

_attributes/attributes-microshift.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
:experimental:
55
:imagesdir: images
66
:OCP: OpenShift Container Platform
7-
:op-system-first: Red Hat Enterprise Linux for Edge (RHEL for Edge)
8-
:op-system: RHEL for Edge
7+
:ocp-version: 4.12
8+
:rhel-major: rhel-8
9+
:op-system-first: Red Hat Enterprise Linux (RHEL)
10+
:op-system: RHEL
11+
:op-system-ostree-first: Red Hat Enterprise Linux (RHEL) for Edge
12+
:op-system-ostree: RHEL for Edge
13+
:op-system-version: 8.7
914
:op-system-ram: 2GB RAM
1015
:op-system-chip: two-core AMD64 1.5GHz processor
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
:_content-type: ASSEMBLY
22
[id="microshift-install-rhel-for-edge"]
3-
= Installing MicroShift in a RHEL for Edge Image
3+
= Embedding MicroShift into a {op-system-ostree} image
44
include::_attributes/attributes-microshift.adoc[]
55
:context: microshift-install-rhel-for-edge
66
toc::[]
77

8-
// The content of this file should be based on https://github.com/openshift/microshift/blob/main/docs/rhel4edge_iso.md
8+
You can embed MicroShift into a {op-system-ostree-first} {op-system-version} image.
9+
10+
== Embedding MicroShift into a {op-system-ostree} image
11+
12+
Use the content within this section to build a {op-system-ostree-first} {op-system-version} image containing MicroShift.
13+
14+
[NOTE]
15+
====
16+
{op-system} 9.0 is currently unsupported for MicroShift deployments.
17+
====
18+
19+
//include modules/prerequisites-for-installing-microshift.adoc
20+
21+
include::modules/embedding-microshift-rpm-ostree-image.adoc[leveloffset=+2]
22+
23+
include::modules/accessing-microshift.adoc[leveloffset=+2]
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
:_content-type: ASSEMBLY
22
[id="microshift-install-rpm"]
3-
= Installing MicroShift from RPM
3+
= Installing MicroShift from an RPM package
44
include::_attributes/attributes-microshift.adoc[]
55
:context: microshift-install-rpm
66
toc::[]
77

8-
// The content of this file should be based on https://github.com/openshift/microshift/blob/main/docs/devenv_rhel8.md but without the steps for building from source.
8+
You can install MicroShift from an RPM package on a machine with {op-system-first} {op-system-version}.
9+
10+
To embed MicroShift in a {op-system-ostree} image, see xref:../microshift_install/microshift-install-rhel-for-edge.adoc#microshift-install-rhel-for-edge[Embedding MicroShift into a {op-system-ostree-first} image].
11+
12+
include::modules/system-requirements-installing-microshift.adoc[leveloffset=+2]
13+
14+
include::modules/preparing-for-installing-microshift-rpm.adoc[leveloffset=+2]
15+
16+
include::modules/installing-microshift-rpm.adoc[leveloffset=+2]
17+
18+
include::modules/starting-microshift-service.adoc[leveloffset=+2]
19+
20+
include::modules/stopping-microshift-service.adoc[leveloffset=+2]
21+
22+
include::modules/accessing-microshift.adoc[leveloffset=+1]
23+
24+
include::modules/accessing-microshift-cluster-locally.adoc[leveloffset=+2]
25+
26+
include::modules/accessing-microshift-cluster-remotely.adoc[leveloffset=+2]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-install-rpm.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="accssing-microshift-cluster-locally_{context}"]
7+
= Accessing the MicroShift cluster locally
8+
9+
Use the following procedure to access the MicroShift cluster locally.
10+
11+
.Prerequisites
12+
13+
* You have installed the `oc` CLI.
14+
15+
.Procedure
16+
17+
. Optional: Enter the following command to create a `~/.kube/` folder if your {op-system} machine does not have one:
18+
+
19+
[source,terminal]
20+
----
21+
$ mkdir -p ~/.kube/
22+
----
23+
24+
. Copy the generated `kubeconfig` file to the `~/.kube/config` folder:
25+
+
26+
[source,terminal]
27+
----
28+
$ sudo cat /var/lib/microshift/resources/kubeadmin/kubeconfig > ~/.kube/config
29+
----
30+
31+
. Verify that MicroShift is running by entering the following command:
32+
+
33+
[source,terminal]
34+
----
35+
$ oc get all -A
36+
----
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-install-rpm.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="accessing-microshift-cluster-remotely_{context}"]
7+
= Accessing the MicroShift cluster remotely
8+
9+
Use the following procedure to access the MicroShift cluster from a remote workstation.
10+
11+
.Prerequisites
12+
13+
* You have installed the `oc` CLI.
14+
15+
.Procedure
16+
17+
[NOTE]
18+
====
19+
The following procedure assumes that there are two users. The first user, `user@microshift`, is the user on the {product-title} host machine. `user@microshift` is responsible for setting up the `op-system` machine so that it can be accessed by a remote user on a separate workstation.
20+
21+
The second user, `user@workstation`, accesses the {op-system} machine remotely from their workstation.
22+
====
23+
24+
. As `user@microshift` on the MicroShift host, open the firewall port for Kubernetes API server (`6443/tcp`) on your {op-system} machine by entering the following command:
25+
+
26+
[source,terminal]
27+
----
28+
[user@microshift]$ sudo firewall-cmd --permanent --zone=public --add-port=6443/tcp && sudo firewall-cmd --reload
29+
----
30+
31+
. Optional: As `user@workstation`, enter the following command to create a `~/.kube/` folder if your {op-system} machine does not have one:
32+
+
33+
[source,terminal]
34+
----
35+
[user@workstation]$ mkdir -p ~/.kube/
36+
----
37+
38+
. As `user@workstation`, set a variable for the hostname of your MicroShift host by entering the following command:
39+
+
40+
[source,terminal]
41+
----
42+
[user@microshift]$ MICROSHIFT_MACHINE=<name or IP address of MicroShift machine>
43+
----
44+
45+
. As `user@workstation`, copy the generated `kubeconfig` file from the {op-system} machine running MicroShift to your local machine by entering the following command:
46+
+
47+
[source,terminal]
48+
----
49+
[user@workstation]$ ssh <user>@$MICROSHIFT_MACHINE "sudo cat /var/lib/microshift/resources/kubeadmin/kubeconfig" > ~/.kube/config
50+
----
51+
+
52+
[NOTE]
53+
====
54+
The `<user>` value is the name of the user that `user@workstation` uses to log in to the MicroShift host.
55+
====
56+
57+
. As `user@workstation`, replace the `server` field in your `kubeconfig` file with the name or IP address of your {op-system} machine running MicroShift by entering the following command:
58+
+
59+
[source,terminal]
60+
----
61+
[user@workstation]$ sed -i "s|server: https://127.0.0.1:6443|server: https://$MICROSHIFT_MACHINE:6443|" ~/.kube/config
62+
----
63+
64+
. As `user@workstation`, verify that MicroShift is running by entering the following command:
65+
+
66+
[source,terminal]
67+
----
68+
[user@workstation]$ oc get all -A
69+
----

modules/accessing-microshift.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-install-rpm.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="accssing-microshift-cluster_{context}"]
7+
= Accessing the MicroShift Cluster
8+
9+
Use the procedures in this section to access the MicroShift cluster locally (from the same machine running the MicroShift service) or remotely (from a different machine running the MicroShift service).
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
= Prerequisites
2+
3+
You have read the documentation on how to compose {op-system-ostree} images either on your own {op-system} {op-system-version} machine with Image Builder or on Red Hat Hosted Image Builder service:
4+
5+
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/composing_installing_and_managing_rhel_for_edge_images[Composing, installing, and managing RHEL for Edge images]
6+
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/creating_customized_rhel_images_using_the_image_builder_service[Creating customized RHEL images using the Image Builder service]
7+
8+
= Building a {op-system-ostree} image embedding MicroShift
9+
10+
== Adding MicroShift repositories to Image Builder
11+
12+
== Adding MicroShift to an Image Builder blueprint
13+
14+
== Adding MicroShift dependencies to an installer kickstart file
15+
16+
= Building a {op-system-ostree} image embedding workloads
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-install-rpm.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="installing-microshift-from-rpm-package_{context}"]
7+
= Installing MicroShift from an RPM package
8+
9+
Use the following procedure to install MicroShift from an RPM package.
10+
11+
.Prerequisites
12+
13+
* The xref:../microshift_install/microshift-install-rpm.adoc#system-requirements-installing-microshift[system requirements for installing MicroShift] have been met.
14+
* You have completed the steps at xref:../microshift_install/microshift-install-rpm.adoc#preparing-install-microshift-from-rpm-package_microshift-install-rpm[Preparing to install MicroShift from an RPM package].
15+
16+
.Procedure
17+
18+
. As a root user, enable the MicroShift repositories by entering the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ sudo subscription-manager repos \
23+
--enable rhocp-{ocp-version}-for-rhel-8-$(uname -i)-rpms \
24+
--enable fast-datapath-for-{rhel-major}-$(uname -i)-rpms
25+
----
26+
27+
. Install MicroShift by entering the following command:
28+
+
29+
[source,terminal]
30+
----
31+
$ sudo dnf install -y microshift
32+
----
33+
34+
. Download your installation link:https://console.redhat.com/openshift/install/pull-secret[pull secret] from the Red Hat Hybrid Cloud Console to a temporary folder, for example, `$HOME/openshift-pull-secret`. This pull secret allows you to authenticate with the container registries that serve the container images used by MicroShift.
35+
36+
. Enter the following command to copy the pull secret to the `/etc/crio` folder of your {op-system} machine:
37+
+
38+
[source,terminal]
39+
----
40+
$ sudo cp $HOME/openshift-pull-secret /etc/crio/openshift-pull-secret
41+
----
42+
43+
. Make the root user the owner of the `/etc/crio/openshift-pull-secret` file by entering the following command:
44+
+
45+
[source,terminal]
46+
----
47+
$ sudo chown root:root /etc/crio/openshift-pull-secret
48+
----
49+
50+
. Make the `/etc/crio/openshift-pull-secret` file readable and writeable by the root user only by entering the following command:
51+
+
52+
[source,terminal]
53+
----
54+
$ sudo chmod 600 /etc/crio/openshift-pull-secret
55+
----
56+
57+
. If your {op-system} machine has a firewall enabled, you must configure a few mandatory firewall rules. For `firewalld`, enter the following commands:
58+
+
59+
[source,terminal]
60+
----
61+
$ sudo firewall-cmd --permanent --zone=trusted --add-source=10.42.0.0/16
62+
----
63+
+
64+
[source,terminal]
65+
----
66+
$ sudo firewall-cmd --permanent --zone=trusted --add-source=169.254.169.1
67+
----
68+
+
69+
[source,terminal]
70+
----
71+
$ sudo firewall-cmd --reload
72+
----
73+
74+
If the Volume Group (VG) that you have prepared for MicroShift used the default name `rhel`, no further configuration is necessary. If you have used a different name, or if you want to change more configuration settings, see xref:../microshift_configuring/microshift-using-config-tools.adoc#microshift-using-config-tools[Configuring MicroShift].
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-install-rpm.adoc
4+
5+
[id="preparing-install-microshift-from-rpm-package_{context}"]
6+
= Preparing to install MicroShift from an RPM package
7+
8+
Before installing MicroShift from an RPM package, you must configure your {op-system} machine to have a logical volume manager (LVM) volume group (VG) with sufficient capacity for the persistent volumes (PVs) of your workload.
9+
10+
MicroShift uses the logical volume manager storage (LVMS) Container Storage Interface (CSI) provider for storing PVs. LVMS relies on Linux's LVM to dynamically manage the backing storage for PVs. For this reason, your machine must have an LVM VG in which LVMS can create the LVM logical volumes (LVs) for your workload's PVs.
11+
12+
To configure an LVM VG that allows LVMS to create the LVM LVs for your workload's PVs, adjust your root volume's size during the installation of {op-system}. Adjusting your root volume's size provides free space for additional LVs created by LVMS at runtime.
13+
14+
.Prerequisites
15+
16+
* The xref:../microshift_install/microshift-install-rpm.adoc#system-requirements-installing-microshift[system requirements for installing MicroShift] have been met.
17+
* You have root user access to your machine.
18+
19+
.Procedure
20+
21+
. In the graphical installer under *Storage Configuration*, select *Custom* -> *Done* to open the dialog for configuring partitions and volumes.
22+
23+
. Under *New Red Hat Enterprise Linux 8.x Installation*, select *Click here to create them automatically*.
24+
25+
. Select the root partition, */*, reduce *Desired Capacity* so that the VG has sufficient capacity for your PVs, and then click *Update Settings*.
26+
27+
. Complete your installation.
28+
+
29+
[NOTE]
30+
====
31+
For more options on partition configuration, see link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/performing_a_standard_rhel_8_installation/index#manual-partitioning_graphical-installation[Configuring Manual Partitioning].
32+
====
33+
34+
. As a root user, verify the VG capacity available on your system by entering the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ sudo vgs
39+
----
40+
+
41+
Example output:
42+
+
43+
[source,terminal]
44+
----
45+
VG #PV #LV #SN Attr VSize VFree
46+
rhel 1 2 0 wz--n- <127.00g 54.94g
47+
----
48+
+
49+
[NOTE]
50+
====
51+
For more information about resizing your existing LVs to free up capacity in your VGs, see link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/configuring_and_managing_logical_volumes/index#managing-lvm-volume-groups_configuring-and-managing-logical-volumes[Managing LVM Volume Groups]
52+
====
53+
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Module included in the following assemblies:
2+
//
3+
// microshift/microshift-install-rpm.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="starting-microshift_service_{context}"]
7+
= Starting the MicroShift service
8+
9+
Use the following procedure to start the MicroShift service.
10+
11+
.Prerequisites
12+
13+
* You have installed MicroShift from an RPM package.
14+
15+
.Procedure
16+
17+
. As a root user, start the MicroShift service by entering the following command:
18+
+
19+
[source,terminal]
20+
----
21+
$ sudo systemctl start microshift
22+
----
23+
24+
. Optional: To configure your {op-system} machine to start MicroShift when your machine starts, enter the following command:
25+
+
26+
[source,terminal]
27+
----
28+
$ sudo systemctl enable microshift
29+
----
30+
31+
. Optional: To disable MicroShift from automatically starting when your machine starts, enter the following command:
32+
+
33+
[source,terminal]
34+
----
35+
$ sudo systemctl disable microshift
36+
----
37+
+
38+
[NOTE]
39+
====
40+
The first time that the MicroShift service starts, it downloads and initializes MicroShift's container images. As a result, it can take several minutes for {product-title} to start the first time that the service is deployed.
41+
Boot time is reduced for subsequent starts of the MicroShift service.
42+
====

0 commit comments

Comments
 (0)