gpt4 book ai didi

kubernetes - 如何修复 'Unable to connect to the server: EOF' Kubernetes 问题 - Kubectl

转载 作者:行者123 更新时间:2023-12-02 23:49:23 33 4
gpt4 key购买 nike

当我尝试任何 kubectl 命令时,它总是返回:

Unable to connect to the server: EOF

我遵循了这些教程:

https://kubernetes.io/docs/tasks/tools/install-kubectl/

https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/

但他们并没有帮助我。根据第一个链接,默认情况下,kubectl 配置位于

~/.kube/config

但在那条路上我什么都没有。我不知道这是否是导致问题的原因。

另一件事是当我尝试检查 kubectl 配置时:

M:.kube candres$ kubectl cluster-info
Kubernetes master is running at http://localhost:8080

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Unable to connect to the server: EOF
M:.kube candres$ kubectl cluster-info dump
Unable to connect to the server: EOF

我安装的版本是:

Kubernetes - kubectl

M:.kube candres$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"X", GitTreeState:"clean", BuildDate:"2018-02-09T21:51:06Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: EOF

Minikube

M:.kube candres$ minikube version
minikube version: v0.25.0

docker :

M:.kube candres$ docker version
Client:
Version: 17.12.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: X
Built: Wed Dec 27 20:03:51 2017
OS/Arch: darwin/amd64

Server:
Engine:
Version: 17.12.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: X
Built: Wed Dec 27 20:12:29 2017
OS/Arch: linux/amd64
Experimental: true

有人知道如何解决这个问题吗?

最佳答案

Minikube启动后,会自动配置kubectl

minikube start
Starting local Kubernetes cluster...
Kubernetes is available at https://192.168.99.100:8443.
Kubectl is now configured to use the cluster.

您可以使用以下命令验证集群和上下文。

kubectl config view

关于kubernetes - 如何修复 'Unable to connect to the server: EOF' Kubernetes 问题 - Kubectl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48928330/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com