You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Lens 2022.10版本连接GKE时仍使用已弃用gcp auth插件求助

问题详情

使用Lens版本 2022.10.311317 连接GKE集群时,出现如下警告:

W1107 09:36:53.839057 18484 gcp.go:120] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead.

已安装gke-gcloud-auth-plugin并遵循官方配置指引,但问题依旧。相关环境版本信息如下:

Google Cloud SDK版本

gcloud --version
Google Cloud SDK 408.0.1
bq 2.0.81
core 2022.11.01
gcloud-crc32c 1.0.0
gke-gcloud-auth-plugin 0.4.0
gsutil 5.16

gke-gcloud-auth-plugin版本

gke-gcloud-auth-plugin.exe --version
Kubernetes v1.25.2-alpha+ae91c1fc0c443c464a4c878ffa2a4544483c6d1f

解决方法
  1. 更新kubeconfig配置
    重新生成GKE集群的kubeconfig条目,确保使用新的认证插件:

    gcloud container clusters get-credentials <集群名称> --zone <集群区域> --project <项目ID>
    

    该命令会自动替换kubeconfig中旧的auth-provider配置,改为指向gke-gcloud-auth-plugin。

  2. 设置环境变量
    确保USE_GKE_GCLOUD_AUTH_PLUGIN环境变量已启用:

    • Windows(PowerShell):
      $env:USE_GKE_GCLOUD_AUTH_PLUGIN="True"
      
      如需永久生效,添加到系统环境变量中。
    • Linux/macOS:
      export USE_GKE_GCLOUD_AUTH_PLUGIN=True
      
      永久生效可写入~/.bashrc或~/.zshrc。
  3. 重置Lens缓存
    完全关闭Lens,删除缓存目录后重启:

    • Windows:%APPDATA%\Lens
    • macOS:~/Library/Application Support/Lens
    • Linux:~/.config/Lens
  4. 升级Lens版本
    2022.10版本的Lens对新GKE认证插件的支持可能不完善,升级到最新稳定版可解决兼容性问题。


内容的提问来源于stack exchange,提问作者Leonard Cătălin Bîra

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 18:15:38