Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

[root@snk ~]# dnf install qemu-kvm libvirt virt-install virt-viewer -y

Updating Subscription Management repositories.


Last metadata expiration check: 0:11:52 ago on Fri 15 Jul 2022 13:59:28.
Dependencies resolved.
================================================================================
.....................

SUBSCRIBE & BE UPDATED

[root@sno ~]# systemctl start libvirtd

[root@sno ~]# systemctl status libvirtd


● libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; disabled; vendor>
Active: active (running) since Fri 2022-07-15 14:13:00 WAT; 2s ago
TriggeredBy: ● libvirtd-ro.socket
..................................

[root@sno ~]# dnf install @virt -y

Updating Subscription Management repositories.


Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 3.3 kB/s | 4.1 kB
00:01
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 747 B/s | 4.5 kB
00:06
Dependencies resolved.
..................................

[root@sno ~]# systemctl restart libvirtd


[root@sno ~]# wget https://developers.redhat.com/content-gateway/rest/mirror
/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz

--2022-07-14 13:06:20-- https://developers.redhat.com/content-gateway/rest/mirror


/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz
........................

[root@sno ~]# ls

anaconda-ks.cfg Desktop Downloads Music Public


Videos
crc-linux-amd64.tar.xz Documents initial-setup-ks.cfg Pictures Templates

[root@sno ~]# tar xvf crc-linux-amd64.tar.xz

crc-linux-2.5.1-amd64/
crc-linux-2.5.1-amd64/LICENSE
crc-linux-2.5.1-amd64/crc

[root@sno ~]# ls

anaconda-ks.cfg Desktop initial-setup-ks.cfg Public


crc-linux-2.5.1-amd64 Documents Music Templates
crc-linux-amd64.tar.xz Downloads Pictures Videos

[root@sno ~]# chmod +x crc-linux-2.5.1-amd64/crc

[root@sno ~]# cp crc-linux-2.5.1-amd64/crc /usr/local/bin

[victor@sno ~]$ crc version


CRC version: 2.5.1+3d569b8
OpenShift version: 4.10.18
Podman version: 4.1.0

[root@sno ~]# usermod -aG libvirt victor

[root@sno ~]# usermod -aG wheel victor

[root@sno ~]# id victor

uid=1000(victor) gid=1000(victor) groups=1000(victor),10(wheel),981(libvirt)

[root@sno ~]# ssh victor@localhost

The authenticity of host 'localhost (::1)' can't be established.


ECDSA key fingerprint is SHA256:1b+fFpvcXKQU4MQUnvcqKbUKfgpKUj4CmG/1FeNOlks.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
victor@localhost's password:

[victor@sno ~]$

[victor@sno ~]$ crc setup

CRC is constantly improving and we would like to know more about usage (more
details at https://developers.redhat.com/article/tool-data-collection)
............................
INFO Using bundle path /home/victor/.crc/cache/crc_libvirt_4.10.18_amd64.crcbundle
INFO Checking if running as non-root
...............................
INFO Getting bundle for the CRC executable
INFO Downloading crc_libvirt_4.10.18_amd64.crcbundle
3.13 GiB / 3.13 GiB [----------------------------------------------------] 100.00%
...............................
Your system is correctly setup for using CRC. Use 'crc start' to start the
instance

[victor@sno ~]$ crc start

INFO Checking if running as non-root


INFO Checking if running inside WSL2
.............................
CRC requires a pull secret to download content from Red Hat.
You can copy it from the Pull Secret section of https://console.redhat.com
/openshift/create/local.
? Please enter the pull secret
...............................
INFO Creating CRC VM for OpenShift 4.10.18...
INFO Generating new SSH key pair...
INFO Generating new password for the kubeadmin user
INFO Starting CRC VM for OpenShift 4.10.18...
..................................
INFO Adding crc-admin and crc-developer contexts to kubeconfig...
Started the OpenShift cluster.

The server is accessible via web console at:


https://console-openshift-console.apps-crc.testing

Log in as administrator:
Username: kubeadmin
Password: W37tT-ziN3T-eE6VP-q6Yt9

Log in as user:
Username: developer
Password: developer

Use the 'oc' command line interface:


$ eval $(crc oc-env)
$ oc login -u developer https://api.crc.testing:6443

[victor@sno ~]$ crc status

CRC VM: Running


OpenShift: Running (v4.10.18)
Podman:
Disk Usage: 15.09GB of 32.74GB (Inside the CRC VM)
Cache Usage: 16.87GB
Cache Directory: /home/victor/.crc/cache

[victor@sno ~]$ oc

bash: oc: command not found...

[victor@sno ~]$ crc oc-env

export PATH="/home/victor/.crc/bin/oc:$PATH"
# Run this command to configure your shell:
# eval $(crc oc-env)

[victor@sno ~]$ eval $(crc oc-env)


[victor@sno ~]$ oc

OpenShift Client

This client helps you develop, build, deploy, and run your applications on any
OpenShift or Kubernetes cluster. It also includes the administrative
commands for managing a cluster under the 'adm' subcommand.

To familiarize yourself with OpenShift, login to your cluster and try creating a
sample application:

oc login mycluster.mycompany.com
oc new-project my-example
oc new-app django-psql-example
oc logs -f bc/django-psql-example
.............................

[victor@sno ~]$ oc login -u kubeadmin -p W37tT-ziN3T-eE6VP-q6Yt9


https://api.crc.testing:6443

Login successful.

You have access to 64 projects, the list has been suppressed. You can list all
projects with 'oc projects'

Using project "default".

[victor@sno ~]$ oc get all

NAME TYPE CLUSTER-IP EXTERNAL-IP


PORT(S) AGE
service/kubernetes ClusterIP 10.217.4.1 <none>
443/TCP 23d
service/openshift ExternalName <none>
kubernetes.default.svc.cluster.local <none> 23d

[victor@sno ~]$ oc get nodes

NAME STATUS ROLES AGE VERSION


crc-5nvrm-master-0 Ready master,worker 23d v1.23.5+3afdacb

[victor@sno ~]$ oc login -u developer https://api.crc.testing:6443

Logged into "https://api.crc.testing:6443" as "developer" using existing


credentials.

You don't have any projects. You can try to create a new project, by running

oc new-project <projectname>
POST COMMENT

You might also like