通常你可以使用kops get secrets kube --type secret -oplaintext
,但我没有在 AWS 上运行并且正在使用 GCP。
我读到kubectl config view
应该向您显示此信息,但我看不到这样的事情(想知道这是否与 GCP 服务帐户设置有关,我也在使用 GKE)。
kubectl config view
返回类似于:
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://MY_IP
name: MY_CLUSTER_NAME
contexts:
- context:
cluster: MY_CLUSTER_NAME
user: MY_CLUSTER_NAME
name: MY_CLUSTER_NAME
current-context: MY_CONTEXT_NAME
kind: Config
preferences: {}
users:
- name: MY_CLUSTER_NAME
user:
auth-provider:
config:
access-token: MY_ACCESS_TOKEN
cmd-args: config config-helper --format=json
cmd-path: /usr/lib/google-cloud-sdk/bin/gcloud
expiry: 2019-02-27T03:20:49Z
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp
用户名=>Admin
或用户名=>都不能MY_CLUSTER_NAME
使用密码=>MY_ACCESS_TOKEN
有任何想法吗?