kubernetesvagrantargocd

Can't access ArgoCD UI that is in a VM with port forwarding set in vagrant file


I have setup a kubernetes cluster with kubeadm with a 3 node vagrant setup. I have installed ArgoCD and when I use vagrant ssh into the kubemaster vm, I can run:

kubectl port-forward svc/argocd-server -n argocd 8080:443

And I can curl it in the ssh session successfully with:

curl -k https://localhost:8080

I have a static ip for the nodes with the master being 192.168.56.2, and a port forward set for that vm

config.vm.define "kubemaster" do |node|
    ...
    node.vm.network :private_network, ip: 192.168.56.2
    node.vm.network "forwarded_port", guest: 8080, host: 8080
    ...
end

On the host I try to access ArgoCD UI in browser with:

https://localhost:8080
https://192.168.56.2:8080

And I get connection refused

What am I missing?

Edit:

The nodes are running ubuntu 22 and ufw is not enabled. Im running on a Mac


Solution

  • It turns out I needed to add the address flag to the port forwarding command

    // from
    kubectl port-forward svc/argocd-server -n argocd 8080:443
    
    // to
    kubectl port-forward --address 0.0.0.0 svc/argocd-server -n argocd 8080:443