You are viewing a single comment's thread from:

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

in #kubernetes7 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”

Sort:  

看上去像是 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,加上可执行权限。。。。。。。大坑啊

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

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

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59176.07
ETH 2667.95
USDT 1.00
SBD 2.42