【发布时间】:2019-04-12 11:28:30
【问题描述】:
在 GCP 中使用多个 kubernetes 集群,我想在切换 gcloud 配置时自动获取集群凭据。
我已经使用gcloud config configurations create [config-name] 为 gcloud 创建了几个配置,并且我已经设置了我需要的内容,特别是 gcloud config set container/cluster [cluster-name]。
当我使用gcloud config configurations activate [config-name] 切换配置时,一切正常,除了我没有获得我为该配置配置的集群的凭据。相反,我需要运行 gcloud container clusters get-credentials [cluster-name]。
在激活 gcloud 配置时,有什么方法可以自动获取集群凭据?
【问题讨论】:
标签: kubernetes gcloud