@@ -41,12 +41,12 @@ cluster's API server.
41
41
42
42
## Define clusters, users, and contexts
43
43
44
- Suppose you have two clusters, one for development work and one for scratch work.
44
+ Suppose you have two clusters, one for development work and one for test work.
45
45
In the ` development ` cluster, your frontend developers work in a namespace called ` frontend ` ,
46
- and your storage developers work in a namespace called ` storage ` . In your ` scratch ` cluster,
46
+ and your storage developers work in a namespace called ` storage ` . In your ` test ` cluster,
47
47
developers work in the default namespace, or they create auxiliary namespaces as they
48
48
see fit. Access to the development cluster requires authentication by certificate. Access
49
- to the scratch cluster requires authentication by username and password.
49
+ to the test cluster requires authentication by username and password.
50
50
51
51
Create a directory named ` config-exercise ` . In your
52
52
` config-exercise ` directory, create a file named ` config-demo ` with this content:
@@ -60,7 +60,7 @@ clusters:
60
60
- cluster :
61
61
name : development
62
62
- cluster :
63
- name : scratch
63
+ name : test
64
64
65
65
users :
66
66
- name : developer
@@ -72,7 +72,7 @@ contexts:
72
72
- context :
73
73
name : dev-storage
74
74
- context :
75
- name : exp-scratch
75
+ name : exp-test
76
76
` ` `
77
77
78
78
A configuration file describes clusters, users, and contexts. Your ` config-demo` file
@@ -83,7 +83,7 @@ your configuration file:
83
83
84
84
` ` ` shell
85
85
kubectl config --kubeconfig=config-demo set-cluster development --server=https://1.2.3.4 --certificate-authority=fake-ca-file
86
- kubectl config --kubeconfig=config-demo set-cluster scratch --server=https://5.6.7.8 --insecure-skip-tls-verify
86
+ kubectl config --kubeconfig=config-demo set-cluster test --server=https://5.6.7.8 --insecure-skip-tls-verify
87
87
` ` `
88
88
89
89
Add user details to your configuration file :
@@ -108,7 +108,7 @@ Add context details to your configuration file:
108
108
` ` ` shell
109
109
kubectl config --kubeconfig=config-demo set-context dev-frontend --cluster=development --namespace=frontend --user=developer
110
110
kubectl config --kubeconfig=config-demo set-context dev-storage --cluster=development --namespace=storage --user=developer
111
- kubectl config --kubeconfig=config-demo set-context exp-scratch --cluster=scratch --namespace=default --user=experimenter
111
+ kubectl config --kubeconfig=config-demo set-context exp-test --cluster=test --namespace=default --user=experimenter
112
112
` ` `
113
113
114
114
Open your `config-demo` file to see the added details. As an alternative to opening the
@@ -130,7 +130,7 @@ clusters:
130
130
- cluster:
131
131
insecure-skip-tls-verify: true
132
132
server: https://5.6.7.8
133
- name: scratch
133
+ name: test
134
134
contexts:
135
135
- context:
136
136
cluster: development
@@ -143,10 +143,10 @@ contexts:
143
143
user: developer
144
144
name: dev-storage
145
145
- context:
146
- cluster: scratch
146
+ cluster: test
147
147
namespace: default
148
148
user: experimenter
149
- name: exp-scratch
149
+ name: exp-test
150
150
current-context: ""
151
151
kind: Config
152
152
preferences: {}
@@ -220,19 +220,19 @@ users:
220
220
client-key: fake-key-file
221
221
` ` `
222
222
223
- Now suppose you want to work for a while in the scratch cluster.
223
+ Now suppose you want to work for a while in the test cluster.
224
224
225
- Change the current context to `exp-scratch ` :
225
+ Change the current context to `exp-test ` :
226
226
227
227
` ` ` shell
228
- kubectl config --kubeconfig=config-demo use-context exp-scratch
228
+ kubectl config --kubeconfig=config-demo use-context exp-test
229
229
` ` `
230
230
231
231
Now any `kubectl` command you give will apply to the default namespace of
232
- the `scratch ` cluster. And the command will use the credentials of the user
233
- listed in the `exp-scratch ` context.
232
+ the `test ` cluster. And the command will use the credentials of the user
233
+ listed in the `exp-test ` context.
234
234
235
- View configuration associated with the new current context, `exp-scratch `.
235
+ View configuration associated with the new current context, `exp-test `.
236
236
237
237
` ` ` shell
238
238
kubectl config --kubeconfig=config-demo view --minify
@@ -338,10 +338,10 @@ contexts:
338
338
user: developer
339
339
name: dev-storage
340
340
- context:
341
- cluster: scratch
341
+ cluster: test
342
342
namespace: default
343
343
user: experimenter
344
- name: exp-scratch
344
+ name: exp-test
345
345
` ` `
346
346
347
347
For more information about how kubeconfig files are merged, see
0 commit comments