-
Notifications
You must be signed in to change notification settings - Fork 730
Description
reported by @leblancd here:
kubernetes/kubernetes#70617
What happened:
If you run 'kubeadm init ...' with an IPv6-only configuration, kubeadm will keep hanging and timing out here:
[init] waiting for the kubelet to boot up the control plane as Static Pods from directory "/etc/kubernetes/manifests"
Looking at the state of kubernetes system pods, both etcd and API controller pods are crashing.
Looking at the etcd server docker container logs, you'll find:
invalid value "https://fd00:20::2:2379" for flag -advertise-client-urls: URL address does not have the form "host:port": https://fd00:20::2:2379
. . .
The issue here is that the URL used for '--advertise-client-urls' needs square brackets around the IP address iff that IP address is IPv6, i.e. the URL should be "https://[fd00:20::2]:2379.
Inspecting the kubeadm code, the problem appears to be here:
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/phases/etcd/local.go#L145-L147
"advertise-client-urls": fmt.Sprintf("https://%s:%d", cfg.APIEndpoint.AdvertiseAddress, kubeadmconstants.EtcdListenClientPort),
"listen-peer-urls": fmt.Sprintf("https://%s:%d", cfg.APIEndpoint.AdvertiseAddress, kubeadmconstants.EtcdListenPeerPort),
"initial-advertise-peer-urls": fmt.Sprintf("https://%s:%d", cfg.APIEndpoint.AdvertiseAddress, kubeadmconstants.EtcdListenPeerPort),
There are other "IPv4-isms" in this script, just search for "%s:%d".
What you expected to happen:
IPv6 magic.
How to reproduce it (as minimally and precisely as possible):
(1) git clone latest k8s master: https://github.com/kubernetes/kubernetes
(2) git clone https://github.com/kubernetes-sigs/kubeadm-dind-cluster
(2) Use Kubeadm-DinD-Cluster (K-D-C) scripts to bring up an IPv6-only cluster:
cd $GOPATH/src/k8s.io/kubernetes
make clean
export IP_MODE=ipv6
export BUILD_KUBEADM=y
export BUILD_HYPERKUBE=y
export REMOTE_DNS64_V4SERVER=<your-local-DNS-server-if-necessary>
$HOME/kubeadm-dind-cluster/dind-cluster.sh up
Anything else we need to know?:
Looks like the code in local.go that is described above was changed with PR #69486
Environment:
- Kubernetes version (use
kubectl version
): Latest, it's build with K-D-C scripts above - Cloud provider or hardware configuration: Any Linux server, just use K-D-C
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a
): - Install tools:
- Others: