我要在GKE上设置kubernetes,正如凯尔西海塔https://github.com/kelseyhightower/kubernetes-the-hard-way/中所描述的
除了设置DNS ClusterAddon https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/12-dns-addon.md之外,一切正常。
当我像这样开始kube时:
创建-f https://storage.googleapis.com/kubernetes-the-hard-way/kube-dns.yaml
我确实得到了预期的输出:
serviceaccount "kube-dns" created
configmap "kube-dns" created
service "kube-dns"
created deployment "kube-dns" created但是,检查豆荚的状态和kube容器的输出,我看到了错误:
kubectl get po -n kube-system
NAME READY STATUS RESTARTS AGE
kube-dns-6c857864fb-cpvvr 2/3 CrashLoopBackOff 63 2h在集装箱日志中:
I0115 13:22:35.272492 1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:35.772476 1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:36.272406 1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:36.772356 1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:37.272386 1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
E0115 13:22:37.273178 1 reflector.go:201] k8s.io/dns/pkg/dns/dns.go:147: Failed to list *v1.Endpoints: Get https://10.32.0.1:443/api/v1/endpoints?resourceVersion=0: dial tcp 10.32.0.1:443: i/o timeout
E0115 13:22:37.273340 1 reflector.go:201] k8s.io/dns/pkg/dns/dns.go:150: Failed to list *v1.Service: Get https://10.32.0.1:443/api/v1/services?resourceVersion=0: dial tcp 10.32.0.1:443: i/o timeout容器日志中的https://10.32.0.1:443似乎是错误的,但我找不到可以指定不同URL的任何地方,也找不到在配置文件https://storage.googleapis.com/kubernetes-the-hard-way/kube-dns.yaml中设置该URL的位置。
发布于 2018-01-15 13:55:33
URL来自内部kubernetes信息(服务帐户令牌),并且应该很好(它应该指向分配给服务网络的第一个IP,这应该是kubernetes.default服务。您需要检查的是您的吊舱网络和kube(它实现了服务集群it)是否像预期的那样工作。
如果您使用kubectl get svc kubernetes -o yaml,您应该看到一个带有10.32.0.1 IP的kubernetes服务,所以也要确认(apiserver为这个svc注册了自己的IP,这样做ksp get endpoints kubernetes应该给您API /端口)
发布于 2018-07-09 15:30:50
我在Openstack上尝试设置kubernetes (版本1.10.4)集群,并在相同的错误消息中遇到了问题。谷歌带领我来到这里,但没有为这个问题提供解决方案。
我的最后一个解决方案是将inventory/mycluster/group_vars/kube-cluster.yml,中的kube_proxy_mode选项从默认值“iptables”更改为“ipv”:
# Kube-proxy proxyMode configuration.
# Can be ipvs, iptables
kube_proxy_mode: ipvs在重新运行ansible playbook命令之后,这个问题就消失了,所有服务/吊舱都按预期运行。希望这对那些尝试使用相同的工具链来设置kubernetes集群的人是有帮助的。
https://stackoverflow.com/questions/48264217
复制相似问题