@@ -66,24 +66,24 @@ cluster's API server.
66
66
<!--
67
67
## Define clusters, users, and contexts
68
68
69
- Suppose you have two clusters, one for development work and one for scratch work.
69
+ Suppose you have two clusters, one for development work and one for test work.
70
70
In the `development` cluster, your frontend developers work in a namespace called `frontend`,
71
- and your storage developers work in a namespace called `storage`. In your `scratch ` cluster,
71
+ and your storage developers work in a namespace called `storage`. In your `test ` cluster,
72
72
developers work in the default namespace, or they create auxiliary namespaces as they
73
73
see fit. Access to the development cluster requires authentication by certificate. Access
74
- to the scratch cluster requires authentication by username and password.
74
+ to the test cluster requires authentication by username and password.
75
75
76
76
Create a directory named `config-exercise`. In your
77
77
`config-exercise` directory, create a file named `config-demo` with this content:
78
78
-->
79
79
## 定义集群、用户和上下文 {#define-clusters-users-and-contexts}
80
80
81
- 假设用户有两个集群,一个用于正式开发工作,一个用于其它临时用途(scratch )。
81
+ 假设用户有两个集群,一个用于开发工作(development),一个用于测试工作(test )。
82
82
在 ` development ` 集群中,前端开发者在名为 ` frontend ` 的名字空间下工作,
83
- 存储开发者在名为 ` storage ` 的名字空间下工作。在 ` scratch ` 集群中,
83
+ 存储开发者在名为 ` storage ` 的名字空间下工作。在 ` test ` 集群中,
84
84
开发人员可能在默认名字空间下工作,也可能视情况创建附加的名字空间。
85
85
访问开发集群需要通过证书进行认证。
86
- 访问其它临时用途的集群需要通过用户名和密码进行认证 。
86
+ 访问测试集群需要通过用户名和密码进行认证 。
87
87
88
88
创建名为 ` config-exercise ` 的目录。在
89
89
` config-exercise ` 目录中,创建名为 ` config-demo ` 的文件,其内容为:
@@ -97,7 +97,7 @@ clusters:
97
97
- cluster :
98
98
name : development
99
99
- cluster :
100
- name : scratch
100
+ name : test
101
101
102
102
users :
103
103
- name : developer
@@ -109,7 +109,7 @@ contexts:
109
109
- context :
110
110
name : dev-storage
111
111
- context :
112
- name : exp-scratch
112
+ name : exp-test
113
113
` ` `
114
114
115
115
<!--
@@ -126,7 +126,7 @@ your configuration file:
126
126
127
127
` ` ` shell
128
128
kubectl config --kubeconfig=config-demo set-cluster development --server=https://1.2.3.4 --certificate-authority=fake-ca-file
129
- kubectl config --kubeconfig=config-demo set-cluster scratch --server=https://5.6.7.8 --insecure-skip-tls-verify
129
+ kubectl config --kubeconfig=config-demo set-cluster test --server=https://5.6.7.8 --insecure-skip-tls-verify
130
130
` ` `
131
131
132
132
<!--
@@ -167,7 +167,7 @@ Add context details to your configuration file:
167
167
` ` ` shell
168
168
kubectl config --kubeconfig=config-demo set-context dev-frontend --cluster=development --namespace=frontend --user=developer
169
169
kubectl config --kubeconfig=config-demo set-context dev-storage --cluster=development --namespace=storage --user=developer
170
- kubectl config --kubeconfig=config-demo set-context exp-scratch --cluster=scratch --namespace=default --user=experimenter
170
+ kubectl config --kubeconfig=config-demo set-context exp-test --cluster=test --namespace=default --user=experimenter
171
171
` ` `
172
172
173
173
<!--
@@ -196,7 +196,7 @@ clusters:
196
196
- cluster:
197
197
insecure-skip-tls-verify: true
198
198
server: https://5.6.7.8
199
- name: scratch
199
+ name: test
200
200
contexts:
201
201
- context:
202
202
cluster: development
@@ -209,10 +209,10 @@ contexts:
209
209
user: developer
210
210
name: dev-storage
211
211
- context:
212
- cluster: scratch
212
+ cluster: test
213
213
namespace: default
214
214
user: experimenter
215
- name: exp-scratch
215
+ name: exp-test
216
216
current-context: ""
217
217
kind: Config
218
218
preferences: {}
@@ -310,29 +310,29 @@ users:
310
310
` ` `
311
311
312
312
<!--
313
- Now suppose you want to work for a while in the scratch cluster.
313
+ Now suppose you want to work for a while in the test cluster.
314
314
315
- Change the current context to `exp-scratch ` :
315
+ Change the current context to `exp-test ` :
316
316
-->
317
- 现在假设用户希望在其它临时用途集群中工作一段时间 。
317
+ 现在假设用户希望在测试集群中工作一段时间 。
318
318
319
- 将当前上下文更改为 `exp-scratch `:
319
+ 将当前上下文更改为 `exp-test `:
320
320
321
321
` ` ` shell
322
- kubectl config --kubeconfig=config-demo use-context exp-scratch
322
+ kubectl config --kubeconfig=config-demo use-context exp-test
323
323
` ` `
324
324
325
325
<!--
326
326
Now any `kubectl` command you give will apply to the default namespace of
327
- the `scratch ` cluster. And the command will use the credentials of the user
328
- listed in the `exp-scratch ` context.
327
+ the `test ` cluster. And the command will use the credentials of the user
328
+ listed in the `exp-test ` context.
329
329
330
- View configuration associated with the new current context, `exp-scratch `.
330
+ View configuration associated with the new current context, `exp-test `.
331
331
-->
332
- 现在你发出的所有 `kubectl` 命令都将应用于 `scratch ` 集群的默认名字空间。
333
- 同时,命令会使用 `exp-scratch ` 上下文中所列用户的凭证。
332
+ 现在你发出的所有 `kubectl` 命令都将应用于 `test ` 集群的默认名字空间。
333
+ 同时,命令会使用 `exp-test ` 上下文中所列用户的凭证。
334
334
335
- 查看更新后的当前上下文 `exp-scratch ` 相关的配置:
335
+ 查看更新后的当前上下文 `exp-test ` 相关的配置:
336
336
337
337
` ` ` shell
338
338
kubectl config --kubeconfig=config-demo view --minify
@@ -476,10 +476,10 @@ contexts:
476
476
user: developer
477
477
name: dev-storage
478
478
- context:
479
- cluster: scratch
479
+ cluster: test
480
480
namespace: default
481
481
user: experimenter
482
- name: exp-scratch
482
+ name: exp-test
483
483
` ` `
484
484
485
485
<!--
0 commit comments