darxkies / k8s-tew

Kubernetes - The Easier Way
GNU General Public License v3.0
307 stars 38 forks source link

how does vagrant setup for k8s-tew to expose to public domain #35

Closed entrymon closed 2 years ago

entrymon commented 3 years ago

I followed all instructions and got the server running but not able to connect to server

networking service/ingress-nginx-controller LoadBalancer 10.32.0.60 192.168.120.200 80:32679/TCP,443:32070/TCP 34m

My public IP is different and how to route traffic from public IP to server?

My server is remote and ubuntu bare metal server and can't really access dashboard or anything as no default browser exists.

In my config

public-network: 192.168.120.0/24
...
metallb-addresses: 192.168.120.200/32

here is my ingress config

kubectl get ingress -A
NAMESPACE   NAME                        CLASS    HOSTS                    ADDRESS           PORTS     AGE
showcase    cm-acme-http-solver-24mmx   <none>   wordpress.entrymon.com   192.168.120.200   80        130m
showcase    wordpress                  nginx    wordpress.entrymon.com   192.168.120.200   80, 443   131m

here is the multi node cluster nodes

kubectl get nodes -o wide
NAME           STATUS   ROLES            AGE    VERSION   INTERNAL-IP       EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION     CONTAINER-RUNTIME
controller00   Ready    master           163m   v1.21.5   192.168.120.200   <none>        Ubuntu 20.04.2 LTS   5.4.0-80-generic   containerd://1.5.5
controller01   Ready    master           163m   v1.21.5   192.168.120.201   <none>        Ubuntu 20.04.2 LTS   5.4.0-80-generic   containerd://1.5.5
controller02   Ready    master           163m   v1.21.5   192.168.120.202   <none>        Ubuntu 20.04.2 LTS   5.4.0-80-generic   containerd://1.5.5
worker00       Ready    storage,worker   162m   v1.21.5   192.168.120.100   <none>        Ubuntu 20.04.2 LTS   5.4.0-80-generic   containerd://1.5.5
worker01       Ready    storage,worker   162m   v1.21.5   192.168.120.101   <none>        Ubuntu 20.04.2 LTS   5.4.0-80-generic   containerd://1.5.5
darxkies commented 3 years ago

For that case you can use socat to forward the traffic to the VirtualBox VM ports.

Here is an example:

https://github.com/darxkies/k8s-tew/blob/master/setup/multipass/Makefile#L52

To find out the ports and the username and the password for the dashboards you can use the "k8s-tew dashboard" sub-command.

VirtualBox VMs are mainly used to test k8s-tew.