2016-11-04 99 views
0

在Google云端平台中,我有一个包含三个运行实例的Container-Cluster。我现在想从我的终端连接,以便能够运行kubectl命令。为此,我运行命令kubectl访问Google云容器引擎失败

gcloud container clusters get-credentials cluster-1 --zone europe-west1-b --project project-id 

我正在使用真实的项目名称当然。这是在点击“连接群集”时仪表板显示的命令。此命令的输出是:

Fetching cluster endpoint and auth data. 
kubeconfig entry generated for cluster-1. 

但是当我运行kubectl命令之后像kubectl cluster-info我总是得到:

Unable to connect to the server: oauth2: cannot fetch token: 400 Bad Request 
Response: { 
    "error" : "invalid_grant", 
    "error_description" : "Token has been revoked." 
} 

缺少什么我在这里? gcloud命令如gcloud container clusters list工作

回答

14

我尝试从家里的另一台机器,并在那里它安装和设置gcloud后工作。我认为在我的工作机器上仍然存储有一个oauth令牌,我通过该令牌对用于测试的另一个Google帐户进行身份验证。

编辑:我现在正在运行它。问题是我错过了第二次必要的呼叫:

gcloud auth login 
gcloud auth application-default login 
相关问题