Openshift Code Ready Containers Remote Access

Posted by Swapan Chakrabarty on February 9, 2022

install and configure haproxy to route remote crc connections from remote browsers

update /etc/haproxy/haproxy.cfg with below

run crc ip and update below

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
global
debug

defaults
log global
mode http
timeout connect 0
timeout client 0
timeout server 0

frontend apps
bind 192.168.1.222:80
bind 192.168.1.222:443
option tcplog
mode tcp
default_backend apps

backend apps
mode tcp
balance roundrobin
option ssl-hello-chk
server webserver1 192.168.130.11 check

frontend api
bind 192.168.1.222:6443
option tcplog
mode tcp
default_backend api

backend api
mode tcp
balance roundrobin
option ssl-hello-chk
server webserver1 192.168.130.11:6443 check
1
systemctl restart haproxy

on a windows laptop update etc\hosts

%SystemRoot%\System32\drivers\etc\hosts

with the following:

1
192.168.1.222 api.crc.testing oauth-openshift.apps-crc.testing console-openshift-console.apps-crc.testing default-route-openshift-image-registry.apps-crc.testing

now codeready containers is reachable from web browsers runing on remote hosts like laptops

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

oc client console access should also now be available from remote hosts

1
oc login --token=sha256~_ks799Hw6XaZJRjlCA2V38r9jOelNT5TRaNANnnRPI8iiuy78 --server=https://api.crc.testing:6443