由于无法启动kubernetes API,因此无法启动kube服务,例如: kubectl版本 kubect获取节点
/home/ubuntu# kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-25T15:53:57Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port ?
已安装Docker。 使用下面的命令,安装了kube组件:
apt-get update && apt-get install -y kubeadm kubelet kubectl
但是,当执行kubeadm init --apiserver-advertise-address=$myip --ignore-preflight-errors=all:
I0408 09:09:07.316109 1 client.go:352] scheme "" not registered, fallback to default scheme
I0408 09:09:07.319904 1 asm_amd64.s:1337] ccResolverWrapper: sending new addresses to cc: [{127.0.0.1:2379 0 <nil>}]
I0408 09:09:07.323010 1 asm_amd64.s:1337] balancerWrapper: got update addr from Notify: [{127.0.0.1:2379 <nil>}]
W0408 09:09:07.332669 1 clientconn.go:1251] grpc: addrConn.createTransport failed to connect to {127.0.0.1:2379 0 <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused". Reconnecting...
I0408 09:09:08.325625 1 client.go:352] parsed scheme: ""
I0408 09:09:08.325650 1 client.go:352] scheme "" not registered, fallback to default scheme
I0408 09:09:08.325707 1 asm_amd64.s:1337] ccResolverWrapper: sending new addresses to cc: [{127.0.0.1:2379 0 <nil>}]
I0408 09:09:08.325768 1 asm_amd64.s:1337] balancerWrapper: got update addr from Notify: [{127.0.0.1:2379 <nil>}]
W0408 09:09:08.326158 1 clientconn.go:1251] grpc: addrConn.createTransport failed to connect to {127.0.0.1:2379 0 <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused". Reconnecting...
在kube api容器日志中获取以上内容。这是全新安装。也尝试过
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf
kubectl版本:应该仅提供版本详细信息,而不会出现任何连接问题消息 Kubectl获取节点:应提供主节点和状态的详细信息
答案 0 :(得分:1)
以下内容实际上已解决了我的问题,不确定是否是实际找到的内容。 我之前在kubernetes安装中安装了docker.ce。 现在,我尝试使用docker.io,它运行良好,没有任何问题。现在可以正常工作了