canonical / microk8s

MicroK8s is a small, fast, single-package Kubernetes for datacenters and the edge.
https://microk8s.io
Apache License 2.0
8.42k stars 768 forks source link

add-node not work. #4122

Open luoxiaopeng opened 1 year ago

luoxiaopeng commented 1 year ago

I have two vps installed Microk8s. (with sudo snap install microk8s --classic --channel=1.27) I run command add-node on one vps(Ubuntu 20). It show: microk8s join 192.168.0.148:25000/... microk8s join 192.168.0.148:25000/... --worker

Absolute, the ip is not correct, I use vps ip to replace it. then run command on another vps(Ubuntu 22) But I recived response: Contacting cluster at 139.159.217.250 Connection failed. Failed to find matching dqlite bind address for 139.159.217.250:25000: address 139.159.217.250 was not found in any host interface. refuse to update dqlite bind address to 139.159.217.250 as it would break the cluster (500).

Did I miss something?

sachinkumarsingh092 commented 1 year ago

Hi @luoxiaopeng, did you try out the join command given by add-node?

luoxiaopeng commented 1 year ago

Yes, because I use multi-cloud (two vps on different verdon), maybe I need gopaddle?

neoaggelos commented 1 year ago

Hi @luoxiaopeng. You should ensure that the two VMs are part of the same L3 network for MicroK8s to work correctly. If this is on different vendors, perhaps setting up a VPN between the two sites could be an option.

luoxiaopeng commented 1 year ago

I would be very happy if microk8s natively supports multi-cloud, after all k3s supports it.

neoaggelos commented 1 year ago

Hi @luoxiaopeng multi-cloud works, but in both microk8s and k3s you need to some manual actions to setup a VPN connection between the VMs. WireGuard or OpenVPN are common options to do this.

Afterwards, you should be able to use microk8s add-node on one side and then microk8s join $VPNIP/... to create a cluster.

pishangujeniya commented 4 months ago

Hi @luoxiaopeng multi-cloud works, but in both microk8s and k3s you need to some manual actions to setup a VPN connection between the VMs. WireGuard or OpenVPN are common options to do this.

Afterwards, you should be able to use microk8s add-node on one side and then microk8s join $VPNIP/... to create a cluster.

@neoaggelos If we have port opened between all nodes via public IPs of the nodes, Do we still need OpenVPN for this? Because I am trying out to create a cluster with nodes spread across multiple vendors of cloud service providers via Public IP, and I am able to successfully join the nodes via public IP, but somehow the pods assigned to other nodes, are not able to resolve the DNS.

comment ref 1

comment ref 2