@@ -122,6 +122,11 @@ tokens which are [less secure than the bound token](https://github.com/kubernete
122
122
2 . Emit warnings when using auto-generated token secrets.
123
123
3 . Add pointers of TokenRequest API and manually created tokens in the validation
124
124
result.
125
+ 4 . Marked the auto-generated tokens as invalid if they are not used for more
126
+ than the duration configured by ` --legacy-service-account-token-clean-up-period `
127
+ (one year by default). And allow the users to re-activate the invalid
128
+ auto-generated tokens within the duration of ` --legacy-service-account-token-clean-up-period `
129
+ before the tokens are finally deleted.
125
130
126
131
## Design Details
127
132
@@ -154,7 +159,7 @@ indicates if tracking is enabled in the cluster. It is similar to the existing
154
159
Token Controller starts to remove unused auto-generated secrets (secrets
155
160
bi-directionally referenced by the service account) and not mounted by pods.
156
161
157
- When this feature is Beta and enabled by default, delete secrets iff it is over
162
+ When this feature is Beta and enabled by default, mark the secrets as invalid iff it is over
158
163
a sufficient period of time (one year by default) since last used. The period
159
164
can be configured by cluster admins.
160
165
@@ -165,6 +170,18 @@ Determine the date that a given secret was last used:
165
170
166
171
If ` kube-apiserver-legacy-service-account-token-tracking ` is unavailable, no secret would be removed.
167
172
173
+ Mark the secrets as invalid and recover:
174
+
175
+ 1 . The secrets will be added a label ` kubernetes.io/legacy-token-invalid-since ` , with the date as value.
176
+ 2 . If the users use the invalid tokens, in the Validate() function of
177
+ "kubernetes/pkg/serviceaccount/legacy.go", it will detect the usage of
178
+ invalid tokens and return the error information, telling the users to
179
+ re-activate the token by updating the label value or use the tokenrequest. At
180
+ the same time, the tokens will be updated with the new ` kubernetes.io/legacy-token-last-used ` date.
181
+ 3 . If the users don't use the invalid tokens, after the duration configured
182
+ through ` --legacy-service-account-token-clean-up-period ` (one year by default)
183
+ since the tokens are marked as invalid, the tokens will be finally deleted.
184
+
168
185
### Test Plan
169
186
170
187
[ X] I/we understand the owners of the involved components may require updates to
0 commit comments