gpt4 book ai didi

What is the purpose of gcloud config set container/cluster cluster_name?(GCloud配置集容器/集群CLUSTER_NAME的用途是什么?)

转载 作者:bug小助手 更新时间:2023-10-26 21:03:23 26 4
gpt4 key购买 nike



I have two GKE clusters: c1, c2,

我有两个GKE集群:c1,c2,



I use gcloud config set container/cluster c1 to set the default cluster to c1, after that I run kubectl run, seems the new pods still created in c2.

我使用gCloud配置设置容器/集群c1将默认集群设置为c1,之后我运行kubectl run,似乎新的pod仍然在c2中创建。



how can i switch to c2? and what is the purpose of gcloud config set container/cluster cluster_name?

我怎么才能换成c2?GCloud配置集CONTAINER/CLUSTER CLUSTER_NAME有什么作用?


更多回答
优秀答案推荐

The gcloud container cluster commands are for administrating your clusters from a GCP perspective, e.g. adding another node-pool for a GKE kubernetes cluster using the node-pools create command.

GCloud容器集群命令用于从GCP的角度管理集群,例如使用node-pools create命令为GKE Kubernetes集群添加另一个节点池。



Controlling which cluster is used for kubectl is done via .kube/config file which has a so called current-context. There is the kubectx/kubens project that provides some nice helpers to allow switching between clusters (and namespaces) more easily.

控制哪个集群用于kubectl是通过.kube/config文件完成的,该文件具有所谓的当前上下文。有一个kubectx/kubens项目,它提供了一些很好的助手,可以更轻松地在集群(和名称空间)之间切换。



If you have multiple clusters, you can set a default cluster for the kubectl command-line tool.

如果您有多个集群,您可以为kubectl命令行工具设置默认集群。


To set a default cluster for gcloud commands, run the following command:

要为gCloud命令设置默认群集,请运行以下命令:


gcloud config set container/cluster CLUSTER_NAME

GCloud配置设置容器/集群集群名称


更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com