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

Add support for IPv6 addresses #398

Open
CC007 opened this issue Dec 24, 2022 · 10 comments · May be fixed by #441
Open

Add support for IPv6 addresses #398

CC007 opened this issue Dec 24, 2022 · 10 comments · May be fixed by #441

Comments

@CC007
Copy link

CC007 commented Dec 24, 2022

Why do you need this?

My node only has a reachable IPv6 address, so I tried to use k3sup with the following command:

k3sup install --context <cluster context> --user <vm user> --ip <IPv6>

Expected Behaviour

I expect this to work the same way as for an IPv4 address

Current Behaviour

I get the following output:

Running: k3sup install
2022/12/24 xx:xx:xx <IPv6>
Public IP: <IPv6>
Error: unable to connect to <IPv6> over ssh: dial tcp: address <IPv6>:22: too many colons in address

Possible Solution

Add a -6 flag for when the user wants to provide an IPv6 address. In such cases it might also be needed to specify the network adapter, like <IPv6>%eth0. This seems to be the case for ssh, but not for ping, so you'd have to check if you need this.

Steps to Reproduce

  1. Download k3sup
  2. Run k3sup install --context <cluster context> --user <vm user> --ip <IPv6> (with everything between <> filled in ofc.)

Your Environment

  • k3sup version:
0.12.12
  • What Kubernetes distribution, client and server version are you using?
N/A
  • What OS or type or VM are you using for your cluster? Where is it hosted? (for k3sup install/join):

  • Operating System and version (e.g. Linux, Windows, MacOS):

Self-hosted. 
Host OS: Windows 11 22H2 (build: 22621.963), using Hyper-V (Configuration version: 11.0) + multipass (for creating the VMs)

VM OS instances: 
Linux <vmname> 5.15.0-56-generic #62-Ubuntu SMP Tue Nov 22 19:54:14 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Do you want to work on this?

Subject to design approval, are you willing to work on a Pull Request for this issue or feature request?

I would be willing, but I don't have very much experience with GoLang. 
@alexellis
Copy link
Owner

Hi, have you tried --host instead of --ip?

@CC007
Copy link
Author

CC007 commented Dec 24, 2022

With --host I get the same error.

I also tried --host with the <vmname>.mshome.net, but since this is from inside WSL2, the DNS doesn't resolve.

@Charlio99
Copy link

I would be also interested in this. Most of VPS servers are quite cheaper when paying for IPv6 only

@Charlio99
Copy link

Charlio99 commented Jan 24, 2023

I have no idea on the matter because I don't know much about the ssh library in go, but in a quick search I found this: kubernetes/minikube#625 and kubernetes/minikube#6110 they used to solve the same error in minikube

@alexellis
Copy link
Owner

Thanks for your interest @Charlio99

How cheap is your IPv6-only VPS?

DO and Scaleway have VMs for 3-5 EUR/USD/mo.

Is it cheaper than that? And is that the only driver here?

@Charlio99
Copy link

Hello @alexellis,

The price difference it’s 1,7EUR/mo in the 1vCPU 2GB RAM config, the thing is that if I spin up 3 clusters with 3 workers 1 cp each, it’s 20EUR/month I could be having almost 2 clusters more for that.

Given that the main purpose of k3sup is to quickly spin up a k3s cluster, I think this is the ideal scenario.

I would be willing to help implement it but I never used go before.

@CC007
Copy link
Author

CC007 commented Jan 26, 2023

I'm not in the position to test right now, since I fully changed my k8s server setup to harvester/rancher, rather than Windows+hyperv/multipass/k3sup, but I didn't test back then if ipv6 worked if you put square brackets around the address, similar to how you go to ipv6 addresses in the browser.

@Charlio99 , could you test that?

@Charlio99
Copy link

I tried that also, I did some more debugging today and it seems that github.com is a non IPv6 domain, so when get.k3s.io tried to fetch the last version, it can't...

$ nslookup github.com
Server:		2606:4700:4700::1111
Address:	2606:4700:4700::1111#53

Non-authoritative answer:
Name:	github.com
Address: 140.82.121.4

@Charlio99
Copy link

I found a way around, I've created this PR, it's a simple change to the docs explaining how to do it, feel free to edit anything you want.

@CC007
Copy link
Author

CC007 commented Jan 26, 2023

Great work!

@xvzf xvzf linked a pull request Aug 26, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants