1.5. Running the MicroShift bootc container
Run your MicroShift bootc container to explore its reduced complexity and experiment with new capabilities and dependencies.
Prerequisites
- A Red Hat Enterprise Linux (RHEL) 9.4 host with an active Red Hat subscription for building MicroShift bootc images and running containers.
-
You are logged into the RHEL 9.4 host using the user credentials that have
sudopermissions. - You have a pull secret file for downloading the required MicroShift container images.
Procedure
Run the container for the MicroShift service by entering the following command:
PULL_SECRET=~/.pull-secret.json IMAGE_NAME=microshift-4.17-bootc $ sudo podman run --rm -it --privileged \ -v "${PULL_SECRET}":/etc/crio/openshift-pull-secret:ro \ -v /var/lib/containers/storage:/var/lib/containers/storage \ --name "${IMAGE_NAME}" \ "${IMAGE_NAME}"注記The
systemd-modules-loadservice fails to start in the container if the host kernel version is different from the bootc image kernel version. This failure can be safely ignored as all the necessary kernel modules have been loaded by the host.- A login prompt is presented in the terminal after MicroShift has started.
- Log into the running container using the your user credentials.
Verify that all the MicroShift pods are up and running without errors by running the following command:
$ watch sudo oc get pods -A \ --kubeconfig /var/lib/microshift/resources/kubeadmin/kubeconfigExample output
NAMESPACE NAME READY STATUS RESTARTS AGE kube-system csi-snapshot-controller-7cfb9df49c-kc9dx 1/1 Running 0 31s kube-system csi-snapshot-webhook-5c6b978878-jzk5r 1/1 Running 0 28s openshift-dns dns-default-rpnlt 2/2 Running 0 14s openshift-dns node-resolver-rxvdk 1/1 Running 0 31s openshift-ingress router-default-69cd7b5545-7zcw7 1/1 Running 0 29s openshift-ovn-kubernetes ovnkube-master-c7hlh 4/4 Running 1 (16s ago) 31s openshift-ovn-kubernetes ovnkube-node-mkpht 1/1 Running 1 (17s ago) 31s openshift-service-ca service-ca-5d5d96459d-5pd5s 1/1 Running 0 28s openshift-storage topolvm-controller-677cbfcdb9-28dqr 5/5 Running 0 31s openshift-storage topolvm-node-6fzbl 3/3 Running 0 14s- Now you can use your MicroShift running in the container the same way you can use any other MicroShift cluster.
1.5.1. Accessing the MicroShift node remotely リンクのコピーリンクがクリップボードにコピーされました!
Use the following procedure to access the MicroShift service from a remote location 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 installed OpenShift CLI (
oc). -
The
user@microshifthas opened the firewall from the local host. -
You generated additional
kubeconfigfiles.
Procedure
As
user@workstation, create a~/.kube/folder if your Red Hat Enterprise Linux (RHEL) machine does not have one by running the following command:[user@workstation]$ mkdir -p ~/.kube/As
user@workstation, set a variable for the hostname of your MicroShift host by running the following command:[user@workstation]$ MICROSHIFT_MACHINE=<name or IP address of MicroShift machine>As
user@workstation, copy the generatedkubeconfigfile that contains the hostname or IP address you want to connect to from the RHEL machine running MicroShift to your local machine by running the following command:[user@workstation]$ ssh <user>@$MICROSHIFT_MACHINE "sudo cat /var/lib/microshift/resources/kubeadmin/$MICROSHIFT_MACHINE/kubeconfig" > ~/.kube/config1 - 1
- Replace <user> with your SSH login credentials.
As
user@workstation, update the permissions on your~/.kube/configfile by running the following command:$ chmod go-r ~/.kube/config
Verification
As
user@workstation, verify that MicroShift is running by entering the following command:[user@workstation]$ oc get all -A