Home > Enterprise >  Forward requests to minikube ip (how to access application deployed in minikube from remote computer
Forward requests to minikube ip (how to access application deployed in minikube from remote computer

Time:09-28

There are two machines in my local network. Computer 1 (192.168.1.100) is a common Windows machine. Computer 2 (192.168.1.200) has Debian, Docker engine and Minikube. Minikube ip is 192.168.49.2. I set up an Ingress controller for my k8s cluster and run app deploy with service, which is linked to ingress. Now I would like to access from my computer 1 to the deployed application. It looks like I need ip/port forwarding from the computer 2 ip to minikube ip. I tried nginx (as a reverse server) and iptables, however no success. Please let me know if I am wrong in my judgement and advise how to get access from computer 1 to my application deployed in minikube k8s cluster.

CodePudding user response:

Finally solved the issue. Just created Nginx server as a reverse-proxy with the following config:

server {
  listen 80;
  server_name my-web-site.com;
  location / {
    include '/etc/nginx/proxy_params';
    proxy_pass http://192.168.49.2:80/;
  }
}

server {
        listen 443 ssl;
        listen [::]:443 ssl;
        server_name my-web-site.com;

        ssl_certificate          /home/myuser/cert/file.pem;
        ssl_certificate_key      /home/myuser/cert/file.key;

       location / {
               proxy_set_header   X-Forwarded-For $remote_addr;
               proxy_set_header   Host $http_host;
               proxy_pass         https://192.168.49.2:443;
       }

}
  • Related