@@ -47,7 +47,7 @@ If you must use an untrusted kubeconfig file, inspect it carefully first, much a
47
47
By default, `kubectl` looks for a file named `config` in the `$HOME/.kube` directory.
48
48
You can specify other kubeconfig files by setting the `KUBECONFIG` environment
49
49
variable or by setting the
50
- [`-kubeconfig`](/docs/reference/generated/kubectl/kubectl/) flag.
50
+ [`-- kubeconfig`](/docs/reference/generated/kubectl/kubectl/) flag.
51
51
-->
52
52
默认情况下,` kubectl ` 在 ` $HOME/.kube ` 目录下查找名为 ` config ` 的文件。
53
53
你可以通过设置 ` KUBECONFIG ` 环境变量或者设置
@@ -163,7 +163,7 @@ Here are the rules that `kubectl` uses when it merges kubeconfig files:
163
163
以下是 ` kubectl ` 在合并 kubeconfig 文件时使用的规则。
164
164
165
165
<!--
166
- 1. If the `-kubeconfig` flag is set, use only the specified file. Do not merge.
166
+ 1. If the `-- kubeconfig` flag is set, use only the specified file. Do not merge.
167
167
Only one instance of this flag is allowed.
168
168
169
169
Otherwise, if the `KUBECONFIG` environment variable is set, use it as a
@@ -203,7 +203,7 @@ Here are the rules that `kubectl` uses when it merges kubeconfig files:
203
203
<!--
204
204
1. Determine the context to use based on the first hit in this chain:
205
205
206
- 1. Use the `-context` command-line flag if it exists.
206
+ 1. Use the `-- context` command-line flag if it exists.
207
207
2. Use the `current-context` from the merged kubeconfig files.
208
208
-->
209
209
1 . 根据此链中的第一个匹配确定要使用的上下文。
@@ -288,20 +288,20 @@ kubeconfig 文件中的文件和路径引用是相对于 kubeconfig 文件的位
288
288
<!--
289
289
## Proxy
290
290
291
- You can configure `kubectl` to use proxy by setting `proxy-url` in the kubeconfig file, like:
291
+ You can configure `kubectl` to use a proxy per cluster using `proxy-url` in your kubeconfig file, like this :
292
292
-->
293
293
## 代理
294
294
295
- 你可以在 ` kubeconfig ` 文件中设置 ` proxy-url ` 来为 ` kubectl ` 使用代理,例如:
295
+ 你可以在 ` kubeconfig ` 文件中,为每个集群配置 ` proxy-url ` 来让 ` kubectl ` 使用代理,例如:
296
296
297
297
``` yaml
298
298
apiVersion : v1
299
299
kind : Config
300
300
301
- proxy-url : https://proxy.host:3128
302
-
303
301
clusters :
304
302
- cluster :
303
+ proxy-url : http://proxy.example.org:3128
304
+ server : https://k8s.example.org/k8s/clusters/c-xxyyzz
305
305
name : development
306
306
307
307
users :
@@ -310,14 +310,13 @@ users:
310
310
contexts :
311
311
- context :
312
312
name : development
313
-
314
313
` ` `
315
314
316
315
## {{% heading "whatsnext" %}}
317
316
318
317
<!--
319
318
* [Configure Access to Multiple Clusters](/docs/tasks/access-application-cluster/configure-access-multiple-clusters/)
320
319
* [` kubectl config`](/docs/reference/generated/kubectl/kubectl-commands#config)
321
- --- >
320
+ -->
322
321
* [配置对多集群的访问](/zh-cn/docs/tasks/access-application-cluster/configure-access-multiple-clusters/)
323
322
* [`kubectl config`](/docs/reference/generated/kubectl/kubectl-commands#config)
0 commit comments