@@ -96,7 +96,7 @@ Here's an example of how that looks for a launched Pod:
96
96
That manifest snippet defines a projected volume that consists of three sources. In this case,
97
97
each source also represents a single path within that volume. The three sources are:
98
98
99
- 1. A ` serviceAccountToken` source, that contains a token that the kubelet acquires from kube-apiserver
99
+ 1. A ` serviceAccountToken` source, that contains a token that the kubelet acquires from kube-apiserver.
100
100
The kubelet fetches time-bound tokens using the TokenRequest API. A token served for a TokenRequest expires
101
101
either when the pod is deleted or after a defined lifespan (by default, that is 1 hour).
102
102
The token is bound to the specific Pod and has the kube-apiserver as its audience.
@@ -105,7 +105,7 @@ each source also represents a single path within that volume. The three sources
105
105
1. A `configMap` source. The ConfigMap contains a bundle of certificate authority data. Pods can use these
106
106
certificates to make sure that they are connecting to your cluster's kube-apiserver (and not to middlebox
107
107
or an accidentally misconfigured peer).
108
- 1. A `downwardAPI` source that looks up the name of thhe namespace containing the Pod, and makes
108
+ 1. A `downwardAPI` source that looks up the name of the namespace containing the Pod, and makes
109
109
that name information available to application code running inside the Pod.
110
110
111
111
Any container within the Pod that mounts this particular volume can access the above information.
@@ -232,14 +232,14 @@ Here's an example of how that looks for a launched Pod:
232
232
233
233
That manifest snippet defines a projected volume that combines information from three sources :
234
234
235
- 1. A `serviceAccountToken` source, that contains a token that the kubelet acquires from kube-apiserver
235
+ 1. A `serviceAccountToken` source, that contains a token that the kubelet acquires from kube-apiserver.
236
236
The kubelet fetches time-bound tokens using the TokenRequest API. A token served for a TokenRequest expires
237
237
either when the pod is deleted or after a defined lifespan (by default, that is 1 hour).
238
238
The token is bound to the specific Pod and has the kube-apiserver as its audience.
239
239
1. A `configMap` source. The ConfigMap contains a bundle of certificate authority data. Pods can use these
240
240
certificates to make sure that they are connecting to your cluster's kube-apiserver (and not to middlebox
241
241
or an accidentally misconfigured peer).
242
- 1. A `downwardAPI` source. This `downwardAPI` volume makes the name of the namespace container the Pod available
242
+ 1. A `downwardAPI` source. This `downwardAPI` volume makes the name of the namespace containing the Pod available
243
243
to application code running inside the Pod.
244
244
245
245
Any container within the Pod that mounts this volume can access the above information.
@@ -262,6 +262,7 @@ Here is a sample manifest for such a Secret:
262
262
{{< codenew file="secret/serviceaccount/mysecretname.yaml" >}}
263
263
264
264
To create a Secret based on this example, run :
265
+
265
266
` ` ` shell
266
267
kubectl -n examplens create -f https://k8s.io/examples/secret/serviceaccount/mysecretname.yaml
267
268
` ` `
@@ -273,6 +274,7 @@ kubectl -n examplens describe secret mysecretname
273
274
` ` `
274
275
275
276
The output is similar to :
277
+
276
278
` ` `
277
279
Name: mysecretname
278
280
Namespace: examplens
@@ -306,7 +308,9 @@ Otherwise, first find the Secret for the ServiceAccount.
306
308
# This assumes that you already have a namespace named 'examplens'
307
309
kubectl -n examplens get serviceaccount/example-automated-thing -o yaml
308
310
` ` `
311
+
309
312
The output is similar to :
313
+
310
314
` ` ` yaml
311
315
apiVersion: v1
312
316
kind: ServiceAccount
@@ -321,9 +325,11 @@ metadata:
321
325
selfLink: /api/v1/namespaces/examplens/serviceaccounts/example-automated-thing
322
326
uid: f23fd170-66f2-4697-b049-e1e266b7f835
323
327
secrets:
324
- - name: example-automated-thing-token-zyxwv
328
+ - name: example-automated-thing-token-zyxwv
325
329
` ` `
330
+
326
331
Then, delete the Secret you now know the name of :
332
+
327
333
` ` ` shell
328
334
kubectl -n examplens delete secret/example-automated-thing-token-zyxwv
329
335
` ` `
@@ -334,6 +340,7 @@ and creates a replacement:
334
340
` ` ` shell
335
341
kubectl -n examplens get serviceaccount/example-automated-thing -o yaml
336
342
` ` `
343
+
337
344
` ` ` yaml
338
345
apiVersion: v1
339
346
kind: ServiceAccount
@@ -348,12 +355,13 @@ metadata:
348
355
selfLink: /api/v1/namespaces/examplens/serviceaccounts/example-automated-thing
349
356
uid: f23fd170-66f2-4697-b049-e1e266b7f835
350
357
secrets:
351
- - name: example-automated-thing-token-4rdrh
358
+ - name: example-automated-thing-token-4rdrh
352
359
` ` `
353
360
354
361
# # Clean up
355
362
356
363
If you created a namespace `examplens` to experiment with, you can remove it :
364
+
357
365
` ` ` shell
358
366
kubectl delete namespace examplens
359
367
` ` `
0 commit comments