This document describes how I setup a CodeReady Container (CRC) 1.31.x environment for remote development. While this information is available in multiple documents from Red Hat, I corrected the minor errors in the official documentation and distilled it into a single page for ease of use.
Fedora virtual machine.
Virtual machine settings:
6 vCPU
24 GB RAM
Running on less vCPU and RAM gave me problems with the operators
120 GB HD
Virtualization enabled on virtual machine
Software
Red Hat CodeReady Containers 1.31 (equivalent to OCP 4.5.14)
Remote computer:
Browser
piHole
On the Fedora virtual machine, configure the cluster memory and cpu allocations.
$ ./crc setup
$ ./crc config set memory 16384
$ ./crc config set cpus 4
Start the cluster and set the nameserver.
$ ./crc start -n 192.168.XXX.XXX
Get CRC URL
./crc console --url
https://console-openshift-console.apps-crc.testing
Get CRC credentials
./crc console --credentials
To login as a regular user, run 'oc login -u developer -p developer https://api.crc.testing:6443'.
To login as an admin, run 'oc login -u kubeadmin -p XXXXX-XXXXX-XXXXX-XXXXX https://api.crc.testing:6443'
Log into CRC from remote computer as kubeadmin:
$ oc login -u kubeadmin -p GENERATED_PASSWORD https://api.crc.testing:6443 -n openshift
This will log you into CRC and set the active project/namespace to openshift. Please note that it is very important that you set the project before you start to configure CRC.
Network setup instructions can be found here:
The steps here document where my configuration differs from the aforementioned instructions.
hostname
crc.testing
If it's not crc.testing change it
hostnamectl set-hostname crc.testing
sudo dnf install haproxy policycoreutils-python-utils jq
$ sudo systemctl start firewalld
$ sudo firewall-cmd --add-port=80/tcp --permanent
$ sudo firewall-cmd --add-port=6443/tcp --permanent
$ sudo firewall-cmd --add-port=443/tcp --permanent
$ sudo systemctl restart firewalld
$ sudo semanage port -a -t http_port_t -p tcp 6443
$ sudo cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.bak
$ export CRC_IP=$(crc ip)
$ export CRC_IP=$(crc ip)
$ sudo tee /etc/haproxy/haproxy.cfg &>/dev/null <<EOF
global
log /dev/log local0
defaults
balance roundrobin
log global
maxconn 100
mode tcp
timeout connect 5s
timeout client 500s
timeout server 500s
listen apps
bind 0.0.0.0:80
server crcvm $CRC_IP:80 check
listen apps_ssl
bind 0.0.0.0:443
server crcvm $CRC_IP:443 check
listen api
bind 0.0.0.0:6443
server crcvm $CRC_IP:6443 check
EOF
Follow the instructions here to configure DNS on PiHole for CRC:
https://www.sangiorgiosystems.com/home/notes/pihole-dns-setup
Follow the instructions here:
Follow the instructions here: