Cannot join over ipv6
See original GitHub issueIt seems the microk8s join
script doesn’t handle ipv6 addresses at all. My nodes use an ipv6 overlay network to communicate and cannot reach each other over ipv4. Maybe adding a -6 flag is a good solution, or potentially detecting the ipv6 format.
ubuntu@mm-cluster-stephen-do:~$ microk8s join [201:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:25000/xxxxxxxxxxx
Contacting cluster at [201
Traceback (most recent call last):
File "/snap/microk8s/1791/scripts/cluster/join.py", line 967, in <module>
join_dqlite(connection_parts)
File "/snap/microk8s/1791/scripts/cluster/join.py", line 871, in join_dqlite
info = get_connection_info(master_ip, master_port, token, cluster_type="dqlite")
File "/snap/microk8s/1791/scripts/cluster/join.py", line 70, in get_connection_info
verify=False,
File "/snap/microk8s/1791/usr/lib/python3/dist-packages/requests/api.py", line 107, in post
return request('post', url, data=data, json=json, **kwargs)
File "/snap/microk8s/1791/usr/lib/python3/dist-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, **kwargs)
File "/snap/microk8s/1791/usr/lib/python3/dist-packages/requests/sessions.py", line 466, in request
prep = self.prepare_request(req)
File "/snap/microk8s/1791/usr/lib/python3/dist-packages/requests/sessions.py", line 400, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "/snap/microk8s/1791/usr/lib/python3/dist-packages/requests/models.py", line 293, in prepare
self.prepare_url(url, params)
File "/snap/microk8s/1791/usr/lib/python3/dist-packages/requests/models.py", line 345, in prepare_url
scheme, auth, host, port, path, query, fragment = parse_url(url)
File "/snap/microk8s/1791/usr/lib/python3/dist-packages/urllib3/util/url.py", line 184, in parse_url
host, url = url.split(']', 1)
ValueError: not enough values to unpack (expected 2, got 1)
I tried to fix it with this patch:
diff --git a/scripts/cluster/join.py b/scripts/cluster/join.py
index 9ba826d..269bc9a 100755
--- a/scripts/cluster/join.py
+++ b/scripts/cluster/join.py
@@ -64,8 +64,11 @@ def get_connection_info(master_ip, master_port, token, callback_token=None, clus
# TODO: enable ssl verification
try:
+ format_string = "https://{}:{}/{}/join"
+ if master_ip.find(":"):
+ format_string = "https://[{}]:{}/{}/join"
connection_info = requests.post(
- "https://{}:{}/{}/join".format(master_ip, master_port, CLUSTER_API_V2),
+ format_string.format(master_ip, master_port, CLUSTER_API_V2),
json=req_data,
verify=False,
) # type: requests.models.Response
@@ -83,8 +86,11 @@ def get_connection_info(master_ip, master_port, token, callback_token=None, clus
# TODO: enable ssl verification
try:
+ format_string = "https://{}:{}/{}/join"
+ if master_ip.find(":"):
+ format_string = "https://[{}]:{}/{}/join"
connection_info = requests.post(
- "https://{}:{}/{}/join".format(master_ip, master_port, CLUSTER_API),
+ format_string.format(master_ip, master_port, CLUSTER_API),
json=req_data,
verify=False,
)
@@ -864,8 +870,8 @@ def join_dqlite(connection_parts):
"""
token = connection_parts[1]
master_ep = connection_parts[0].split(":")
- master_ip = master_ep[0]
- master_port = master_ep[1]
+ master_ip = ":".join(master_ep[:-1])
+ master_port = master_ep[-1]
print("Contacting cluster at {}".format(master_ip))
info = get_connection_info(master_ip, master_port, token, cluster_type="dqlite")
But I just realized that it seems whatever is on port 25000 is only on the lan ipv4 address of my first node. Going off this documentation and port scanning both the v4 and v6 address, it seems that out of the box, port 25000 is the only one that is v4 only for some reason. Maybe it will work once that’s fixed.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (1 by maintainers)
Top Results From Across the Web
VPN, Connection issues when connecting over IPv6
Go to Network settings · lick on the interface being used for their network connection, if it is not already selected. · Click...
Read more >The PC with IPV6 cannot join the domain due to the DNS ...
Issue Description. All the PC has a IPV6 address and they need to join the domain after authentication ,all the IPV4 PC can...
Read more >Cannot join over ipv6 · Issue #1751 · canonical/microk8s
It seems the microk8s join script doesn't handle ipv6 addresses at all. My nodes use an ipv6 overlay network to communicate and cannot...
Read more >IPv6 causes issues when joining a IPv4 only domain
If something is not working with IPv6 installed there is a networking problem somewhere on the network. It could be a switch, a...
Read more >Unable to connect to the Internet when IPv6 is enabled.
For Android TV™ · First, check the Network status. Press the HOME button on the remote. Select Settings. Select Network in the NETWORK...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Success! At least it looks like I’ve managed to get the nodes to cluster over ipv6. I had to edit:
Checking the health of the cluster shows that only calico-node on the new node doesn’t start. The logs show this:
Editing the pod yml shows:
It doesn’t seem to let me save any changes to that, but hopefully after that it works completely.
Edit: Also I believe this documentation may be useful to solve this: https://docs.projectcalico.org/networking/ipv6#enabling-ipv6-support-in-calico
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.