Skip to content

Latest commit

 

History

History
92 lines (66 loc) · 4.46 KB

getting_started.md

File metadata and controls

92 lines (66 loc) · 4.46 KB

Getting Started with MicroShift

Disclaimer
This page describes an opinionated setup to facilitate a quick bootstrap of MicroShift in a virtual environment for experimentation-only purpose. See Install MicroShift on RHEL for Edge for more information on setting up a production-grade system with MicroShift.

The remainder of this document describes how to install a virtual machine running RHEL 8.6 operating system and an experimental version of MicroShift from the @redhat-et/microshift-testing copr repository.

Prerequisites

Log into the hypervisor machine using your user credentials.

Run the following command to install the necessary components for the libvirt virtualization platform and its QEMU KVM hypervisor driver.

Note for Other Virtualization Platform Users
Implement the virtual machine creation guidelines from Bootstrap MicroShift using your virtualization platform and apply one of the following configuration steps:

  • When creating a virtual machine, pass the inst.ks=... boot option pointing to the microshift-starter.ks kickstart file
  • After creating a virtual machine, manually execute the configuration steps from the microshift-starter.ks kickstart file
sudo dnf install -y libvirt virt-manager virt-viewer libvirt-client qemu-kvm qemu-img

Download the Red Hat Enterprise Linux 8.6 DVD ISO image for the x86_64 architecture from Red Hat Developer site and copy the file to the /var/lib/libvirt/images directory.

Other architectures, versions or flavors of operating systems are not supported. For this setup, only use the RHEL 8.6 DVD image for x86_64 architecture.

Download the OpenShift pull secret from the https://console.redhat.com/openshift/downloads#tool-pull-secret page and save it into the ~/.pull-secret.json file.

Bootstrap MicroShift

Log into the hypervisor machine using your user credentials.

Run the following commands to initiate the creation process of the microshift-starter virtual machine with 2 CPU cores, 2GB RAM and 20GB storage.

VMNAME=microshift-starter
DVDISO=/var/lib/libvirt/images/rhel-8.6-x86_64-dvd.iso
KICKSTART=https://raw.githubusercontent.com/openshift/microshift/main/docs/config/microshift-starter.ks

sudo -b bash -c " \
cd /var/lib/libvirt/images && \
virt-install \
    --name ${VMNAME} \
    --vcpus 2 \
    --memory 2048 \
    --disk path=./${VMNAME}.qcow2,size=20 \
    --network network=default,model=virtio \
    --events on_reboot=restart \
    --location ${DVDISO} \
    --extra-args \"inst.ks=${KICKSTART}\" \
"

Watch the OS console of the virtual machine to see the progress of the installation, waiting until the machine is rebooted and the login prompt appears.

Access MicroShift

Log into the hypervisor machine using your user credentials.

Is it most convenient to access the MicroShift virtual machine using SSH. Run the following command to get the machine IP address and use it to remotely connect to the system.

sudo virsh domifaddr microshift-starter

First, copy your pull secret file to the MicroShift virtual machine using redhat:redhat credentials.

USHIFT_IP=192.168.122.2
scp ~/.pull-secret.json redhat@${USHIFT_IP}:

Log into the MicroShift virtual machine using redhat:redhat credentials. Run the following commands to configure CRI-O for using the pull secret and start the MicroShift service.

sudo cp ~redhat/.pull-secret.json /etc/crio/openshift-pull-secret
sudo systemctl enable --now microshift.service

Proceed by configuring MicroShift access for the redhat user account.

mkdir ~/.kube
sudo cat /var/lib/microshift/resources/kubeadmin/kubeconfig > ~/.kube/config

Finally, check if MicroShift is up and running by executing oc commands.

When started for the first time, it may take a few minutes to download and initialize the container images used by MicroShift. On subsequent restarts, all the MicroShift services should take a few seconds to become available.

oc get cs
oc get pods -A