kubectl 连接到本地网络上的集群时出现问题

问题描述 投票:0回答:1

我对使用 k8s 和

kubctl
相当陌生,它与基于 EKS 的集群工作得很好,但是当我尝试添加本地网络上的集群时,它失败了。

在 MacOS 13.4 (Ventura) 上运行
Kubectl 版本:
客户端:v1.27.2
定制版本:v5.0.1
来自服务器的错误(NotFound):服务器找不到请求的资源

我似乎无法让 kubectl 连接到它,而是必须使用仪表板 (http://10.22.68.60:30539/)(未启用 TLS)。当我尝试将 kubectl 与集群一起使用时,我收到此“资源未找到错误”,例如

E0713 12:38:21.469724   29296 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E0713 12:38:21.677199   29296 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E0713 12:38:21.891392   29296 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E0713 12:38:22.112032   29296 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E0713 12:38:22.328271   29296 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
Error from server (NotFound): the server could not find the requested resource

以下是用于添加集群的命令:

kubectl config set-cluster local_test --server=http://10.22.68.60:30539 --insecure-skip-tls-verify

我已经尝试过使用和不使用

:30539
(仪表板运行的端口)。

服务器的 k8s 可能是旧版本,但我不确定如何从仪表板获取版本信息(我还无法 ssh 到它)?

对可能失败的其他可能原因的思考?

kubectl
1个回答
0
投票

kubectl version
,它没有显示服务器版本。你只需要安装 minikube 即可。安装后就可以使用apply等命令了。

下载https://minikube.sigs.k8s.io/docs/start/

© www.soinside.com 2019 - 2024. All rights reserved.