Este conteúdo não está disponível no idioma selecionado.
Chapter 1. Installing from an RPM package
You can install MicroShift from an RPM package on a machine with a supported version of Red Hat Enterprise Linux (RHEL).
1.1. System requirements for installing MicroShift Copiar o linkLink copiado para a área de transferência!
The following conditions must be met prior to installing MicroShift:
- A compatible version of Red Hat Enterprise Linux (RHEL). For more information, see the "Compatibility table" section.
- AArch64 or x86_64 system architecture.
- 2 CPU cores.
- 2 GB RAM. Installing from the network (UEFI HTTPs or PXE boot) requires 3 GB RAM for RHEL.
- 10 GB of storage.
- You have an active MicroShift subscription on your Red Hat account. If you do not have a subscription, contact your sales representative for more information.
- If your workload requires Persistent Volumes (PVs), you have a Logical Volume Manager (LVM) Volume Group (VG) with sufficient free capacity for the workloads.
These requirements are the minimum system requirements for MicroShift and Red Hat Enterprise Linux (RHEL). Add the system requirements for the workload you plan to run.
For example, if an IoT gateway solution requires 4 GB of RAM, your system needs to have at least 2 GB for Red Hat Enterprise Linux (RHEL) and MicroShift, plus 4 GB for the workloads. 6 GB of RAM is required in total.
It is recommended to allow for extra capacity for future needs if you are deploying physical devices in remote locations. If you are uncertain of the RAM required and if the budget permits, use the maximum RAM capacity that the device can support.
Ensure you configure secure access to the system to be able to manage it accordingly. For more information, see Using secure communications between two systems with OpenSSH.
1.2. Compatibility table Copiar o linkLink copiado para a área de transferência!
Plan to pair a supported version of RHEL for Edge with the MicroShift version you are using as described in the following compatibility table:
Red Hat Device Edge release compatibility matrix
The two products of Red Hat Device Edge work together as a single solution for device-edge computing. To successfully pair your products, use the verified releases together for each as listed in the following table:
| RHEL for Edge Version(s) | MicroShift Version | MicroShift Release Status | MicroShift Supported Updates |
| 9.2, 9.3 | 4.15 | Generally Available | 4.15.0→4.15.z and 4.15→future minor version |
| 9.2, 9.3 | 4.14 | Generally Available | 4.14.0→4.14.z and 4.14→4.15 |
| 9.2 | 4.13 | Technology Preview | None |
| 8.7 | 4.12 | Developer Preview | None |
1.3. Before installing MicroShift from an RPM package Copiar o linkLink copiado para a área de transferência!
Preparation of the host machine is recommended prior to installing MicroShift for memory configuration and FIPS mode.
1.3.1. Configuring volume groups Copiar o linkLink copiado para a área de transferência!
MicroShift uses the logical volume manager storage (LVMS) Container Storage Interface (CSI) plugin for providing storage to persistent volumes (PVs). LVMS relies on the Linux logical volume manager (LVM) to dynamically manage the backing logical volumes (LVs) for PVs. For this reason, your machine must have an LVM volume group (VG) with unused space in which LVMS can create the LVs for your workload’s PVs.
To configure a volume group (VG) that allows LVMS to create the LVs for your workload’s PVs, lower the Desired Size of your root volume during the installation of RHEL. Lowering the size of your root volume allows unallocated space on the disk for additional LVs created by LVMS at runtime.
1.3.2. Prepare for FIPS mode Copiar o linkLink copiado para a área de transferência!
If your use case requires running MicroShift containers in FIPS mode, you must install RHEL with FIPS enabled. After the worker machine is configured to run in FIPS mode, your MicroShift containers are automatically configured to also run in FIPS mode.
Because FIPS must be enabled before the operating system that your cluster uses starts for the first time, you cannot enable FIPS after you deploy a cluster.
1.4. Preparing to install MicroShift from an RPM package Copiar o linkLink copiado para a área de transferência!
Configure your RHEL machine to have a logical volume manager (LVM) volume group (VG) with sufficient capacity for the persistent volumes (PVs) of your workload.
Prerequisites
- The system requirements for installing MicroShift have been met.
- You have root user access to your machine.
- You have configured your LVM VG with the capacity needed for the PVs of your workload.
Procedure
-
In the graphical installer under Installation Destination in the Storage Configuration subsection, select Custom
Done to open the dialog for configuring partitions and volumes. The Manual Partitioning window is displayed. - Under New Red Hat Enterprise Linux 9.x Installation, select Click here to create them automatically.
- Select the root partition, /, reduce Desired Capacity so that the VG has sufficient capacity for your PVs, and then click Update Settings.
Complete your installation.
NoteFor more options on partition configuration, read the guide linked in the Additional information section for Configuring Manual Partitioning.
As a root user, verify the VG capacity available on your system by running the following command:
sudo vgs
$ sudo vgsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output:
VG #PV #LV #SN Attr VSize VFree rhel 1 2 0 wz--n- <127.00g 54.94g
VG #PV #LV #SN Attr VSize VFree rhel 1 2 0 wz--n- <127.00g 54.94gCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5. Installing Red Hat build of MicroShift from an RPM package Copiar o linkLink copiado para a área de transferência!
Use the following procedure to install Red Hat build of MicroShift from an RPM package.
Prerequisites
- The system requirements for installing Red Hat build of MicroShift have been met.
- You have completed the steps of preparing to install Red Hat build of MicroShift from an RPM package.
Procedure
As a root user, enable the Red Hat build of MicroShift repositories by running the following command:
sudo subscription-manager repos \ --enable rhocp-4.15-for-rhel-9-$(uname -m)-rpms \ --enable fast-datapath-for-rhel-9-$(uname -m)-rpms$ sudo subscription-manager repos \ --enable rhocp-4.15-for-rhel-9-$(uname -m)-rpms \ --enable fast-datapath-for-rhel-9-$(uname -m)-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install Red Hat build of MicroShift by running the following command:
sudo dnf install -y microshift
$ sudo dnf install -y microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Download your installation 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 Red Hat build of MicroShift. To copy the pull secret to the
/etc/criofolder of your RHEL machine, run the following command:sudo cp $HOME/openshift-pull-secret /etc/crio/openshift-pull-secret
$ sudo cp $HOME/openshift-pull-secret /etc/crio/openshift-pull-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make the root user the owner of the
/etc/crio/openshift-pull-secretfile by running the following command:sudo chown root:root /etc/crio/openshift-pull-secret
$ sudo chown root:root /etc/crio/openshift-pull-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make the
/etc/crio/openshift-pull-secretfile readable and writeable by the root user only by running the following command:sudo chmod 600 /etc/crio/openshift-pull-secret
$ sudo chmod 600 /etc/crio/openshift-pull-secretCopy to Clipboard Copied! Toggle word wrap Toggle overflow If your RHEL machine has a firewall enabled, you must configure a few mandatory firewall rules. For
firewalld, run the following commands:sudo firewall-cmd --permanent --zone=trusted --add-source=10.42.0.0/16
$ sudo firewall-cmd --permanent --zone=trusted --add-source=10.42.0.0/16Copy to Clipboard Copied! Toggle word wrap Toggle overflow sudo firewall-cmd --permanent --zone=trusted --add-source=169.254.169.1
$ sudo firewall-cmd --permanent --zone=trusted --add-source=169.254.169.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow sudo firewall-cmd --reload
$ sudo firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If the Volume Group (VG) that you have prepared for Red Hat build of 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 the Configuring Red Hat build of MicroShift section.
1.5.1. Installing the Operator Lifecycle Manager (OLM) from an RPM package Copiar o linkLink copiado para a área de transferência!
When you install MicroShift, the Operator Lifecycle Manager (OLM) package is not installed by default. You can install the OLM on your MicroShift instance using a RPM package.
Procedure
Install the OLM package by running the following command:
sudo dnf install microshift-olm
$ sudo dnf install microshift-olmCopy to Clipboard Copied! Toggle word wrap Toggle overflow To apply the manifest from the package to an active cluster, run the following command:
sudo systemctl restart microshift
$ sudo systemctl restart microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5.2. Installing the GitOps Argo CD manifests from an RPM package Copiar o linkLink copiado para a área de transferência!
You can use a lightweight version of the OpenShift GitOps with MicroShift to help manage your applications. Install the necessary Argo CD manifests using an RPM package. This RPM package included the necessary manifests that runs core Argo CD.
This process installs the basic GitOps functionalities, the Argo CD CLI is not currently available on MicroShift.
Prerequisites
- You installed MicroShift version 4.14 or higher
- Additional RAM storage of 250MB recommended
Procedure
Enable the GitOps repository with the subscription manager by running the following command:
sudo subscription-manager repos --enable=gitops-1.12-for-rhel-9-$(uname -m)-rpms
$ sudo subscription-manager repos --enable=gitops-1.12-for-rhel-9-$(uname -m)-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the GitOps package by running the following command:
sudo dnf install -y microshift-gitops
$ sudo dnf install -y microshift-gitopsCopy to Clipboard Copied! Toggle word wrap Toggle overflow To deploy Argo CD pods, restart the MicroShift service by running the following command:
sudo systemctl restart microshift
$ sudo systemctl restart microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
You can verify that your pods are running properly by running the following command:
oc get pods -n openshift-gitops
$ oc get pods -n openshift-gitopsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 4m11s argocd-redis-56844446bc-dzmhf 1/1 Running 0 4m12s argocd-repo-server-57b4f896cf-7qk8l 1/1 Running 0 4m12s
NAME READY STATUS RESTARTS AGE argocd-application-controller-0 1/1 Running 0 4m11s argocd-redis-56844446bc-dzmhf 1/1 Running 0 4m12s argocd-repo-server-57b4f896cf-7qk8l 1/1 Running 0 4m12sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6. Starting the MicroShift service Copiar o linkLink copiado para a área de transferência!
Use the following procedure to start the MicroShift service.
Prerequisites
- You have installed MicroShift from an RPM package.
Procedure
As a root user, start the MicroShift service by entering the following command:
sudo systemctl start microshift
$ sudo systemctl start microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: To configure your RHEL machine to start MicroShift when your machine starts, enter the following command:
sudo systemctl enable microshift
$ sudo systemctl enable microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: To disable MicroShift from automatically starting when your machine starts, enter the following command:
sudo systemctl disable microshift
$ sudo systemctl disable microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe first time that the MicroShift service starts, it downloads and initializes the container images for MicroShift. As a result, it can take several minutes for MicroShift to start the first time that the service is deployed. Boot time is reduced for subsequent starts of the MicroShift service.
1.7. Stopping the MicroShift service Copiar o linkLink copiado para a área de transferência!
Use the following procedure to stop the MicroShift service.
Prerequisites
- The MicroShift service is running.
Procedure
Enter the following command to stop the MicroShift service:
sudo systemctl stop microshift
$ sudo systemctl stop microshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow Workloads deployed on MicroShift might continue running even after the MicroShift service has been stopped. Enter the following command to display running workloads:
sudo crictl ps -a
$ sudo crictl ps -aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the following commands to stop the deployed workloads:
sudo systemctl stop kubepods.slice
$ sudo systemctl stop kubepods.sliceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.8. How to access the MicroShift cluster Copiar o linkLink copiado para a área de transferência!
Use the procedures in this section to access the MicroShift cluster, either from the same machine running the MicroShift service or remotely from a workstation. You can use this access to observe and administrate workloads. When using these steps, choose the kubeconfig file that contains the host name or IP address you want to connect with and place it in the relevant directory. As listed in each procedure, you use the OpenShift Container Platform CLI tool (oc) for cluster activities.
1.8.1. Accessing the MicroShift cluster locally Copiar o linkLink copiado para a área de transferência!
Use the following procedure to access the MicroShift cluster locally by using a kubeconfig file.
Prerequisites
-
You have installed the
ocbinary.
Procedure
Optional: to create a
~/.kube/folder if your RHEL machine does not have one, run the following command:mkdir -p ~/.kube/
$ mkdir -p ~/.kube/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the generated local access
kubeconfigfile to the~/.kube/directory by running the following command:sudo cat /var/lib/microshift/resources/kubeadmin/kubeconfig > ~/.kube/config
$ sudo cat /var/lib/microshift/resources/kubeadmin/kubeconfig > ~/.kube/configCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the permissions on your
~/.kube/configfile by running the following command:chmod go-r ~/.kube/config
$ chmod go-r ~/.kube/configCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that MicroShift is running by entering the following command:
oc get all -A
$ oc get all -ACopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.8.2. Opening the firewall for remote access to the MicroShift cluster Copiar o linkLink copiado para a área de transferência!
Use the following procedure to open the firewall so that a remote user can access the MicroShift cluster. This procedure must be completed before a workstation user can access the cluster remotely.
For this procedure, user@microshift is the user on the MicroShift host machine and is responsible for setting up that machine so that it can be accessed by a remote user on a separate workstation.
Prerequisites
-
You have installed the
ocbinary. - Your account has cluster administration privileges.
Procedure
As
user@microshifton the MicroShift host, open the firewall port for the Kubernetes API server (6443/tcp) by running the following command:sudo firewall-cmd --permanent --zone=public --add-port=6443/tcp && sudo firewall-cmd --reload
[user@microshift]$ sudo firewall-cmd --permanent --zone=public --add-port=6443/tcp && sudo firewall-cmd --reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
As
user@microshift, verify that MicroShift is running by entering the following command:oc get all -A
[user@microshift]$ oc get all -ACopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.8.3. Accessing the MicroShift cluster remotely Copiar o linkLink copiado para a área de transferência!
Use the following procedure to access the MicroShift cluster from a remote workstation by using a kubeconfig file.
The user@workstation login is used to access the host machine remotely. The <user> value in the procedure is the name of the user that user@workstation logs in with to the MicroShift host.
Prerequisites
-
You have installed the
ocbinary. -
The
user@microshifthas opened the firewall from the local host.
Procedure
As
user@workstation, create a~/.kube/folder if your RHEL machine does not have one by running the following command:mkdir -p ~/.kube/
[user@workstation]$ mkdir -p ~/.kube/Copy to Clipboard Copied! Toggle word wrap Toggle overflow As
user@workstation, set a variable for the hostname of your MicroShift host by running the following command:MICROSHIFT_MACHINE=<name or IP address of MicroShift machine>
[user@workstation]$ MICROSHIFT_MACHINE=<name or IP address of MicroShift machine>Copy to Clipboard Copied! Toggle word wrap Toggle overflow As
user@workstation, copy the generatedkubeconfigfile that contains the host name or IP address you want to connect with from the RHEL machine running MicroShift to your local machine by running the following command:ssh <user>@$MICROSHIFT_MACHINE "sudo cat /var/lib/microshift/resources/kubeadmin/$MICROSHIFT_MACHINE/kubeconfig" > ~/.kube/config
[user@workstation]$ ssh <user>@$MICROSHIFT_MACHINE "sudo cat /var/lib/microshift/resources/kubeadmin/$MICROSHIFT_MACHINE/kubeconfig" > ~/.kube/configCopy to Clipboard Copied! Toggle word wrap Toggle overflow
To generate kubeconfig files for this step, see the "Generating additional kubeconfig files for remote access" link in the additional resources section.
As
user@workstation, update the permissions on your~/.kube/configfile by running the following command:chmod go-r ~/.kube/config
$ chmod go-r ~/.kube/configCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
As
user@workstation, verify that MicroShift is running by entering the following command:oc get all -A
[user@workstation]$ oc get all -ACopy to Clipboard Copied! Toggle word wrap Toggle overflow