crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.25k stars 235 forks source link

CRC , How to access web console from remote #4262

Open bentech4u opened 2 months ago

bentech4u commented 2 months ago

Hi,

i have installed CRC local on a virtual machine (redhat) , locally (from red hat) i can be able to access through OC.

How can i access web console from outside, let say from my laptop which has reachability . i have tried nginx method, and it didn't worked

Host so IP: 192.168.68.123 Hosts entry:

# Added by CRC
192.168.130.11   api.crc.testing canary-openshift-ingress-canary.apps-crc.testing console-openshift-console.apps-crc.testing default-route-openshift-image-registry.apps-crc.testing downloads-openshift-console.apps-crc.testing oauth-openshift.apps-crc.testing
# End of CRC section

here is my nginx configuration:

server {
    listen 80;
    server_name crc-proxy.local;

    location / {
        proxy_pass https://console-openshift-console.apps-crc.testing;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # SSL settings
        proxy_ssl_verify off;
        proxy_ssl_protocols TLSv1.2 TLSv1.3;
    }
}

server {
    listen 80;
    server_name console-openshift-console.apps-crc.testing oauth-openshift.apps-crc.testing default-route-openshift-image-registry.apps-crc.testing downloads-openshift-console.apps-crc.testing canary-openshift-ingress-canary.apps-crc.testing;

    location / {
        proxy_pass https://$host$request_uri;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # SSL settings
        proxy_ssl_verify off;
        proxy_ssl_protocols TLSv1.2 TLSv1.3;
    }
}
cfergeau commented 1 month ago

There is a sample haproxy config file documented in https://crc.dev/crc/getting_started/getting_started/networking/#_setting_up_crc_on_a_remote_server