Change:
} } <ins> func TestCalcNodeCidrSize(t *testing.T) { tests := []struct { name           string podSubnet      string expectedPrefix string }{ { name:           "Malformed pod subnet", podSubnet:      "10.10.10/160", expectedPrefix: "24", }, { name:           "V4: Always uses 24", podSubnet:      "10.10.10.10/16", expectedPrefix: "24", }, { name:           "V6: Use pod subnet size, when not enough space", podSubnet:      "2001:db8::/128", expectedPrefix: "128", }, { name:           "V6: Use pod subnet size, when not enough space", podSubnet:      "2001:db8::/113", expectedPrefix: "113", }, { name:           "V6: Special case with 256 nodes", podSubnet:      "2001:db8::/112", expectedPrefix: "120", }, { name:           "V6: Using /120 for node CIDR", podSubnet:      "2001:db8::/104", expectedPrefix: "120", }, { name:           "V6: Using /112 for node CIDR", podSubnet:      "2001:db8::/103", expectedPrefix: "112", }, { name:           "V6: Using /112 for node CIDR", podSubnet:      "2001:db8::/96", expectedPrefix: "112", }, { name:           "V6: Using /104 for node CIDR", podSubnet:      "2001:db8::/95", expectedPrefix: "104", }, { name:           "V6: Largest subnet currently supported", podSubnet:      "2001:db8::/66", expectedPrefix: "80", }, { name:           "V6: For /64 pod net, use /80", podSubnet:      "2001:db8::/64", expectedPrefix: "80", }, } for _, test := range tests { actualPrefix := calcNodeCidrSize(test.podSubnet) if actualPrefix != test.expectedPrefix { t.Errorf("Case [%s]nCalc of node CIDR size for pod subnet %q failed: Expected %q, saw %q", test.name, test.podSubnet, test.expectedPrefix, actualPrefix) } } } </ins> func TestGetControllerManagerCommandExternalCA(t *testing.T) { tests := []struct {

Discussion:
<!-- This form is for bug reports and feature requests ONLY! If you're looking for help check and the . --Is this a BUG REPORT or FEATURE REQUEST?: /kind bug What happened: For IPv6, the node CIDR size is hard coded to /64. This causes an error bringing up the kube-controller, as the size must be for a smaller subnet (larger value) that what is used for the pod subnet, which is specified for some CNI plugins (e.g. Calico). In addition, this is a catch-22, as the pod subnet prefix cannot be for a larger network (smaller value) than /66, so we cannot set it to /63, for example. What you expected to happen: The node CIDR size should be computed, based on the pod subnet specified, so that it can meet the requirements. How to reproduce it (as minimally and precisely as possible): Bring up a cluster using KubeAdm, specifying IPv6 and choose any pod subnet prefix desired. Anything else we need to know?: Note, there is a second requirement, that the difference between pod subnet size and node CIDR size be 16 or less (issue ). I'll be submitting a proposed PR to address this. Environment: Kubernetes version (use ): latest on master, using 1.9.2 in my case Cloud provider or hardware configuration: bare metal, single node OS (e.g. from /etc/os-release): Ubuntu 16.04 Kernel (e.g. ): Linux bxb-c2-77 4.4.0-109-generic -Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x8664 x8664 x86_64 GNU/Linux Install tools: kubeadm Others: /area ipv6 /sig network
/assign pmichali