hcloud-fip-controller: Can't get floating IP and fipcontroller going
Hi,
I’m following along with this: https://community.hetzner.com/tutorials/install-kubernetes-cluster
Basically I have a fully functional cluster (all nodes an deployments healthy, all pods up and running) but can’t get the floating IP and fipcontroller to work. After 2 full days I think its time to file an issue 😃
When I try to install the fipcontroller via the above link or the below slightly different instructions (daemonset or deployment doesn’t matter, same issue): https://github.com/cbeneke/hcloud-fip-controller/blob/master/README.md
The fipcontroller pods keep restarting with this in the logs:
henkies@kube01] ~ $ kubectl -n fip-controller logs fip-controller-tlvxm
I0301 18:08:34.024801 1 leaderelection.go:235] attempting to acquire leader lease fip-controller/fip...
I0301 18:08:34.049756 1 leaderelection.go:245] successfully acquired lease fip-controller/fip
time="2020-03-01T18:08:34Z" level=info msg="Started leading" func="github.com/cbeneke/hcloud-fip-controller/internal/app/fipcontroller.(*Controller).onStartedLeading" file="/app/internal/app/fipcontroller/leaderelection.go:53"
time="2020-03-01T18:08:34Z" level=fatal msg="Could not run controller: could not get kubernetes node address: could not find address for node kube02.mydomain.com" func="github.com/cbeneke/hcloud-fip-controller/internal/app/fipcontroller.(*Controller).onStartedLeading" file="/app/internal/app/fipcontroller/leaderelection.go:56"
The culprit seamlingly being:
could not find address for node kube02.mydomain.com
But why I do not understand. DNS is OK on the host and in the cluster, coreDNS is running, I’m out of options.
On a side note, once again following the guide at: https://community.hetzner.com/tutorials/install-kubernetes-cluster
Should the floating IP not be active at this point? vipcontroller is only for moving the IP, no? I’m wondering since I’ve created a test service of type LoadBalancer and does not get the Hetzner floating IP.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (6 by maintainers)
Hi all,
just wanted to put some details about the new Hetzner Ubuntu 20.04 image. It uses netplan instead of ifupdown as the tool to configure networking.
The official docs from Hetzner states that a
/etc/netplan/60-floating-ip.yaml
should be created with the floating IP. That is also the case, but the list of addresses must also include the server IP address assigned by dhcp as the first entry. for docker (and hence also kubernetes) to work. An example is:Run
netplan apply
to apply the configuration.This will make sure that the server IP address remains the primary, i.e.
ifconfig eth0
shows the server IP address and not the floating IP.The floating IP becomes the primary IP if the dhcp assigned server IP address is not included in the list of addresses. This in turn sets the floating IP as source for outgoing traffic from within docker, resulting in no internet access within containers. This can be seen by running
tcpdump -ni eth0 icmp
together withdocker run --rm alpine ping -- 1.1.1.1
.OMG works instantly. Thank you for your help. It’s wrong in the guide, OK in the GitHub readme. I’ll do some more testing with Kubernetes 1.17 and different CNIs. I can report back I you would like.