无法连接到容器集群:运行gcloud获取凭据时必须设置环境变量HOME或KUBECONFIG [英] Can't connect to container cluster: environment variable HOME or KUBECONFIG must be set when running gcloud get credentials
问题描述
由于某种原因,我无法连接到集群.设置集群后,按照每个Google容器引擎的说明进行操作,我会遇到以下错误:
For some reason I can't connect to the cluster. Having followed the instructions per google container-engine after setting up the cluster, I get the following error:
错误:(gcloud.container.clusters.get-credentials)环境变量HOME或KUBECONFIG必须设置为存储kubectl的凭据
ERROR: (gcloud.container.clusters.get-credentials) environment variable HOME or KUBECONFIG must be set to store credentials for kubectl
运行此命令时:gcloud容器群集get-credentials [我的群集名称] --zone us-central1-b --project [我的项目名称]
When running this command: gcloud container clusters get-credentials [my cluster name] --zone us-central1-b --project [my project name]
任何想法我应该如何设置变量HOME或KUBECONFIG.我找不到针对容器引擎的任何特定内容.
Any ideas how I should be setting the variable HOME or KUBECONFIG. I couldn't find anything specific for container-engine.
推荐答案
使其正常工作:
在Windows中,您应该设置环境变量:
In Windows, you should set environment variable:
,然后在当前用户文件夹下创建一个文件夹和一个文件,如下所示:
and then creating a folder and a file under current user folder, as the following:
mkdir .kube
cd .kube
echo "" > config
在当前用户下创建配置文件时,gcloud应该具有访问该文件的正确权限.
As you make the config file under current user, gcloud should have the right permissions to access the file.
这篇关于无法连接到容器集群:运行gcloud获取凭据时必须设置环境变量HOME或KUBECONFIG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!