Skip to content

Commit 86b4d71

Browse files
authored
Merge pull request #75196 from bergerhoffer/OSDOCS-10143
OSDOCS#10143: Updating that SA API token secrets are no longer automa…
2 parents 883897b + 2768745 commit 86b4d71

File tree

5 files changed

+29
-54
lines changed

5 files changed

+29
-54
lines changed

authentication/using-service-accounts-in-applications.adoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ include::modules/service-accounts-default.adoc[leveloffset=+1]
1212

1313
include::modules/service-account-auto-secret-removed.adoc[leveloffset=+2]
1414

15-
.Additional resources
16-
17-
* For information about requesting bound service account tokens, see xref:../authentication/bound-service-account-tokens.adoc#bound-sa-tokens-configuring_bound-service-account-tokens[Configuring bound service account tokens using volume projection].
18-
19-
* For information about creating a service account token secret, see xref:../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating-sa_nodes-pods-secrets[Creating a service account token secret].
20-
2115
include::modules/service-accounts-creating.adoc[leveloffset=+1]
2216

2317
// include::modules/service-accounts-using-credentials-inside-a-container.adoc[leveloffset=+1]

modules/cluster-image-registry-operator.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ If insufficient information is available to define a complete `image-registry` r
3434
The Cluster Image Registry Operator runs in the `openshift-image-registry` namespace and it also manages the registry instance in that location. All configuration and workload resources for the registry reside in that namespace.
3535

3636
ifdef::cluster-caps[]
37-
In order to integrate the image registry into the cluster's user authentication and authorization system, a service account token secret and an image pull secret are generated for each service account in the cluster.
37+
In order to integrate the image registry into the cluster's user authentication and authorization system, an image pull secret is generated for each service account in the cluster.
3838

3939
[IMPORTANT]
4040
====
41-
If you disable the `ImageRegistry` capability or if you disable the integrated {product-registry} in the Cluster Image Registry Operator's configuration, the service account token secret and image pull secret are not generated for each service account.
41+
If you disable the `ImageRegistry` capability or if you disable the integrated {product-registry} in the Cluster Image Registry Operator's configuration, the image pull secret is not generated for each service account.
4242
====
4343

4444
If you disable the `ImageRegistry` capability, you can reduce the overall resource footprint of {product-title} in resource-constrained environments. Depending on your deployment, you can disable this component if you do not need it.

modules/nodes-pods-secrets-creating-sa.adoc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,30 @@
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="nodes-pods-secrets-creating-sa_{context}"]
7-
= Creating a service account token secret
7+
= Creating a legacy service account token secret
88

9-
As an administrator, you can create a service account token secret, which allows you to distribute a service account token to applications that must authenticate to the API.
9+
As an administrator, you can create a legacy service account token secret, which allows you to distribute a service account token to applications that must authenticate to the API.
1010

11-
[NOTE]
11+
[WARNING]
1212
====
13-
It is recommended to obtain bound service account tokens using the TokenRequest API instead of using service account token secrets. The tokens obtained from the TokenRequest API are more secure than the tokens stored in secrets, because they have a bounded lifetime and are not readable by other API clients.
13+
It is recommended to obtain bound service account tokens using the TokenRequest API instead of using legacy service account token secrets. You should create a service account token secret only if you cannot use the TokenRequest API and if the security exposure of a nonexpiring token in a readable API object is acceptable to you.
1414
15-
You should create a service account token secret only if you cannot use the TokenRequest API and if the security exposure of a non-expiring token in a readable API object is acceptable to you.
15+
Bound service account tokens are more secure than service account token secrets for the following reasons:
1616
17-
See the Additional resources section that follows for information on creating bound service account tokens.
17+
* Bound service account tokens have a bounded lifetime.
18+
* Bound service account tokens contain audiences.
19+
* Bound service account tokens can be bound to pods or secrets and the bound tokens are invalidated when the bound object is removed.
20+
21+
Workloads are automatically injected with a projected volume to obtain a bound service account token. If your workload needs an additional service account token, add an additional projected volume in your workload manifest.
22+
23+
For more information, see "Configuring bound service account tokens using volume projection".
1824
====
1925

2026
.Procedure
2127

2228
. Create a `Secret` object in a YAML file on a control plane node:
2329
+
24-
.Example `secret` object:
30+
.Example `Secret` object
2531
[source,yaml]
2632
----
2733
apiVersion: v1

modules/service-account-auto-secret-removed.adoc

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,19 @@
55

66
:_mod-docs-content-type: CONCEPT
77
[id="auto-generated-sa-token-secrets_{context}"]
8-
= Automatically generated secrets
8+
= Automatically generated image pull secrets
99

10-
By default, {product-title} creates the following secrets for each service account:
10+
By default, {product-title} creates an image pull secret for each service account.
1111

12-
* A dockercfg image pull secret
13-
* A service account token secret
14-
+
1512
[NOTE]
1613
====
17-
Prior to {product-title} 4.11, a second service account token secret was generated when a service account was created. This service account token secret was used to access the Kubernetes API.
14+
Prior to {product-title} 4.16, a long-lived service account API token secret was also generated for each service account that was created. Starting with {product-title} 4.16, this service account API token secret is no longer created.
1815
19-
Starting with {product-title} 4.11, this second service account token secret is no longer created. This is because the `LegacyServiceAccountTokenNoAutoGeneration` upstream Kubernetes feature gate was enabled, which stops the automatic generation of secret-based service account tokens to access the Kubernetes API.
20-
21-
After upgrading to {product-version}, any existing service account token secrets are not deleted and continue to function.
16+
After upgrading to {product-version}, any existing long-lived service account API token secrets are not deleted and will continue to function. For information about detecting long-lived API tokens that are in use in your cluster or deleting them if they are not needed, see the Red Hat Knowledgebase article link:https://access.redhat.com/articles/7058801[Long-lived service account API tokens in OpenShift Container Platform].
2217
====
2318

