【问题标题】:GKE gke-gcloud-auth-pluginGKE gke-gcloud-auth-plugin
【发布时间】: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 安装...我不知道我还能检查什么

gcloud components list

【问题讨论】:

  • 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


【解决方案1】:

我通过删除 GCP 的当前 kubeconfig 上下文解决了同样的问题。

  1. 让您的上下文名称运行:

    kubectl 配置获取上下文

  2. 删除上下文:

    kubectl config delete-context CONTEXT_NAME

  3. 重新配置凭据

    gcloud 容器集群 get-credentials CLUSTER_NAME --region REGION --project PROJECT

    警告信息现在应该已经消失了。

【讨论】:

    猜你喜欢
    • 2023-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-25
    • 1970-01-01
    相关资源
    最近更新 更多