@@ -96,6 +96,8 @@ tags, and then generate with `hack/update-toc.sh`.
96
96
- [ e2e tests] ( #e2e-tests )
97
97
- [ Graduation Criteria] ( #graduation-criteria )
98
98
- [ Alpha] ( #alpha )
99
+ - [ Beta] ( #beta )
100
+ - [ GA] ( #ga )
99
101
- [ Upgrade / Downgrade Strategy] ( #upgrade--downgrade-strategy )
100
102
- [ Version Skew Strategy] ( #version-skew-strategy )
101
103
- [ Production Readiness Review Questionnaire] ( #production-readiness-review-questionnaire )
@@ -107,9 +109,9 @@ tags, and then generate with `hack/update-toc.sh`.
107
109
- [ Troubleshooting] ( #troubleshooting )
108
110
- [ Implementation History] ( #implementation-history )
109
111
- [ Drawbacks] ( #drawbacks )
110
- - [ Open Questions for BETA] ( #open-questions-for-beta )
111
112
- [ Alternatives] ( #alternatives )
112
113
- [ Infrastructure Needed (Optional)] ( #infrastructure-needed-optional )
114
+ - [ Possible Future Improvements] ( #possible-future-improvements )
113
115
<!-- /toc -->
114
116
115
117
## Release Signoff Checklist
@@ -131,8 +133,8 @@ checklist items _must_ be updated for the enhancement to be released.
131
133
Items marked with (R) are required * prior to targeting to a milestone / release* .
132
134
133
135
- [x] (R) Enhancement issue in release milestone, which links to KEP dir in [ kubernetes/enhancements] (not the initial KEP PR)
134
- - [ ] (R) KEP approvers have approved the KEP status as ` implementable `
135
- - [ ] (R) Design details are appropriately documented
136
+ - [x ] (R) KEP approvers have approved the KEP status as ` implementable `
137
+ - [x ] (R) Design details are appropriately documented
136
138
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
137
139
- [ ] e2e Tests for all Beta API Operations (endpoints)
138
140
- [ ] (R) Ensure GA e2e tests meet requirements for [ Conformance Tests] ( https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md )
@@ -477,6 +479,11 @@ We will add unit tests for the following scenarios:
477
479
2 . Making sure that the flag and the config are mutually exclusive.
478
480
3 . Behavior of the path restricted anonymous authenticator.
479
481
482
+ Unit tests were added to the following:
483
+
484
+ * pkg/kubeapiserver/options/authentication_test.go
485
+ * staging/src/k8s.io/apiserver/pkg/authentication/request/anonymous/anonymous_test.go
486
+
480
487
##### Integration tests
481
488
482
489
<!--
@@ -502,6 +509,10 @@ based authentication scenarios:
502
509
1 . anonymous auth enabled and restricted to certain paths in the auth-config
503
510
file.
504
511
512
+ The following integration tests were added:
513
+
514
+ test/integration/apiserver/anonymous/anonymous_test.go
515
+
505
516
##### e2e tests
506
517
507
518
<!--
@@ -587,6 +598,14 @@ in back-to-back releases.
587
598
- Feature implemented behind a feature flag
588
599
- Full unit and integration test coverage
589
600
601
+ #### Beta
602
+
603
+ - Feature gate set to true by default
604
+
605
+ #### GA
606
+
607
+ - Examples of real-world usage
608
+
590
609
### Upgrade / Downgrade Strategy
591
610
592
611
<!--
@@ -601,6 +620,10 @@ enhancement:
601
620
cluster required to make on upgrade, in order to make use of the enhancement?
602
621
-->
603
622
623
+ When the feature-gate is enabled none of the defaults or current settings
624
+ regarding anonymous auth are changed. The feature-gate enables the ability for
625
+ users to set the ` anonymous ` field using the ` AuthenticationConfiguration ` file.
626
+
604
627
### Version Skew Strategy
605
628
606
629
<!--
@@ -616,6 +639,11 @@ enhancement:
616
639
CRI or CNI may require updating that component before the kubelet.
617
640
-->
618
641
642
+ This feature only impacts kube-apiserver and does not introduce any changes that
643
+ would be impacted by version skews. All changes are local to kube-apiserver and
644
+ are controlled by the ` AuthenticationConfiguration ` file passed to
645
+ kube-apiserver as a parameter.
646
+
619
647
## Production Readiness Review Questionnaire
620
648
621
649
<!--
@@ -747,13 +775,25 @@ rollout. Similarly, consider large clusters and how enablement/disablement
747
775
will rollout across nodes.
748
776
-->
749
777
778
+ Enabling the feature flag alone does not change kube-apiserver defaults. However
779
+ if different API servers have different AuthenticationConfiguration for
780
+ Anonymous then some requests that would be denied by one API server could be
781
+ allowed by another.
782
+
750
783
###### What specific metrics should inform a rollback?
751
784
752
785
<!--
753
786
What signals should users be paying attention to when the feature is young
754
787
that might indicate a serious problem?
755
788
-->
756
789
790
+ kube-apiserver fails to start when AuthenticationConfiguration file has
791
+ ` anonymous ` field set.
792
+
793
+ If audit logs indicate that endpoints other than the ones configured in the
794
+ AuthenticationConfiguration file using the ` anonymous.conditions ` field are
795
+ reachable by anonymous users.
796
+
757
797
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
758
798
759
799
<!--
@@ -762,6 +802,8 @@ Longer term, we may want to require automated upgrade/rollback tests, but we
762
802
are missing a bunch of machinery and tooling and can't do that now.
763
803
-->
764
804
805
+ N/A
806
+
765
807
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
766
808
767
809
<!--
@@ -785,6 +827,8 @@ checking if there are objects with field X set) may be a last resort. Avoid
785
827
logs or events for this purpose.
786
828
-->
787
829
830
+ N/A
831
+
788
832
###### How can someone using this feature know that it is working for their instance?
789
833
790
834
<!--
@@ -796,13 +840,18 @@ and operation of this feature.
796
840
Recall that end users cannot usually observe component logs or access metrics.
797
841
-->
798
842
799
- - [ ] Events
800
- - Event Reason:
801
- - [ ] API .status
802
- - Condition name:
803
- - Other field:
804
- - [ ] Other (treat as last resort)
805
- - Details:
843
+ If a user sets AuthenticationConfig file and sets the ` anonymous.enabled ` to
844
+ ` true ` and sets ` anonymous.conditions ` to allow only certain endpoints. Then
845
+ they can check if the feature is working by:
846
+
847
+ * making an anonymous request to an endpoint that is not in the list of
848
+ endpoints they allowed. Such a request should fail with http status code 401.
849
+
850
+ * making an anoymous request to an endpoint that is in the list of endpoints
851
+ they allowed. Such a request should either succeed with http status code 200 (if
852
+ authz is configured to allow acees to that endpoint) or
853
+ fail with http statis code 403 (if authz is not configured to allow access to
854
+ that endpoint)
806
855
807
856
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
808
857
@@ -821,6 +870,9 @@ These goals will help you determine what you need to measure (SLIs) in the next
821
870
question.
822
871
-->
823
872
873
+ SLOs for actual requests should not change in any way compared to the flag-based
874
+ Anonymous configuration.
875
+
824
876
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
825
877
826
878
<!--
@@ -834,13 +886,17 @@ Pick one more of these and delete the rest.
834
886
- [ ] Other (treat as last resort)
835
887
- Details:
836
888
889
+ N/A
890
+
837
891
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
838
892
839
893
<!--
840
894
Describe the metrics themselves and the reasons why they weren't added (e.g., cost,
841
895
implementation difficulties, etc.).
842
896
-->
843
897
898
+ N/A
899
+
844
900
### Dependencies
845
901
846
902
<!--
@@ -864,6 +920,8 @@ and creating new ones, as well as about cluster-level services (e.g. DNS):
864
920
- Impact of its degraded performance or high-error rates on the feature:
865
921
-->
866
922
923
+ No.
924
+
867
925
### Scalability
868
926
869
927
<!--
@@ -891,6 +949,8 @@ Focusing mostly on:
891
949
heartbeats, leader election, etc.)
892
950
-->
893
951
952
+ No.
953
+
894
954
###### Will enabling / using this feature result in introducing new API types?
895
955
896
956
<!--
@@ -900,6 +960,8 @@ Describe them, providing:
900
960
- Supported number of objects per namespace (for namespace-scoped objects)
901
961
-->
902
962
963
+ No.
964
+
903
965
###### Will enabling / using this feature result in any new calls to the cloud provider?
904
966
905
967
<!--
@@ -908,6 +970,8 @@ Describe them, providing:
908
970
- Estimated increase:
909
971
-->
910
972
973
+ No.
974
+
911
975
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
912
976
913
977
<!--
@@ -917,6 +981,8 @@ Describe them, providing:
917
981
- Estimated amount of new objects: (e.g., new Object X for every existing Pod)
918
982
-->
919
983
984
+ No.
985
+
920
986
###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
921
987
922
988
<!--
@@ -928,6 +994,8 @@ Think about adding additional work or introducing new steps in between
928
994
[existing SLIs/SLOs]: https://git.k8s.io/community/sig-scalability/slos/slos.md#kubernetes-slisslos
929
995
-->
930
996
997
+ No.
998
+
931
999
###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
932
1000
933
1001
<!--
@@ -940,6 +1008,8 @@ This through this both in small and large cases, again with respect to the
940
1008
[supported limits]: https://git.k8s.io/community//sig-scalability/configs-and-limits/thresholds.md
941
1009
-->
942
1010
1011
+ No.
1012
+
943
1013
###### Can enabling / using this feature result in resource exhaustion of some node resources (PIDs, sockets, inodes, etc.)?
944
1014
945
1015
<!--
@@ -952,6 +1022,8 @@ Are there any tests that were run/should be run to understand performance charac
952
1022
and validate the declared limits?
953
1023
-->
954
1024
1025
+ No.
1026
+
955
1027
### Troubleshooting
956
1028
957
1029
<!--
@@ -967,6 +1039,9 @@ details). For now, we leave it here.
967
1039
968
1040
###### How does this feature react if the API server and/or etcd is unavailable?
969
1041
1042
+ This feature is about for API Server handles Authentication for anonymous
1043
+ requests. If API server is unavailable then this feature is also unavailable.
1044
+
970
1045
###### What are other known failure modes?
971
1046
972
1047
<!--
@@ -984,32 +1059,29 @@ For each of them, fill in the following information by copying the below templat
984
1059
985
1060
###### What steps should be taken if SLOs are not being met to determine the problem?
986
1061
1062
+ After observing an issue (e.g. uptick in denied authentication requests),
1063
+ kube-apiserver logs from the authenticator may be used to debug.
1064
+
1065
+ Additionally, manually attempting to exercise the affected codepaths would
1066
+ surface information that'd aid debugging. For example, attempting to issue an
1067
+ anonymous request to an endpoint that is allowed or disallowed based on the
1068
+ contraints set in the anonymous config in the AuthenticationConfiguration file.
1069
+
987
1070
## Implementation History
988
1071
989
- <!--
990
- Major milestones in the lifecycle of a KEP should be tracked in this section.
991
- Major milestones might include:
992
- - the `Summary` and `Motivation` sections being merged, signaling SIG acceptance
993
- - the `Proposal` section being merged, signaling agreement on a proposed design
994
- - the date implementation started
995
- - the first Kubernetes release where an initial version of the KEP was available
996
- - the version of Kubernetes where the KEP graduated to general availability
997
- - when the KEP was retired or superseded
998
- -->
1072
+ - [x] 2024-05-13 - KEP introduced
1073
+ - [x] 2024-06-07 - KEP Accepted as implementable
1074
+ - [x] 2024-06-27 - Alpha implementation merged https://github.com/kubernetes/kubernetes/pull/124917
1075
+ - [x] 2024-07-15 - Integration tests merged https://github.com/kubernetes/kubernetes/pull/125967
1076
+ - [x] 2024-08-13 - First release (1.31) when feature available
1077
+ - [x] 2024-08-16 - Targeting beta in 1.32
999
1078
1000
1079
## Drawbacks
1001
1080
1002
1081
<!--
1003
1082
Why should this KEP _not_ be implemented?
1004
1083
-->
1005
1084
1006
- ## Open Questions for BETA
1007
-
1008
- The following should be resolved before this goes to ` beta ` :
1009
-
1010
- - Should we apply any restrictions here to anonymous ` userInfo ` that comes back
1011
- after all authenticators and impersonation have run
1012
-
1013
1085
## Alternatives
1014
1086
1015
1087
<!--
@@ -1038,3 +1110,16 @@ Use this section if you need things from the project/SIG. Examples include a
1038
1110
new subproject, repos requested, or GitHub details. Listing these here allows a
1039
1111
SIG to get the process for these resources started right away.
1040
1112
-->
1113
+
1114
+ ## Possible Future Improvements
1115
+
1116
+ We decided not to apply any restrictions here to anonymous ` userInfo ` that comes
1117
+ back after all authenticators and impersonation have run because we think that
1118
+ the scope of this KEP is to provide cluster admins with a way to restrict actual
1119
+ anonymous requests. A request that was considered authenticated and as permitted
1120
+ to impersonate ` system:anonymous ` is not actually anonymous.
1121
+
1122
+ If we want to allow cluster admins the ability to add such restrictions we
1123
+ think its better to give them the capability to configure webhook authenticators
1124
+ and add ` userValidationRules ` capabilities. But doing so would expand the scope
1125
+ of this KEP and it should likely be a separate effort.
0 commit comments