RE: 部署 k8s Cluster(下) — Kubernetes(6)

You are viewing a single comment's thread from:

部署 k8s Cluster(下) — Kubernetes(6)

in kubernetes •  7 years ago 

老师,请问一下这是什么问题?当我执行“kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml”时出现“W1210 16:28:33.554588 19525 factory_object_mapping.go:423] Failed to download OpenAPI (Get https://192.168.80.130:6443/swagger-2.0.0.pb-v1: Forwarding failure), falling back to swagger
Unable to connect to the server: Forwarding failure”

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

看上去像是 api server 服务没起来,先用 kubectl get pod 确保 k8s 的 pod 已经正常运行

可能是./kubectl/config中的秘钥不对,重新复制一份进去应该就行了

"W1025 01:38:11.959624 45595 factory_object_mapping.go:423] Failed to download OpenAPI (Get http://localhost:8080/swagger-2.0.0.pb-v1: dial tcp 127.0.0.1:8080: getsockopt: connection refused), falling back to swagger\nThe connection to the server localhost:8080 was refused - did you specify the right host or port?"。老师能帮我看一下这是什么问题吗?这也是有人在github上问的一个问题,https://github.com/kubernetes-incubator/kubespray/issues/1866。

我下的kubernetes是1.8.6,试了很多次,都未能解决这个问题。只要执行kubectl准会输出:The connection to the server localhost:8080 was refused - did you specify the right host or port?。有点忧伤

亲测v1.8.5,部署完后三节点状态都是ready,但kubectl get pods --all-namespaces现实kube-dns状态停留在 ContainerCreating,journalctl -u kubelet | grep kube-dns看到“ Error deleting network: failed to find plugin "portmap" in path [/opt/flannel/bin /opt/cni/bin]”,解决办法到https://github.com/projectcalico/cni-plugin/releases/download/v1.9.1/portmap下载portmap并放到/opt/cni/bin,加上可执行权限。。。。。。。大坑啊

按照你说的方法搞定了。。帮了大忙了,我都没发现这个问题

或者disable portmap。具体看这个解决办法
https://github.com/coreos/flannel/issues/890

用下面这个版本安装 flannel
https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml

我也是,不过我换了个vps就好了。。我之前用的vultr,后来变成digitalocean,就没这个问题了。