action #128579
opencoordination #107755: [containers][epic] BCI testing on OpenShift
[containers] OpenShift Local PoC
Added by jlausuch about 2 years ago. Updated 6 months ago.
0%
Description
There is a way to deploy an OpenShift cluster locally:
https://access.redhat.com/documentation/en-us/red_hat_openshift_local/2.5/html/getting_started_guide/index
This could be used for testing our BCI containers on OpenShift platform, even though it's a local one.
The requirements for this deployment are quite significant:
- 4 physical CPU cores
- 9 GB of free memory
- 35 GB of storage space
But this shouldn't be a problem in OSD environment.
This PoC consists on trying this out on a CentOS VM and see if it's feasible to have a pre-installed qcow2 image ready to use OpenShift and test the BCI image on it.
Updated by jlausuch about 2 years ago
I have created a CentOS9 VM with 40GB disk and managed to run crc setup
successfully.
One thing I need is the PULL SECRET, which is something individual for the RedHat portal account. I will use mine for now but would be nice to get a generic one.
Updated by jlausuch about 2 years ago
[bernhard@localhost ~]$ crc start
INFO Checking if running as non-root
INFO Checking if running inside WSL2
INFO Checking if crc-admin-helper executable is cached
INFO Checking if running on a supported CPU architecture
INFO Checking minimum RAM requirements
INFO Checking if crc executable symlink exists
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if active user/process is currently part of the libvirt group
INFO Checking if libvirt daemon is running
INFO Checking if a supported libvirt version is installed
INFO Checking if crc-driver-libvirt is installed
INFO Checking crc daemon systemd socket units
INFO Checking if systemd-networkd is running
INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists
INFO Checking if libvirt 'crc' network is available
INFO Checking if libvirt 'crc' network is active
INFO Loading bundle: crc_libvirt_4.12.9_amd64...
INFO Starting CRC VM for openshift 4.12.9...
INFO CRC instance is running with IP 192.168.130.11
INFO CRC VM is running
INFO Configuring shared directories
INFO Check internal and public DNS query...
INFO Check DNS query from host...
INFO Verifying validity of the kubelet certificates...
INFO Starting kubelet service
INFO Waiting for kube-apiserver availability... [takes around 2min]
Error waiting for apiserver: Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 124
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 1
(x7)
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 124
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 1
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 124
(x2)
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 1
(x2)
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 124
(x7)
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 1
(x2)
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err : Process exited with status 124
(x3)
Updated by jlausuch about 2 years ago
Looks like missing kubectl...
[bernhard@localhost ~]$ oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
error: stat /opt/kubeconfig: no such file or directory
Updated by jlausuch about 2 years ago
Now it works!
[bernhard@localhost ~]$ crc start
WARN A new version (2.18.0) has been published on https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/2.18.0/crc-linux-amd64.tar.xz
INFO Checking if running as non-root
INFO Checking if running inside WSL2
INFO Checking if crc-admin-helper executable is cached
INFO Checking if running on a supported CPU architecture
INFO Checking minimum RAM requirements
INFO Checking if crc executable symlink exists
INFO Checking if Virtualization is enabled
INFO Checking if KVM is enabled
INFO Checking if libvirt is installed
INFO Checking if user is part of libvirt group
INFO Checking if active user/process is currently part of the libvirt group
INFO Checking if libvirt daemon is running
INFO Checking if a supported libvirt version is installed
INFO Checking if crc-driver-libvirt is installed
INFO Checking crc daemon systemd socket units
INFO Checking if systemd-networkd is running
INFO Checking if NetworkManager is installed
INFO Checking if NetworkManager service is running
INFO Checking if /etc/NetworkManager/conf.d/crc-nm-dnsmasq.conf exists
INFO Checking if /etc/NetworkManager/dnsmasq.d/crc.conf exists
INFO Checking if libvirt 'crc' network is available
INFO Checking if libvirt 'crc' network is active
INFO Loading bundle: crc_podman_libvirt_4.4.1_amd64...
INFO Creating CRC VM for Podman 4.4.1...
INFO Generating new SSH key pair...
INFO CRC instance is running with IP 192.168.130.11
INFO CRC VM is running
INFO Updating authorized keys...
INFO Configuring shared directories
INFO Adding new bearer token for cockpit webconsole
podman runtime is now running.
Use the 'podman' command line interface:
$ eval $(crc podman-env)
$ podman-remote COMMAND
Updated by jlausuch about 2 years ago
Following this step:
crc oc-env
Only supported with OpenShift bundles
--> https://access.redhat.com/discussions/6895111
So, if I do:
crc config set preset openshift
crc delete
crc setup
crc start
I get the ssh errors from comment #2.
Anyway, this works:
[bernhard@localhost ~]$ crc oc-env
export PATH="/home/bernhard/.crc/bin/oc:$PATH"
# Run this command to configure your shell:
# eval $(crc oc-env)
But if I do:
crc config set preset podman
crc delete
crc setup
crc start
then I get the output from comment #4, but
[bernhard@localhost ~]$ crc oc-env
Only supported with OpenShift bundles
Updated by jlausuch almost 2 years ago
I have done very good progress, but I had to use a VM in openQA, as my local machine didn't have enough resources to cope with the deployment. After running it in openQA with 18GB RAM and 8CPUs I didn't get any deployment error.
I have created https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/17057
which handles the OpenShift cluster setup and creation, then it publishes an HDD which will be used by the tests with the pre-deployed OpenShift cluster.
The setup&creation is to be done once a week, so the CentOS host gets updated to the latest status and also new OpenShift versions can be also installed.
Updated by jlausuch almost 2 years ago
- Related to action #107761: [New test] Push container image to OpenShift internal registry added
Updated by jlausuch almost 2 years ago
- Related to action #107758: [New test] Create Kubernetes POD in OpenShift using custom image added
Updated by jlausuch almost 2 years ago
- Related to deleted (action #107761: [New test] Push container image to OpenShift internal registry)
Updated by jlausuch almost 2 years ago
- Related to deleted (action #107758: [New test] Create Kubernetes POD in OpenShift using custom image)
Updated by jlausuch almost 2 years ago
- Status changed from In Progress to Workable
- Assignee deleted (
jlausuch)