Skip to content

Commit 539b202

Browse files
committed
Minor capitalization cleanup and link adjustment
1 parent 08e0d63 commit 539b202

File tree

1 file changed

+31
-25
lines changed
  • content/en/docs/concepts/configuration

1 file changed

+31
-25
lines changed

content/en/docs/concepts/configuration/secret.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,16 @@ Kubernetes doesn't impose any constraints on the type name. However, if you
182182
are using one of the built-in types, you must meet all the requirements defined
183183
for that type.
184184

185-
If you are defining a type of secret that's for public use, follow the convention
186-
and structure the secret type to have your domain name before the name, separated
185+
If you are defining a type of Secret that's for public use, follow the convention
186+
and structure the Secret type to have your domain name before the name, separated
187187
by a `/`. For example: `cloud-hosting.example.net/cloud-api-credentials`.
188188

189-
### Opaque secrets
189+
### Opaque Secrets
190190

191191
`Opaque` is the default Secret type if omitted from a Secret configuration file.
192192
When you create a Secret using `kubectl`, you will use the `generic`
193193
subcommand to indicate an `Opaque` Secret type. For example, the following
194-
command creates an empty Secret of type `Opaque`.
194+
command creates an empty Secret of type `Opaque`:
195195

196196
```shell
197197
kubectl create secret generic empty-secret
@@ -208,11 +208,11 @@ empty-secret Opaque 0 2m6s
208208
The `DATA` column shows the number of data items stored in the Secret.
209209
In this case, `0` means you have created an empty Secret.
210210

211-
### Service account token Secrets
211+
### ServiceAccount token Secrets
212212

213213
A `kubernetes.io/service-account-token` type of Secret is used to store a
214214
token credential that identifies a
215-
{{< glossary_tooltip text="service account" term_id="service-account" >}}.
215+
{{< glossary_tooltip text="ServiceAccount" term_id="service-account" >}}.
216216

217217
{{< note >}}
218218
Versions of Kubernetes before v1.22 automatically created credentials for
@@ -228,7 +228,7 @@ automatically invalidated when the Pod they are mounted into is deleted.
228228

229229
You can still
230230
[manually create](/docs/tasks/configure-pod-container/configure-service-account/#manually-create-a-service-account-api-token)
231-
a service account token Secret; for example, if you need a token that never
231+
a ServiceAccount token Secret; for example, if you need a token that never
232232
expires. However, using the
233233
[TokenRequest](/docs/reference/kubernetes-api/authentication-resources/token-request-v1/)
234234
subresource to obtain a token to access the API is recommended instead.
@@ -237,21 +237,24 @@ You can use the
237237
command to obtain a token from the `TokenRequest` API.
238238
{{< /note >}}
239239

240-
You should only create a service account token Secret object
240+
{{< note >}}
241+
You should only create a ServiceAccount token Secret
241242
if you can't use the `TokenRequest` API to obtain a token,
242243
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 >}}
244247

245248
When using this Secret type, you need to ensure that the
246249
`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
248251
the Secret objects, you should create the ServiceAccount object first.
249252

250253
After the Secret is created, a Kubernetes {{< glossary_tooltip text="controller" term_id="controller" >}}
251254
fills in some other fields such as the `kubernetes.io/service-account.uid` annotation, and the
252255
`token` key in the `data` field, which is populated with an authentication token.
253256

254-
The following example configuration declares a service account token Secret:
257+
The following example configuration declares a ServiceAccount token Secret:
255258

256259
```yaml
257260
apiVersion: v1
@@ -268,12 +271,12 @@ data:
268271

269272
After creating the Secret, wait for Kubernetes to populate the `token` key in the `data` field.
270273

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.
273276
You can also check the `automountServiceAccountToken` field and the
274277
`serviceAccountName` field of the
275278
[`Pod`](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core)
276-
for information on referencing service account credentials from within Pods.
279+
for information on referencing ServiceAccount credentials from within Pods.
277280

278281
### Docker config Secrets
279282

@@ -319,8 +322,8 @@ server checks whether the expected key exists in the `data` field, and
319322
it verifies if the value provided can be parsed as a valid JSON. The API
320323
server doesn't validate if the JSON actually is a Docker config file.
321324

322-
When you do not have a Docker config file, or you want to use `kubectl`
323-
to create a Secret for accessing a container registry, you can do:
325+
You can also use `kubectl` to create a Secret for accessing a container
326+
registry, such as when you don't have a Docker configuration file:
324327

325328
```shell
326329
kubectl create secret docker-registry secret-tiger-docker \
@@ -394,7 +397,7 @@ people to understand the purpose of your Secret, and sets a convention for what
394397
to expect.
395398
The Kubernetes API verifies that the required keys are set for a Secret of this type.
396399

397-
### SSH authentication secrets
400+
### SSH authentication Secrets
398401

399402
The builtin type `kubernetes.io/ssh-auth` is provided for storing data used in
400403
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
429432
mitigate "man in the middle" attacks, such as a `known_hosts` file added to a ConfigMap.
430433
{{< /caution >}}
431434

432-
### TLS secrets
435+
### TLS Secrets
433436

434437
Kubernetes provides a builtin Secret type `kubernetes.io/tls` for storing
435438
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
441444
in the `data` (or `stringData`) field of the Secret configuration, although the API
442445
server doesn't actually validate the values for each key.
443446

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).
445450

446451
The following YAML contains an example config for a TLS Secret:
447452

@@ -461,10 +466,11 @@ stringData:
461466
MIIEpgIBAAKCAQEA7yn3bRHQ5FHMQ ...
462467
```
463468

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.
468474

469475
When creating a TLS Secret using `kubectl`, you can use the `tls` subcommand
470476
as shown in the following example:
@@ -521,8 +527,8 @@ A bootstrap type Secret has the following keys specified under `data`:
521527
- `auth-extra-groups`: A comma-separated list of group names that will be
522528
authenticated as in addition to the `system:bootstrappers` group.
523529

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
531+
without base64 encoding them:
526532

527533
```yaml
528534
apiVersion: v1

0 commit comments

Comments
 (0)