Hostnetwork pod IP address


#1

I am trying to deploy a kubernetes cluster with IPv6 but kubernetes will allocate the docker IP to my hostnetwork pods.

kahou@kahou-master:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:50:56:af:1d:25 brd ff:ff:ff:ff:ff:ff
inet6 2001:420:293:242d:250:56ff:feaf:1d25/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 2591949sec preferred_lft 604749sec
inet6 fe80::250:56ff:feaf:1d25/64 scope link
valid_lft forever preferred_lft forever
3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:50:56:af:a5:15 brd ff:ff:ff:ff:ff:ff
inet6 2000::250:56ff:feaf:a515/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 2591933sec preferred_lft 604733sec
inet6 2000::3/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::250:56ff:feaf:a515/64 scope link
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:53:f2:46:8c brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
5: tunl0@NONE: <NOARP,UP,LOWER_UP> mtu 1440 qdisc noqueue state UNKNOWN group default qlen 1000
link/ipip 0.0.0.0 brd 0.0.0.0

kahou@kahou-master:~$ kubectl get pod -n kube-system -owide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE
calico-etcd-gbmxh 1/1 Running 0 173m 172.17.0.1 kahou-master
calico-kube-controllers-76f8bbdf4d-qnxl8 0/1 CrashLoopBackOff 37 173m 172.17.0.1 kahou-master
calico-node-qr9vj 0/1 CrashLoopBackOff 37 173m 172.17.0.1 kahou-master
coredns-576cbf47c7-5nq42 0/1 ContainerCreating 0 178m kahou-master
coredns-576cbf47c7-p5zg9 0/1 ContainerCreating 0 178m kahou-master
etcd-kahou-master 1/1 Running 0 177m 172.17.0.1 kahou-master
kube-apiserver-kahou-master 1/1 Running 0 177m 172.17.0.1 kahou-master
kube-controller-manager-kahou-master 1/1 Running 0 177m 172.17.0.1 kahou-master
kube-proxy-pnq7g 1/1 Running 0 178m 172.17.0.1 kahou-master
kube-scheduler-kahou-master 1/1 Running 0 177m 172.17.0.1 kahou-master

Is there a way to configure k8s to use the IPv6 address for the hostnetwork pod?


#2

Kubernetes always uses IPv4 unless you have turned on IPv6 (alpha) in
which case it always uses IPv6. we do not have dual-stack yet.


#3

Thanks! Is there a document to show me how to turn on IPv6 correctly?