Enabling hostNetwork: true for IPv6 oly

4/15/2020

Im looking for a way to use hostNetwork: true but only for IPv6, I need the hosts ipv6 capabilities but would also like to have an internal network for the pods (For example for prometheus or a ready HTTP Server) If I enable hostNetwork = true I cannot bind additional HTTP servers because it binds to the host.

Thanks!

-- Repulsr
kubernetes
kubernetes-pod
project-calico

1 Answer

4/15/2020

Using only IPv6

If you wish to only use IPv6 (by disabling IPv4) or your hosts only have IPv6 addresses, you must disable autodetection of IPv4 by setting IP to none. With that set you must also pass a CALICO_ROUTER_ID to each calico-node pod.

To disable IPv4 we need to allow the Node's IPv4 to be empty :

  spec:
    bgp:
      ipv4Address: none
      ipv6Address: ff9b::/128

but the problem is that the ipv4 address is used as the router id in bird(6) configuration, unfortunately it is not as simple as just using the ipv6 address instead.

Take a look: bgp-router-ipv6, ipv6-calico-only.

Also see: calico-ipv6-only.

You can add default gw in the node. Add default gw and try the curl command to access your API service IP address from your host. Unless that is not accessible, your cluster wont be up. Example IP s 2001:db8:0:f101::2, add a dummy route as shown below:

sudo /sbin/route -A inet6 add default gw 2001:0db8:0:f101::1

If you use ipvs instead of iptables, I could see it is working without any default route as ipvsadm is adding the following rule. fd20::1 is my clusterIP

TCP [fd20::1]:443 rr  
-> [2001:db8:0:f101::2]:6443 Masq 1 5 0
-- MaggieO
Source: StackOverflow