kubeadm init refuses to use link-local unicast IPs as --apiserver-advertise-address

Created on 23 Nov 2018  ·  3Comments  ·  Source: kubernetes/kubeadm

Is this a BUG REPORT or FEATURE REQUEST?

/kind bug

Versions

kubeadm version (use kubeadm version):

v1.12.2

What happened?

I'm setting up a VM-based test harness that uses kubeadm to set up a small k8s cluster. The VMs are configured to set up IPv4 link-local addresses and use multicast DNS to find each other. Because of the way the VMs are set up, I have to override --apiserver-advertise-address to make k8s use the LAN interface for node communication, because it's not the default interface.

Unfortunately, kubeadm checks .IsGlobalUnicast() on the passed in address, so the link-local IPv4 address is rejected even though it's a valid way to set up a small cluster.

What you expected to happen?

kubeadm init should accept link-local IPv4 or IPv6 addresses, if they're specified explicitly on the commandline.

How to reproduce it (as minimally and precisely as possible)?

kubeadm init --apiserver-advertise-address=169.254.152.255

help wanted kinfeature prioritbacklog sinode

Most helpful comment

So enabling link-local addresses can be problematic in most use cases. We purposefully disabled due to a couple of other failure conditions, and this use case is non-standard IMO.

All 3 comments

/remove-kind bug
/kind feature
/sig node
/priority backlog
/assign @kad
cc @rosti

@danderson
this is by design. our validation is only a sanity check, because the kubelet also ignores address in the host interface that are not global unicast:
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/net/interface.go#L305-L308

loopbacks are also overriden:
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/net/interface.go#L408

So enabling link-local addresses can be problematic in most use cases. We purposefully disabled due to a couple of other failure conditions, and this use case is non-standard IMO.

Given the lack of justification, and overall agreement that this can be more problematic for most users we are closing.

If your use case can be simplified, generalized, or easily patched feel free to reopen.

Was this page helpful?
0 / 5 - 0 ratings