Kubernetes:spec.clusterIP:无效值?

时间:2015-12-09 07:41:40

标签: docker kubernetes skydns

是否提示,在kubernetes中链接了什么消息:

The Service "skudns" is invalid:spec.clusterIP: invalid value '': the provided range does not match the current range

那是DNS_SERVICE_IP = 10.3.0.10SERVICE_IP_RANGE = 10.3.0.0/16

我的IP地址:

K8S_SERVICE_IP: 10.3.0.1
MASTER_HOST: 192.168.0.139
ETCD_ENDPOINT=ETCD_CLUSTER=http://192.169.0.139:2379,http://192.168.0.107:2379
POD_NETWORK: 10.2.0.0/16
SERVICE_IP_RANGE: 10.3.0.0/24
DNS_SERVICE_IP: 10.3.0.10
ADVERTISE_IP: 192.168.0.139

1 个答案:

答案 0 :(得分:1)

/16 means a subnet mask 255.255.0.0(而非255.255.255.0与/24

错误消息来自pkg/registry/service/ipallocator/allocator_test.go#L196-L198

if !network.IP.Equal(cidr.IP) || network.Mask.String() != cidr.Mask.String() {
    t.Fatalf("mismatched networks: %s : %s", network, cidr)
}

主机网络掩码(在ipconfig中看到,如果主机是Windows,或ifconfig as in this script)可能与kubernetes使用的cidr掩码不同。 请尝试使用/24进行测试 另请参阅issue 5 (Network comportment)

最后,OP batazor确认in the comments Kubernetes方面的问题:

  

kubernetes从版本1.0.3更新到1.0.6并且docker0掩码到255.255.255.0这是某种魔法。