Skip to content

Commit

Permalink
zh: add content_zh/boilerplates/kubectl-multicluster-contexts.md (#3649)
Browse files Browse the repository at this point in the history
  • Loading branch information
SataQiu authored and istio-testing committed Mar 12, 2019
1 parent e44c708 commit 3fd7ce5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions content_zh/boilerplates/kubectl-multicluster-contexts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* `kubectl` 能通过 `--context` 参数切换上下文,以支持对不同集群 `cluster1``cluster2` 的访问。
使用如下命令列出现存的上下文:

{{< text bash >}}
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
* cluster1 cluster1 user@foo.com default
cluster2 cluster2 user@foo.com default
{{< /text >}}

* 使用配置的上下文名称导出以下环境变量:

{{< text bash >}}
$ export CTX_CLUSTER1=<KUBECONFIG_CONTEXT_NAME_FOR_CLUSTER_1>
$ export CTX_CLUSTER2=<KUBECONFIG_CONTEXT_NAME_FOR_CLUSTER_2>
{{< /text >}}

0 comments on commit 3fd7ce5

Please sign in to comment.