24-
This service account token secret and docker configuration image pull secret are necessary to integrate the {product-registry} into the cluster's user authentication and authorization system.
25-
26-
However, if you do not enable the `ImageRegistry` capability or if you disable the integrated {product-registry} in the Cluster Image Registry Operator's configuration, these secrets are not generated for each service account.
27-
28-
[WARNING]
29-
====
30-
Do not rely on these automatically generated secrets for your own use; they might be removed in a future {product-title} release.
31-
====
32-
33-
Workloads are automatically injected with a projected volume to obtain a bound service account token. If your workload needs an additional service account token, add an additional projected volume in your workload manifest. Bound service account tokens are more secure than service account token secrets for the following reasons:
34-
35-
* Bound service account tokens have a bounded lifetime.
36-
* Bound service account tokens contain audiences.
37-
* Bound service account tokens can be bound to pods or secrets and the bound tokens are invalidated when the bound object is removed.
19+
This image pull secret is necessary to integrate the {product-registry} into the cluster's user authentication and authorization system.
3820

39-
For more information, see _Configuring bound service account tokens using volume projection_.
21+
However, if you do not enable the `ImageRegistry` capability or if you disable the integrated {product-registry} in the Cluster Image Registry Operator's configuration, an image pull secret is not generated for each service account.
4022

41-
You can also manually create a service account token secret to obtain a token, if the security exposure of a non-expiring token in a readable API object is acceptable to you. For more information, see _Creating a service account token secret_.
23+
When the integrated {product-registry} is disabled on a cluster that previously had it enabled, the previously generated image pull secrets are deleted automatically.

nodes/pods/nodes-pods-secrets.adoc

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,56 +14,49 @@ include::modules/nodes-pods-secrets-about.adoc[leveloffset=+1]
1414

1515
include::modules/service-account-auto-secret-removed.adoc[leveloffset=+2]
1616

17-
.Additional resources
18-
19-
ifndef::openshift-rosa,openshift-dedicated[]
20-
* For information about requesting bound service account tokens, see xref:../../authentication/bound-service-account-tokens.adoc#bound-sa-tokens-configuring_bound-service-account-tokens[Using bound service account tokens]
21-
endif::openshift-rosa,openshift-dedicated[]
22-
* For information about creating a service account token secret, see xref:../../nodes/pods/nodes-pods-secrets.doc#nodes-pods-secrets-creating-sa_nodes-pods-secrets[Creating a service account token secret].
23-
2417
include::modules/nodes-pods-secrets-creating.adoc[leveloffset=+1]
2518

2619
include::modules/nodes-pods-secrets-creating-opaque.adoc[leveloffset=+2]
2720

2821
[role="_additional-resources"]
2922
.Additional resources
3023

31-
* For more information on using secrets in pods, see xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets].
24+
* xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets]
3225
3326
include::modules/nodes-pods-secrets-creating-sa.adoc[leveloffset=+2]
3427

3528
[role="_additional-resources"]
3629
.Additional resources
3730

38-
* For more information on using secrets in pods, see xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets].
31+
* xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets]
3932
4033
ifndef::openshift-rosa,openshift-dedicated[]
4134

42-
* For information on requesting bound service account tokens, see xref:../../authentication/bound-service-account-tokens.adoc#bound-sa-tokens-configuring_bound-service-account-tokens[Using bound service account tokens]
35+
* xref:../../authentication/bound-service-account-tokens.adoc#bound-sa-tokens-configuring_bound-service-account-tokens[Configuring bound service account tokens using volume projection]
4336
44-
* For information on creating service accounts, see xref:../../authentication/understanding-and-creating-service-accounts.adoc#understanding-and-creating-service-accounts[Understanding and creating service accounts].
37+
* xref:../../authentication/understanding-and-creating-service-accounts.adoc#understanding-and-creating-service-accounts[Understanding and creating service accounts]
4538
endif::openshift-rosa,openshift-dedicated[]
4639
4740
include::modules/nodes-pods-secrets-creating-basic.adoc[leveloffset=+2]
4841

4942
[role="_additional-resources"]
5043
.Additional resources
5144

52-
* For more information on using secrets in pods, see xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets].
45+
* xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets]
5346
5447
include::modules/nodes-pods-secrets-creating-ssh.adoc[leveloffset=+2]
5548

5649
[role="_additional-resources"]
5750
.Additional resources
5851

59-
* xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets].
52+
* xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets]
6053
6154
include::modules/nodes-pods-secrets-creating-docker.adoc[leveloffset=+2]
6255

6356
[role="_additional-resources"]
6457
.Additional resources
6558

66-
* For more information on using secrets in pods, see xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets].
59+
* xref:../../nodes/pods/nodes-pods-secrets.adoc#nodes-pods-secrets-creating_nodes-pods-secrets[Understanding how to create secrets]
6760
6861
include::modules/nodes-pods-secrets-creating-web-console-secrets.adoc[leveloffset=+2]
6962

0 commit comments

Comments
 (0)