Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hetzner provider. #72

Merged
merged 11 commits into from
Jul 23, 2020
Merged

Hetzner provider. #72

merged 11 commits into from
Jul 23, 2020

Conversation

Johannestegner
Copy link
Contributor

@Johannestegner Johannestegner commented Jul 22, 2020

Description

This pull request contains code which allows for provisioning of the cheapest server type at Hetzner cloud to be used as an inlet end node.

I made the default region hel1 (Helsinki, Finland) and the server type is the cx11 (€2.49/month) with Ubuntu 20.04.

This should close #67 if accepted.

How Has This Been Tested?

I tested the provider manually multiple times on Windows 10 Pro and on Ubuntu 18.04 (via WSL2).
The following steps was taken:

  1. Docker container with nginx was set up with port 8000 exposed.
  2. Inletctl was ran with the new provider and available flags, using access token from Hetzner web interface.
  3. Visited the IP of the hertzner provisioned machine, which showed the correct nginx startup screen.
  4. Closed the docker container.
  5. Visited the IP of the hertzner provisioned machine, which no longer shows the nginx startup screen.
  6. Ran delete command and verified that the machine was in fact removed.

Edit after testing with latest commits:

Used the same procedure as above, with all available regions, with same successful result.

How are existing users impacted? What migration steps/scripts do we need?

No changes, only a new provider added.

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • read the CONTRIBUTION guide
  • signed-off my commits with git commit -s
  • added unit tests

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
@alexellis
Copy link
Member

Hi @Johannestegner thanks for the PR - it will be nice to have Hetzner available as an option for inlets users.

@zechenbit would you be able to review this patch please?

Alex

@alexellis
Copy link
Member

@Johannestegner could you test with inlets PRO?

Here's a license you can use:

Name:	Johannes Tegnér
Email:	johannes@jitesoft.com
Expires in: 3 days, on: 25 July 2020
Products: [inlets-pro]

Note: use text under the line
---
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiSm9oYW5uZXMgVGVnbsOpciIsImVtYWlsX2FkZHJlc3MiOiJqb2hhbm5lc0BqaXRlc29mdC5jb20iLCJwcm9kdWN0cyI6WyJpbmxldHMtcHJvIl0sImF1ZCI6Imp3dC1saWNlbnNlIiwiZXhwIjoxNTk1Njk2NDM4LCJqdGkiOiI4MDgxIiwiaWF0IjoxNTk1NDM3MjM4LCJpc3MiOiJqd3QtbGljZW5zZSIsInN1YiI6IkpvaGFubmVzIFRlZ27DqXIifQ.V_7iUi6nVL1v2sHaDz2uMJ3urXLbqtrnnj4ctfQHIzcFCFdX1dubG7vyYmL4elejAjX7KxDp6q0UxIiC3LKjCQ

The way to switch is to use --remote-tcp and a machine to proxy all ports to, 127.0.0.1 is useful for things running on your computer.

@alexellis
Copy link
Member

Please also update this file -> https://github.com/inlets/inletsctl/blob/master/pkg/provision/README.md

@Johannestegner
Copy link
Contributor Author

Will do! Just finishing off dinner real quick :)

…ete instead of throwing an exception.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
…rs/README.md

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
@Johannestegner
Copy link
Contributor Author

@alexellis took me a bit to figure out that I was using the wrong IP address of my local machine.... but when that was done, I could publish multiple services via the end node, so seems to work fine :)
Made a small fix to an uncaught error too which I will push up with the README file :)

README.md Show resolved Hide resolved
cmd/create.go Outdated Show resolved Hide resolved
pkg/provision/hetzner.go Outdated Show resolved Hide resolved
pkg/provision/hetzner.go Outdated Show resolved Hide resolved
@alexellis
Copy link
Member

@Johannestegner please take a look at the feedback by @zechenbit and if there is an Ubuntu 16.04 image, let's use that for consistency please?

@Johannestegner
Copy link
Contributor Author

@alexellis @zechenbit sending kids off with their grandma, then I'll take care of this :)

@alexellis
Copy link
Member

Thank you, it would be great to get this released before Friday end of play, so that I can include it in the Insiders Update for this week.

Removed default settings from the provider file, as they are already set in the create.go file.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
Added some comments to why a label is used on provisioned vps.
Added comments about where to find information about the Plan, OS and Regions for Hetzner.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>
@alexellis
Copy link
Member

Could you update "How Has This Been Tested?" with your results from re-testing with the new commits? 👍 thank you for the quick turn-around

Copy link
Member

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@Johannestegner
Copy link
Contributor Author

@alexellis Will do! Give me a couple of minutes :)

@Johannestegner
Copy link
Contributor Author

Could you update "How Has This Been Tested?" with your results from re-testing with the new commits? 👍 thank you for the quick turn-around

Worked just as well, I added a small comment, if you want me to show some logs or similar I will gladly add them too :)

@alexellis alexellis merged commit 8bc3d04 into inlets:master Jul 23, 2020
@Johannestegner
Copy link
Contributor Author

Thank you guys! Was fun to write some Go for a change! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposed provisioner: Hetzner
3 participants