Code Monkey home page Code Monkey logo

Comments (7)

costela avatar costela commented on May 26, 2024

Hi, thanks for the report!
Does "latest" mean v0.1.4 or master?
Also, could you please paste the stacktrace?

from hcloud-ip-floater.

fff0x avatar fff0x commented on May 26, 2024

That was a fast reply! Sorry, I meant version "v0.1.4".

This is all I got:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x6e7eba]

goroutine 84 [running]:
github.com/hetznercloud/hcloud-go/hcloud.(*FloatingIPClient).Assign(0xc000142248, 0x14db860, 0xc000046030, 0xc00058a640, 0x0, 0x0, 0xc0002118c0, 0x0, 0x0)
	github.com/hetznercloud/[email protected]/hcloud/floating_ip.go:276 +0x3a
github.com/costela/hcloud-ip-floater/internal/fipcontroller.(*Controller).attachFIPToNode(0xc0002529a0, 0xc00058a640, 0xc000047730, 0x8, 0xc0000bc748, 0x1)
	github.com/costela/hcloud-ip-floater@/internal/fipcontroller/fipcontroller.go:203 +0x10f
github.com/costela/hcloud-ip-floater/internal/fipcontroller.(*Controller).Reconcile.func1(0x0, 0x0, 0x0, 0x0)
	github.com/costela/hcloud-ip-floater@/internal/fipcontroller/fipcontroller.go:153 +0x287
golang.org/x/sync/singleflight.(*Group).doCall(0xc000252a00, 0xc000588910, 0x1302267, 0xe, 0xc0005f6650)
	golang.org/x/[email protected]/singleflight/singleflight.go:93 +0x2e
created by golang.org/x/sync/singleflight.(*Group).DoChan
	golang.org/x/[email protected]/singleflight/singleflight.go:86 +0x2b4

from hcloud-ip-floater.

costela avatar costela commented on May 26, 2024

Could you please try v0.1.5-rc.1?

from hcloud-ip-floater.

fff0x avatar fff0x commented on May 26, 2024

Using version 'v0.1.5-rc.1', the error message is gone, but I got the following new one, when the floating IP is not attached to the node where the "loadbalancer" service is listening on:

time="2020-05-20T09:31:14Z" level=error msg="could not attach floating IP" component=fipcontroller error="could not find node minion-1" fip=116.200.XXX.XXX node=minion-1

Unfortunately the controller does not switch the IP address itself. I had to do it manually, but there are no other logs.

Edit:
I have to correct myself, the message above is shown always, even if the ip is attached to the correct node. I also tried rc.2 but it seems nothing has changed.

Edit2:
minion-1 would be the correct node, but the local hostname (and the K8s nodename) differs from the name in the hetzner cloud. And I see requests against the wrong server name. Let me try to rename it in the web frontend.

From the debug output:

https://api.hetzner.cloud/v1/servers?name=minion-1&page

I was waiting for the pod to recheck the assignment, but it did not happend, maybe I had to wait a little bit longer. Then I switched the floating IP from the correct node to the wrong one and the controller wrotes:

time="2020-05-20T10:20:11Z" level=info msg="attached floating IP" component=fipcontroller fip=116.202.XXX.XXX node=minion-1

But nothing happend, the web UI continues to show that the IP was assigned to the wrong node (my choice).

But after I deleted the controller pod, the Ip was instantly assigned to the correct node! Many thanks. So a workaround would be, to rename all nodes in the hcloud UI by its hostname or vice versa. But to make it bulletproof, I'm sure there is a better method of getting the "real" name of the current node.

However, I appreciate your work!

from hcloud-ip-floater.

costela avatar costela commented on May 26, 2024

k8s node names must currently match the hcloud node names. This is the default behavior if no hostname renaming is taking place, but it should probably be better documented as a requirement.

There's unfortunately no other practicable way I'm aware of, for hcloud-ip-floater to match a k8s node to a hcloud node. We could use node annotations for this, but then these would have to be managed during k8s provisioning. I'm not sure this is worth the trouble, because I can't think of a reason for node renaming.
What's your use-case for it? Maybe I'm missing something.

from hcloud-ip-floater.

fff0x avatar fff0x commented on May 26, 2024

Thank you, and sorry, I wasn't aware of, that the hostname must match. After a short dive into the hcloud API, I also didn't see an easy solution to get informations of the current node, if the hostname differs. I guess there isn't a real usecase, for using different namens :) That only happend to me, when I was changing my terraform templates. I reverted it, and everything works fine, I'm pretty happy with it!

from hcloud-ip-floater.

costela avatar costela commented on May 26, 2024

No need to apologize, that requirement wasn't documented anywhere until
836cc83! 😉

from hcloud-ip-floater.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.