|
6 | 6 | name: tasks
|
7 | 7 | weight: 40
|
8 | 8 | ---
|
9 |
| - |
10 | 9 | <!--
|
11 | 10 | title: Configure Access to Multiple Clusters
|
12 | 11 | content_type: task
|
|
17 | 16 | -->
|
18 | 17 |
|
19 | 18 | <!-- overview -->
|
| 19 | + |
20 | 20 | <!--
|
21 | 21 | This page shows how to configure access to multiple clusters by using
|
22 | 22 | configuration files. After your clusters, users, and contexts are defined in
|
@@ -58,8 +58,7 @@ run `kubectl version --client`. The kubectl version should be
|
58 | 58 | cluster's API server.
|
59 | 59 | -->
|
60 | 60 | 要检查 {{< glossary_tooltip text="kubectl" term_id="kubectl" >}} 是否安装,
|
61 |
| -执行 `kubectl version --client` 命令。 |
62 |
| -kubectl 的版本应该与集群的 API |
| 61 | +执行 `kubectl version --client` 命令。kubectl 的版本应该与集群的 API |
63 | 62 | 服务器[使用同一次版本号](/zh-cn/releases/version-skew-policy/#kubectl)。
|
64 | 63 |
|
65 | 64 | <!-- steps -->
|
@@ -415,7 +414,7 @@ $Env:KUBECONFIG_SAVED=$ENV:KUBECONFIG
|
415 | 414 | ```
|
416 | 415 |
|
417 | 416 | <!--
|
418 |
| - The `KUBECONFIG` environment variable is a list of paths to configuration files. The list is |
| 417 | +The `KUBECONFIG` environment variable is a list of paths to configuration files. The list is |
419 | 418 | colon-delimited for Linux and Mac, and semicolon-delimited for Windows. If you have
|
420 | 419 | a `KUBECONFIG` environment variable, familiarize yourself with the configuration files
|
421 | 420 | in the list.
|
@@ -519,8 +518,7 @@ For example:
|
519 | 518 | ## 将 $HOME/.kube/config 追加到 KUBECONFIG 环境变量中 {#append-home-kube-config-to-your-kubeconfig-environment-variable}
|
520 | 519 |
|
521 | 520 | 如果有 `$HOME/.kube/config` 文件,并且还未列在 `KUBECONFIG` 环境变量中,
|
522 |
| -那么现在将它追加到 `KUBECONFIG` 环境变量中。 |
523 |
| -例如: |
| 521 | +那么现在将它追加到 `KUBECONFIG` 环境变量中。例如: |
524 | 522 |
|
525 | 523 | ### Linux
|
526 | 524 |
|
@@ -565,6 +563,29 @@ export KUBECONFIG="$KUBECONFIG_SAVED"
|
565 | 563 | $Env:KUBECONFIG=$ENV:KUBECONFIG_SAVED
|
566 | 564 | ```
|
567 | 565 |
|
| 566 | +<!-- |
| 567 | +## Check the subject represented by the kubeconfig |
| 568 | + |
| 569 | +It is not always obvious what attributes (username, groups) you will get after authenticating to the cluster. |
| 570 | +It can be even more challenging if you are managing more than one cluster at the same time. |
| 571 | +--> |
| 572 | +## 检查 kubeconfig 所表示的主体 {#check-the-subject} |
| 573 | + |
| 574 | +你在通过集群的身份验证后将获得哪些属性(用户名、组),这一点并不总是很明显。 |
| 575 | +如果你同时管理多个集群,这可能会更具挑战性。 |
| 576 | + |
| 577 | +<!-- |
| 578 | +There is a `kubectl` alpha subcommand command to check subject attributes, such as username, |
| 579 | +for your selected Kubernetes client context: `kubectl alpha auth whoami`. |
| 580 | + |
| 581 | +Read [API access to authentication information for a client](/docs/reference/access-authn-authz/authentication/#self-subject-review) |
| 582 | +to learn about this in more detail. |
| 583 | +--> |
| 584 | +对于你所选择的 Kubernetes 客户端上下文,有一个 `kubectl` Alpha 子命令可以检查用户名等主体属性: |
| 585 | +`kubectl alpha auth whoami`。 |
| 586 | + |
| 587 | +更多细节请参阅[通过 API 访问客户端的身份验证信息](/zh-cn/docs/reference/access-authn-authz/authentication/#self-subject-review)。 |
| 588 | + |
568 | 589 | ## {{% heading "whatsnext" %}}
|
569 | 590 |
|
570 | 591 | <!--
|
|
0 commit comments