【问题标题】:Google GKE Configuration Issue谷歌 GKE 配置问题
【发布时间】:2020-11-13 17:32:53
【问题描述】:

我管理多个使用 GKE 的项目。我迁移到使用机密,但是由于机密/令牌问题,我现在无法运行 pod。

似乎当我运行kubectl get secret 时,我得到了:

default-token-vhn8t      kubernetes.io/service-account-token   3      17m
pod-reader-token-q7nh7   kubernetes.io/service-account-token   3      7m1s

但是,这两个秘密都属于另一个名为 np 的项目。当我跑步时

gcloud config get-value core/project

我得到gmbt,这是正确的项目。

我需要运行类似的kubectl ??? 来设置正确的项目吗?

当我跑步时:

kubectl create secret generic gmbt-server-key --from-file ./keys/server-env/production/.env.json

它将密钥添加到 np 项目而不是 gmbt 项目。也许注销/登录可以解决问题?

【问题讨论】:

    标签: google-cloud-platform google-kubernetes-engine


    【解决方案1】:

    我深入研究了

    https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#config

    这里是我取消设置然后运行的地方

    gcloud container clusters get-credentials "project-cluster" --region="us-central1-c"

    这解决了我的问题,我认为 gcloud config set project [PROJECT_ID] 没有设置正确的值。

    【讨论】:

      猜你喜欢
      • 2019-06-08
      • 2020-07-18
      • 1970-01-01
      • 2013-04-30
      • 2018-11-18
      • 1970-01-01
      • 1970-01-01
      • 2018-12-26
      • 2017-08-08
      相关资源
      最近更新 更多