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
Legacy service account tokens distributed via secrets are not time-bound.
273
-
Many client libraries have come to depend on this behavior. After time-bound service
274
-
account token being used, if in-cluster clients do not periodically reload token
275
-
from projected volume, requests would be rejected once the initial token got expired.
312
+
Legacy service account tokens distributed via secrets are not time-bound. Many
313
+
client libraries have come to depend on this behavior. After time-bound service
314
+
account token being used, if in-cluster clients do not periodically reload token
315
+
from projected volume, requests would be rejected once the initial token got
316
+
expired.
276
317
277
318
In order to allow guadual adoption of time-bound token, we would:
278
-
1. Pick a constant period D between one and two hours. The value of D would be static
279
-
across Kubernetes deployments, while avoiding collision with common duration.
280
-
1. Modify service account admission control to inject token valid for D when the
281
-
BoundServiceAccountTokenVolume feature is enabled.
282
-
1. Modify kube apiserver TokenRequest API. When it receives TokenRequest with requested
283
-
valid period D, extend the token lifetime to one year. At the same time, save
284
-
the original requested D to `kubernetes.io/warnafter` field in minted token.
285
-
1. In the TokenRequest status, tell clients that the token would be valid only for D,
286
-
encouraging clients to reload token as if the token was valid for D.
287
-
319
+
320
+
1. Pick a constant period D between one and two hours. The value of D would be
321
+
static across Kubernetes deployments, while avoiding collision with common
322
+
duration.
323
+
1. Modify service account admission control to inject token valid for D when
324
+
the BoundServiceAccountTokenVolume feature is enabled.
325
+
1. Modify kube apiserver TokenRequest API. When it receives TokenRequest with
326
+
requested valid period D, extend the token lifetime to one year. At the same
327
+
time, save the original requested D to `kubernetes.io/warnafter` field in
328
+
minted token.
329
+
1. In the TokenRequest status, tell clients that the token would be valid only
330
+
for D, encouraging clients to reload token as if the token was valid for D.
331
+
288
332
This modification could be optionally enabled by providing a command line flag
289
-
to kube apiserver.
333
+
to kube apiserver.
334
+
335
+
These extended tokens would not expire and continue to be accepted within one
336
+
year. At the same time, the authentication side could monitor whether clients
337
+
are properly reloading tokens by:
290
338
291
-
These extended tokens would not expire and continue to be accepted within one year.
292
-
At the same time, the authentication side could monitor whether clients are properly
293
-
reloading tokens by:
339
+
1. Compare the `kubernetes.io/warnafter` field with current time. If current
340
+
time is after `kubernetes.io/warnafter` field, it implies calling client is
341
+
not reloading token regularly.
342
+
1. Expose metrics to monitor number of legacy and stale token used.
343
+
1. Add annotation to audit events for legacy and stale tokens including
344
+
necessary information to locate problematic client.
294
345
295
-
1. Compare the `kubernetes.io/warnafter` field with current time. If current time
296
-
is after `kubernetes.io/warnafter` field, it implies calling client is not
297
-
reloading token regularly.
298
-
1. Expose metrics to monitor number of legacy and stale token used.
299
-
1. Add annotation to audit events for legacy and stale tokens including necessary
300
-
information to locate problematic client.
301
-
302
-
This functionality can be implemented entirely in the kube-apiserver and does not
303
-
require cooperation by the kubelet beyond the standard functionality implemented
304
-
as part of [Service Account Token Volumes](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/svcacct-token-volume-source.md).
346
+
### Graduation Criteria
305
347
306
-
We will direct cluster administrators to adopt bound service account tokens and
307
-
turn on the command line flag to enable extended token. Fix clients if monitoring or
308
-
audit report that stale or legacy token are in use. The operator can turn off
309
-
the command line flag after no stale token is being used.
348
+
#### Alpha->Beta
310
349
350
+
Estimated version: v1.20
311
351
352
+
All known migration frictions have been fixed:
312
353
313
-
### Graduation Criteria
354
+
- PodSecurityPolicies that allow secrets but not projected volumes will
355
+
prevent the use of token volumes.
356
+
- Fixed in https://github.com/kubernetes/kubernetes/pull/92006
357
+
- In-cluster clients that don’t reload service account tokens will start
358
+
failing an hour after deployment.
359
+
- Mitigation added in https://github.com/kubernetes/kubernetes/issues/68164
360
+
- Pods running as non root may not access the service account token.
361
+
- Fixed in https://github.com/kubernetes/kubernetes/pull/89193
362
+
363
+
An upgrade test is passing periodically:
364
+
365
+
1. Create pod A with feature disabled where pod A is working and a secret volume
366
+
is mounted.
367
+
2. Enable feature where pod A continue working
368
+
3. Create pod B and it is working and projected volumes are mounted.
314
369
315
370
#### Beta -> GA Graduation
316
371
317
-
- TBD
372
+
Estimated version: v1.21+
373
+
374
+
New `ServiceAccount` admission controller WAI in Beta for >= 1 minor without
375
+
significant issues.
376
+
377
+
## Production Readiness Review Questionnaire
378
+
379
+
### Feature Enablement and Rollback
380
+
381
+
-**How can this feature be enabled / disabled in a live cluster?**
0 commit comments