.kube/config中没有访问令牌 [英] No access token in .kube/config
问题描述
在GKE中升级群集后,仪表板将不再接受证书身份验证.
After upgrading my cluster in GKE the dashboard will no longer accept certificate authentication.
没问题,我的同事说.kube/config中有一个令牌
No problem there's a token available in the .kube/config says my colleague
user:
auth-provider:
config:
access-token: REDACTED
cmd-args: config config-helper --format=json
cmd-path: /home/user/workspace/google-cloud-sdk/bin/gcloud
expiry: 2018-01-09T08:59:18Z
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp
除了我的情况以外,没有...
Except in my case there isn't...
user:
auth-provider:
config:
cmd-args: config config-helper --format=json
cmd-path: /home/user/Dev/google-cloud-sdk/bin/gcloud
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp
我尝试过通过gcloud重新进行身份验证,将gcloud设置与同事进行比较,更新gcloud,重新安装gcloud,并检查Cloud Platform中的权限.我几乎可以想到的所有内容,仍然不会生成访问令牌.
I've tried re-authenticating with gcloud, comparing gcloud settings with colleagues, updating gcloud, re-installing gcloud, checking permissions in Cloud Platform. Pretty much everything I can think of, by still no access token will be generated.
任何人都可以帮忙吗?!
Can anyone help please?!
$ gcloud container clusters get-credentials cluster-3 --zone xxx --project xxx
Fetching cluster endpoint and auth data.
kubeconfig entry generated for cluster-3.
$ gcloud config list
[core]
account = xxx
disable_usage_reporting = False
project = xxx
Your active configuration is: [default]
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.4"
推荐答案
好吧,非常烦人和愚蠢的答案-您必须使用kubectl进行任何请求,以生成令牌并将其保存到kubeconfig文件中.
Ok, very annoying and silly answer - you have to make any request using kubectl for the token to be generated and saved into the kubeconfig file.
这篇关于.kube/config中没有访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!