canonical / microk8s

MicroK8s is a small, fast, single-package Kubernetes for datacenters and the edge.

Home Page:https://microk8s.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server with `--node-ip=w.x.y.z,foo:bar::baz` specified gets replaced with just the IPv4 address

KaiSforza opened this issue · comments

Summary

Joining a node with both an IPv6 and IPv4 address specified in the kubeletExtraArgs."--node-ip" removes the IPv6 address.

What Should Happen Instead?

--node-ip should remain both addresses.

Reproduction Steps

  1. Create two nodes with IPv4 and IPv6 addresses
  2. Run the following:
    # cat << EOF | sudo tee /etc/microk8s.yaml >/dev/null
    extraKubeletArgs:
      "--node-ip": "$(ip -json a s | jq -rj '[.[].addr_info.[] | select(.scope == "global").local][0:2] | join(",")')"
    extraCNIEnv:
      IPv4_SUPPORT: true
      IPv6_CLUSTER_CIDR: fd03::/64
      IPv6_SERVICE_CIDR: fd99::/108
      IPv6_SUPPORT: true
    EOF
  3. Install microk8s on both machines.
  4. Verify both machines can ping each other over both IPv4 and IPv6.
  5. Run grep node-ip /var/snap/microk8s/current/args/kubelet on each machine, note the two addresses on each node there.
  6. Run microk8s add-node on the first machine and paste the command with the IPv4 address (IPv6 addresses won't work, see #4614) into the second machine.
  7. Re-run grep node-ip /var/snap/microk8s/current/args/kubelet on each machine. Note that the first still has both IPs, but the second only has the IPv4 address.

Can you suggest a fix?

Probably just something to do with update_kubelet_node_ip in the join command.