Prerequisite
Red Hat Enterprise Linux 9.2.
Please refer Installation of Red Hat Enterprise Linux 9.2 using developer account for installation of RHEL 9.2.
Enable the Red Hat build of MicroShift repositories by running the following command
sudo subscription-manager repos \
--enable rhocp-4.13-for-rhel-9-$(uname -m)-rpms \
--enable fast-datapath-for-rhel-9-$(uname -m)-rpms
Install Red Hat build of MicroShift and openshift clients by running the following command.
sudo dnf install -y microshift openshift-clients
Configure firewall rules
sudo firewall-cmd --permanent --zone=trusted --add-source=10.42.0.0/16
sudo firewall-cmd --permanent --zone=trusted --add-source=169.254.169.1
sudo firewall-cmd --reload
Download pull secret for Red Hat registry authentication
Open https://console.redhat.com/openshift/install/pull-secret and click on ‘Download pull secret’. Pull secret file is downloaded as ‘pull-secret.txt’ file.
Conifgure pull-secret.json
- Upload pull secret file to target machine and rename file to pull-secret.json.
- Copy the pull secret to the /etc/crio folder.
sudo cp pull-secret.json /etc/crio/openshift-pull-secret
- Make the root user the owner of the /etc/crio/openshift-pull-secret file by running the following command.
sudo chown root:root /etc/crio/openshift-pull-secret
- Make the /etc/crio/openshift-pull-secret file readable and writeable by the root user only by running the following command.
sudo chmod 600 /etc/crio/openshift-pull-secret
Start the MicroShift service
sudo systemctl start microshift
To start MicroShift when machine starts, enter the following command
sudo systemctl enable microshift
Check the service logs by running below command
journalctl -u microshift.service -f
Create kubeconfig file in home directory
mkdir ~/.kube
sudo cat /var/lib/microshift/resources/kubeadmin/kubeconfig > ~/.kube/config
Check the status of pods by running below command. The installation might take several minutes to complete.
[ability@localhost ~]$ oc get po -A
NAMESPACE NAME READY STATUS RESTARTS AGE
openshift-dns node-resolver-mcdxd 0/1 ContainerCreating 0 2m3s
openshift-ingress router-default-65864549b5-fbrkl 0/1 Pending 0 2m3s
openshift-ovn-kubernetes ovnkube-master-q729v 0/4 ContainerCreating 0 2m3s
openshift-ovn-kubernetes ovnkube-node-spbf4 0/1 ContainerCreating 0 2m3s
openshift-service-ca service-ca-764bd7f7b7-c82g5 0/1 Pending 0 2m4s
openshift-storage topolvm-controller-f58fcd7cb-m9ng4 0/4 Pending 0 2m3s