【发布时间】:2022-11-10 11:32:36
【问题描述】:
我正在尝试连接到集群,但出现以下错误:
gcloud container clusters get-credentials cluster1 --region europe-west2 --project my-project
Fetching cluster endpoint and auth data.
CRITICAL: ACTION REQUIRED: gke-gcloud-auth-plugin, which is needed for continued use of kubectl, was not found or is not executable.
Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
kubeconfig entry generated for dbcell-cluster.
我已经安装了 Google Cloud SDK 400、kubektl 1.22.12、gke-gcloud-auth-plugin 0.3.0,还安装了 /~.bashrc
export USE_GKE_GCLOUD_AUTH_PLUGIN=True
gke-gcloud-auth-plugin --version
Kubernetes v1.24.0-alpha+f42d1572e39979f6f7de03bd163f8ec04bc7950d
但是当我尝试连接到集群时,我总是遇到同样的错误,这里有什么想法吗?
谢谢
集群存在于该区域,我也验证了 env 变量
和
echo $USE_GKE_GCLOUD_AUTH_PLUGIN
True
我安装了gke-gcloud-auth-plugin using gcloud components 安装...我不知道我还能检查什么
【问题讨论】:
-
Linux?你从
echo ${USE_GKE_GCLOUD_AUTH_PLUGIN}得到什么?您也可以在当前会话中export USE_GKE_GCLOUD_AUTH_PLUGIN=True以确保它有效。你从中得到什么?ls -la $(which gke-gcloud-auth-plugin)?集群是否存在于该区域 (gcloud container clusters describe ...)? -
请运行
which gke-gcloud-auth-plugin && which gcloud并发布结果好吗?还有echo $PATH。
标签: kubernetes google-cloud-platform google-kubernetes-engine gcloud