Skip to content

Commit

Permalink
[zh] Sync /reference/kubectl/_index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
windsonsea committed Sep 30, 2022
1 parent 24540ba commit 62fdaef
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions content/zh-cn/docs/reference/kubectl/_index.md
Expand Up @@ -217,14 +217,21 @@ then kubectl assumes it is running in your cluster. The kubectl tool looks up th
namespace of that ServiceAccount (this is the same as the namespace of the Pod)
and acts against that namespace. This is different from what happens outside of a
cluster; when kubectl runs outside a cluster and you don't specify a namespace,
the kubectl command acts against the `default` namespace.
the kubectl command acts against the namespace set for the current context in your
client configuration. To change the default namespace for your kubectl you can use the
following command:
-->
然后 kubectl 假定它正在你的集群中运行。
kubectl 工具查找该 ServiceAccount 的命名空间
(该命名空间与 Pod 的命名空间相同)并针对该命名空间进行操作。
这与集群外运行的情况不同;
当 kubectl 在集群外运行并且你没有指定命名空间时,
kubectl 命令会针对 `default` 命名空间进行操作。
kubectl 命令会针对你在客户端配置中为当前上下文设置的命名空间进行操作。
要为你的 kubectl 更改默认的命名空间,你可以使用以下命令:

```shell
kubectl config set-context --current --namespace=<namespace-name>
```

<!--
## Operations
Expand Down

0 comments on commit 62fdaef

Please sign in to comment.