You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
subresource to obtain a token to access the API is recommended instead.
@@ -237,21 +237,24 @@ You can use the
237
237
command to obtain a token from the `TokenRequest` API.
238
238
{{< /note >}}
239
239
240
-
You should only create a service account token Secret object
240
+
{{< note >}}
241
+
You should only create a ServiceAccount token Secret
241
242
if you can't use the `TokenRequest` API to obtain a token,
242
243
and the security exposure of persisting a non-expiring token credential
243
-
in a readable API object is acceptable to you.
244
+
in a readable API object is acceptable to you. For instructions, see
245
+
[Manually create a long-lived API token for a ServiceAccount](/docs/tasks/configure-pod-container/configure-service-account/#manually-create-a-service-account-api-token).
246
+
{{< /note >}}
244
247
245
248
When using this Secret type, you need to ensure that the
246
249
`kubernetes.io/service-account.name`annotation is set to an existing
247
-
service account name. If you are creating both the ServiceAccount and
250
+
ServiceAccount name. If you are creating both the ServiceAccount and
248
251
the Secret objects, you should create the ServiceAccount object first.
249
252
250
253
After the Secret is created, a Kubernetes {{< glossary_tooltip text="controller" term_id="controller" >}}
251
254
fills in some other fields such as the `kubernetes.io/service-account.uid` annotation, and the
252
255
`token`key in the `data` field, which is populated with an authentication token.
253
256
254
-
The following example configuration declares a service account token Secret:
257
+
The following example configuration declares a ServiceAccount token Secret:
255
258
256
259
```yaml
257
260
apiVersion: v1
@@ -268,12 +271,12 @@ data:
268
271
269
272
After creating the Secret, wait for Kubernetes to populate the `token` key in the `data` field.
270
273
271
-
See the [ServiceAccount](/docs/tasks/configure-pod-container/configure-service-account/)
272
-
documentation for more information on how service accounts work.
274
+
See the [ServiceAccount](/docs/concepts/security/service-accounts/)
275
+
documentation for more information on how ServiceAccounts work.
273
276
You can also check the `automountServiceAccountToken` field and the
@@ -394,7 +397,7 @@ people to understand the purpose of your Secret, and sets a convention for what
394
397
to expect.
395
398
The Kubernetes API verifies that the required keys are set for a Secret of this type.
396
399
397
-
### SSH authentication secrets
400
+
### SSH authentication Secrets
398
401
399
402
The builtin type `kubernetes.io/ssh-auth` is provided for storing data used in
400
403
SSH authentication. When using this Secret type, you will have to specify a
@@ -429,7 +432,7 @@ host server on their own. A secondary means of establishing trust is needed to
429
432
mitigate "man in the middle" attacks, such as a `known_hosts` file added to a ConfigMap.
430
433
{{< /caution >}}
431
434
432
-
### TLS secrets
435
+
### TLS Secrets
433
436
434
437
Kubernetes provides a builtin Secret type `kubernetes.io/tls` for storing
435
438
a certificate and its associated key that are typically used for TLS.
@@ -441,7 +444,9 @@ When using this type of Secret, the `tls.key` and the `tls.crt` key must be prov
441
444
in the `data` (or `stringData`) field of the Secret configuration, although the API
442
445
server doesn't actually validate the values for each key.
443
446
444
-
As an alternative to using `stringData`, you can use the `data` field to provide the base64 encoded certificate and private key. Refer to [Constraints on Secret names and data](#restriction-names-data) for more on this.
447
+
As an alternative to using `stringData`, you can use the `data` field to provide
448
+
the base64 encoded certificate and private key. For details, see
449
+
[Constraints on Secret names and data](#restriction-names-data).
445
450
446
451
The following YAML contains an example config for a TLS Secret:
447
452
@@ -461,10 +466,11 @@ stringData:
461
466
MIIEpgIBAAKCAQEA7yn3bRHQ5FHMQ ...
462
467
```
463
468
464
-
The TLS Secret type is provided for user's convenience. You can create an `Opaque`
465
-
for credentials used for TLS server and/or client. However, using the builtin Secret
466
-
type helps ensure the consistency of Secret format in your project; the API server
467
-
does verify if the required keys are provided in a Secret configuration.
469
+
The TLS Secret type is provided only for convenience.
470
+
You can create an `Opaque` type for credentials used for TLS authentication.
471
+
However, using the defined and public Secret type (`kubernetes.io/ssh-auth`)
472
+
helps ensure the consistency of Secret format in your project. The API server
473
+
verifies if the required keys are set for a Secret of this type.
468
474
469
475
When creating a TLS Secret using `kubectl`, you can use the `tls` subcommand
470
476
as shown in the following example:
@@ -521,8 +527,8 @@ A bootstrap type Secret has the following keys specified under `data`:
521
527
- `auth-extra-groups`: A comma-separated list of group names that will be
522
528
authenticated as in addition to the `system:bootstrappers` group.
523
529
524
-
The above YAML may look confusing because the values are all in base64 encoded
525
-
strings. In fact, you can create an identical Secret using the following YAML:
530
+
You can alternatively provide the values in the `stringData` field of the Secret
0 commit comments