hashicorp / go-discover

Discover nodes in cloud environments
Mozilla Public License 2.0
563 stars 123 forks source link

feat: add hetzner cloud provider #167

Open Thunderbottom opened 3 years ago

Thunderbottom commented 3 years ago

adds a provider for hetzner cloud that does:

Enhancement over: #159 Closes: #73

hashicorp-cla commented 3 years ago

CLA assistant check
All committers have signed the CLA.

svenstaro commented 3 years ago

Could we get this merged?

laukaichung commented 3 years ago

While waiting for it to be merged, is there any way for now to automatically get a list of private IPs for the retry_join field without hardcoding a list of IPs? I'm planning to run a consul cluster on Hetzner Cloud with private network. It seems that GetPrivateIPs from go-sockaddr, e,g retry_join={{ GetPrivateIPs }} would work but I''m not sure how to use it in the config.

dnephin commented 3 years ago

I don't think there is any support for that yet, but https://github.com/hashicorp/consul/issues/9100 is a proposal that should make it possible.

vitamindit commented 3 years ago

While waiting for it to be merged, is there any way for now to automatically get a list of private IPs for the retry_join field without hardcoding a list of IPs? ...

I'm waiting for it too :) ... here is my approach:

You get private IP addresses once the server is assigned to a network or subnet.

Then you should use e.g. the hcloud server-info API. This will return the available servers including their private IP addresses for available interfaces.

From this server-info response you can then construct the list of desired private cluster IP addresses.

KevinGimbel commented 3 years ago

What's blocking this PR from being merged? I'm currently evaluating Consul for work and I'd love to use/try the auto-discovery feature as part of this PoC.

gardion commented 3 years ago

Please merge, it would massively help adopting Consul for our platform.

tomschlenkhoff commented 3 years ago

Any help needed? Any blockers left? If not please (with sugar on top) merge, would be a boost for Consul/Hetzner adoption in Germany/EU.

Thunderbottom commented 3 years ago

I believe there's no blockers, although the repo hasn't been updated since last year. So I'm not sure if it'll be merged any time soon.

ronaldburns commented 2 years ago

This is a feature we need for our infrastructure. It doesn't appear like it's going to be committed anytime soon. We've forked this and made a fix or two.

go-discover consul

If you'd like to immediately use this implementation, binaries have been added for the latest releases.

Consul 1.11.3 (hcloud)

Consul 1.11.4 (hcloud)

Consul 1.12.0-beta1 (hcloud)

devnet-io commented 2 years ago

What are the blockers on getting this merged? This will be very useful for my org. Happy to assist with what is needed.

KrakenMare commented 2 years ago

Echoing the above. It would be fantastic to see this merged or insight into what is needed for a merge.

pugnacity commented 2 years ago

any news here?

marco-m commented 2 years ago

Hello @dnephin, @riddhi89, @alvin-huang, we were almost there with #159 :-), then after a while @Thunderbottom dared to summon the skeleton (just past-Halloween pun) and did this second attempt. I understand very well that you are fully loaded, but if you could spare a moment to review this PR many of us would be happy. Thanks again! @Thunderbottom would you have time to resolve the conflicts, to ease the work of the HashiCorp reviewers? Merci!

acaloiaro commented 1 year ago

FYI @Thunderbottom I can't imagine you're enthusiastic to do more work on this PR since it hasn't been re-reviewed yet, but in case you are -- a merge conflict has occurred.

Thunderbottom commented 1 year ago

Hi, haven't gotten the time to check GitHub that often anymore. I have fixed all the issues and rebased to the latest master. let me know if anything else needs to be done.

svenstaro commented 1 year ago

@riddhi89 Any chance we could get this merged?

Neyury commented 1 year ago

Any updates?

Neyury commented 1 year ago

Hello! @alvin-huang any chance you could review this PR? Or do you have somebody else from HashiCorp to suggest? I really want to see Hetzner Cloud in go-discovery so that Сonsul and Nomad could use auto-join. Thanks!

acaloiaro commented 1 year ago

@Neyury If you're desperate to use @Thunderbottom's patch, you can do what I did and fork nomad and add a replace to its go.mod as I've done here: https://github.com/hashicorp/nomad/commit/332c3e447d1d5fd55375b0bb28ce015a486d81e6

Then my server.server_join stanza looks like:

  server_join {
    retry_join = [ "provider=hcloud label_selector=nomad-server apiToken=${hetzner_compute_access_token}" ]
  }

Note: You'll want to label your nomad server compute nodes with nomad-server to use the above.

I've been running a hetzner nomad cluster this way for over 6 months. I do recommend pinning your fork to a tagged version of nomad, however.

I have a 1.4.x nomad build with patched go-discover here: https://github.com/acaloiaro/nomad/releases/tag/v1.4.x

You really should not use binaries from unknown strangers on the internet. But feel free to use it in a dev/test environment if you feel that it's sufficiently isolated from the rest of your infrastructure

tagirb commented 1 year ago

Hi Yuriy, thanks for taking care of this feature, also very interested in it. I'd suggest involving @LKaemmerling from Hetzner for this.

acaloiaro commented 1 year ago

Hashicorp are "semi-actively moving our repos to https://github.com/hashicorp/go-netaddr".

I emailed a member of their team to learn about the status of this repository. Those are the words of one individual, but you can see from the project activity that the project is not under heavy development.

Anyone waiting for this or other features to land in go-discover should probably not hold their breath about them being added to go-discover. It sounds like this project has become too brittle and difficult to maintain, motivating the migration to go-netaddr. An understandable move given this project's dependencies.

With that said, I don't see how go-netaddr replaces go-discover's cloud host-aware functionality. go-netaddr seems like a nice complement to, but not replacement for go-discover.

kaspergrubbe commented 3 months ago

Hello from 2024, I also hit this in my own setup, and would have loved for go-discover to support hcloud.