Skip to content

Commit 6a0f049

Browse files
committed
add ServiceAccountNodeAudienceRestriction feature gate in KAS and update beta criteria
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
1 parent 9b15829 commit 6a0f049

File tree

2 files changed

+21
-1
lines changed
  • keps/sig-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers

2 files changed

+21
-1
lines changed

keps/sig-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,8 @@ in back-to-back releases.
667667
- Unit tests for current credential provider logic unchanged when token attributes are not set
668668
- Unit tests for credential provider logic when token attributes are set
669669
- Initial e2e tests completed and enabled
670+
- `ServiceAccountNodeAudienceRestriction` feature gate implemented in KAS as a beta feature
671+
- Audience validation is enabled by default for service account tokens requested by the kubelet
670672

671673
#### Post Alpha
672674

@@ -675,6 +677,7 @@ in back-to-back releases.
675677
#### Beta
676678

677679
- The implementation works well with the Ensure secret pull images KEP and supports pod image pull policy set to any value.
680+
- `ServiceAccountNodeAudienceRestriction` feature gate is beta in KAS and enabled by default. This feature needs to be enabled be beta/enabled by default at least one release before this KEP goes to beta. This is critical to support downgrade use cases.
678681
- Add metrics
679682

680683
#### GA
@@ -722,7 +725,9 @@ Migration of the workloads to the new approach can be done per image or per regi
722725

723726
When things can fail:
724727

725-
1. If the kubelet is updated to enable the feature flag and the credential provider is configured with the `TokenAttributes` field set, but the KAS is not updated with `--allowed-kubelet-audiences` to allow the kubelet to generate service account tokens for the audience configured in the kubelet credential provider configuration, the image pull will fail. The old KAS will reject the token request from the kubelet.
728+
If the kubelet is updated to enable the feature flag and the credential provider is configured with the `TokenAttributes` field set, but the KAS is not updated with `--allowed-kubelet-audiences` to allow the kubelet to generate service account tokens for the audience configured in the kubelet credential provider configuration, the image pull will fail. The old KAS will reject the token request from the kubelet.
729+
730+
Today we don't do any validation on the audience value that the kubelet requested -> we only check that the SA is in use on some pod scheduled to the kubelet. As part of this KEP, we're introducing a new feature gate `ServiceAccountNodeAudienceRestriction` in KAS to validate the audience value that the kubelet requests is either part of any API spec or is in the list of audiences configured in KAS via the `--allowed-kubelet-audiences` CLI flag. This audience validation will be beta/enabled by default at least one release before this KEP goes to beta.
726731

727732
## Production Readiness Review Questionnaire
728733

@@ -778,6 +783,18 @@ FeatureSpec{
778783
}
779784
```
780785

786+
- [x] Feature gate (also fill in values in `kep.yaml`)
787+
- Feature gate name: `ServiceAccountNodeAudienceRestriction`
788+
- Components depending on the feature gate: kube-apiserver
789+
790+
```go
791+
FeatureSpec{
792+
Default: true,
793+
LockToDefault: false,
794+
PreRelease: featuregate.Beta,
795+
}
796+
```
797+
781798
###### Does enabling the feature change any default behavior?
782799

783800
<!--

keps/sig-auth/4412-projected-service-account-tokens-for-kubelet-image-credential-providers/kep.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ feature-gates:
2424
- name: ServiceAccountTokenForKubeletCredentialProviders
2525
components:
2626
- kubelet
27+
- name: ServiceAccountNodeAudienceRestriction
28+
components:
29+
- kube-apiserver
2730
disable-supported: true
2831
metrics:
2932
- "TODO"

0 commit comments

Comments
 (0)