Commit Graph

7400 Commits

Author SHA1 Message Date
chenk008 70fb342c48 Fix: StorageObjectCountTracker is nil, apf estimator got ObjectCountNotFoundErr
Kubernetes-commit: 4abc2b387b188d694e369e05c08effce9d23e7e7
2024-04-08 11:09:27 +08:00
Kubernetes Publisher 8bbbe76e96 Merge pull request #124174 from dims/update-x/net-for-CVE-2023-45288
Update x/net for CVE-2023-45288

Kubernetes-commit: d9c54f69d4bb7ae1bb655e1a2a50297d615025b5
2024-04-04 04:07:30 +00:00
Davanum Srinivas 2a3f6c8b16 Update x/net for CVE-2023-45288
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 99fac38d2864e6bc9bb7cd1743d658caa1360c0c
2024-04-03 16:37:18 -04:00
Flavian Missi 20894ccdfa resourcequota: use singleflight.Group to reduce apiserver load
relates to #22422 and #123806

Kubernetes-commit: e13ff5ece2691988503d183b495cc7c39e899647
2024-04-03 09:58:27 +02:00
Abhishek Kr Srivastav 1d434b32e1 Added locks when accessing dummyStorage to prevent data race
Removed redundant locks

Removed locks and used existing func

Kubernetes-commit: eb5d2ca9d8efd6dcbbea582920c700ae86db4132
2024-03-20 14:23:33 +05:30
Kubernetes Publisher 2a4a82c50e Merge pull request #123994 from serathius/undo-double-run-test-watch-semantics
Undo double run of the TestWatchSemantics test to avoid hitting timeout

Kubernetes-commit: fe9e4698a33565e9d334439f3a6e494366d8ee8d
2024-03-19 20:10:09 +00:00
Wojciech Tyczyński b1a1768456 Relax WatchSemanticsTest to make it faster
Kubernetes-commit: a26ee123952eeb86467e61ff2eb744c9e736a045
2024-03-19 20:23:56 +01:00
Marek Siarkowicz 7a3a726271 Undo double run of the TestWatchSemantics test to avoid hitting timeout
Kubernetes-commit: 225749eb68b3aa3485a1f2dc5d0cafb5dfe53421
2024-03-19 15:16:52 +01:00
Kubernetes Publisher e166c44e22 Merge pull request #123785 from seans3/streamtunnel-unit-tests
Adds unit tests to `PortForward` streamtunnel

Kubernetes-commit: 065a0f2d5116cc6f66eb8a0c6296e05b90838ec8
2024-03-18 16:10:00 +00:00
David Eads 8c4fa4e478 Remove k8s.io/apiserver ability to bind insecure ports
The project does not recommend using insecure ports.  Even
unauthenticated TLS is an improvement since it provides confidentiality.
If you relied upon this, please update to secure serving options.

Kubernetes-commit: de302c73e9558c192fde1cd7d6dcbea7eb76e950
2024-03-18 09:25:49 -04:00
Kubernetes Publisher ec72042fc5 Merge pull request #123935 from serathius/consistent-watch-from-etcd
Serve watch without resourceVersion from cache and introduce a WatchFromStorageWithoutResourceVersion feature gate to allow serving watch from storage

Kubernetes-commit: a1605fb3dd2d45474751ec3de30633ac1ec15c41
2024-03-18 05:51:14 -07:00
Ziqi Zhao 39347989da fix for comments to ignore the request without request info
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

Kubernetes-commit: 91af1145bf7b0e18a6b520a78875a1db6db29d96
2024-03-15 09:42:42 +08:00
Marek Siarkowicz 13a815b7c8 Serve watch without resourceVersion from cache and introduce a WatchFromStorageWithoutResourceVersion feature gate to allow serving watch from storage.
Kubernetes-commit: 0130072b053f85fb736c24d34552208cdd1bccfe
2024-03-14 15:20:29 +01:00
Kubernetes Publisher 7661bd2fe3 sync: update go.mod 2024-03-18 12:15:34 +00:00
Kubernetes Publisher 05c844e2a2 Merge pull request #123676 from serathius/rv0
Fix enabling consistent list from watch cache also works for resourceVersion=0

Kubernetes-commit: 89b1db79d75e367f567ea06c0528ef4b8f3fecb4
2024-03-15 21:39:11 +00:00
Kubernetes Publisher d5a8607203 Merge pull request #123926 from p0lyn0mial/upstream-deflake-test-get-list-non-recursive-with-consistent-list
apiserver/storage/cacher: deflake TestGetListNonRecursiveWithConsistentListFromCache

Kubernetes-commit: 89f03e3988a4e7fed90ffce22f355ff248520ad2
2024-03-14 21:14:25 +00:00
Lukasz Szaszkiewicz dcdc23d1b3 apiserver/storage/cacher: decrease running time of TestCacheWatcherDrainingNoBookmarkAfterResourceVersionReceived
before:
go test -v -race -count 1 -run ^TestCacheWatcherDrainingNoBookmarkAfterResourceVersionReceived$
ok  	k8s.io/apiserver/pkg/storage/cacher	3.792s

after:
go test -v -race -count 1 -run ^TestCacheWatcherDrainingNoBookmarkAfterResourceVersionReceived$
ok  	k8s.io/apiserver/pkg/storage/cacher	1.783s

Kubernetes-commit: d21b86d53a3c4c42e41f8374e537c721251a00d2
2024-03-14 10:44:51 +01:00
Kubernetes Publisher f6a2b2b2cb Merge pull request #123925 from p0lyn0mial/upstream-cacher-decrease-watch-not-hanging-on-startup-failure
apiserver/storage/cacher: decrease running time of TestWatchNotHangingOnStartupFailure

Kubernetes-commit: d1a2a134c532109540025c990697a6900c2e62fc
2024-03-14 02:06:09 -07:00
Lukasz Szaszkiewicz b8c7d7868f apiserver/storage/cacher: deflake TestGetListNonRecursiveWithConsistentListFromCache
Kubernetes-commit: c44cc9a575f3bf1248b2fdc8e3a7ba61ab844618
2024-03-14 09:08:29 +01:00
Lukasz Szaszkiewicz a2c5722d64 apiserver/storage/cacher: decrease running time of TestWatchNotHangingOnStartupFailure
before:
go test -v -race -count 1 -run ^TestWatchNotHangingOnStartupFailure$
ok  	k8s.io/apiserver/pkg/storage/cacher	6.775s

after:
go test -v -race -count 1 -run ^TestWatchNotHangingOnStartupFailure$
ok  	k8s.io/apiserver/pkg/storage/cacher	2.781s

Kubernetes-commit: f5d945eb43c7bf8036a4bad8c22448e1146a7498
2024-03-14 08:59:47 +01:00
Kubernetes Publisher 7dbc368d22 Merge pull request #123891 from p0lyn0mial/upstream-cacher-decrease-running-time-of-test-wait-unti-fresh
apiserver/storage/cacher: decrease of running time of TestWaitUntilWatchCacheFreshAndForceAllEvents

Kubernetes-commit: 3a75a8c8d9e6a1ebd98d8572132e675d4980f184
2024-03-13 16:08:38 +00:00
Kubernetes Publisher fb5c182ce6 Merge pull request #123887 from p0lyn0mial/upstream-cacher-decrease-running-time-of-tests
apiserver/storage/cacher: decrease the running time of tests in the cacher package.

Kubernetes-commit: 308d664e3fdb73c4436e812d2f1395dcf9e0e2e9
2024-03-13 16:08:37 +00:00
Kubernetes Publisher 6a24b53962 Merge pull request #123897 from p0lyn0mial/upstream-cacher-decrease-running-time-of-empty-watch-event-cache
apiserver/storage/cacher: decrease of running time of TestEmptyWatchEventCache

Kubernetes-commit: 881cc5bc968276b05eba9be9a162873c29c2fda2
2024-03-13 12:20:44 +00:00
Ziqi Zhao 54b3a0e7f5 add http method to span name
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

Kubernetes-commit: 1aeb0ba314016f2a2cd94b0450ba097c2b165e5d
2024-03-13 13:25:36 +08:00
Kubernetes Publisher 342a6b899d Merge pull request #123674 from serathius/non-recursive
Fix non-recursive list returning "resource version too high" error when consistent list from cache is enabled

Kubernetes-commit: 3409f0594c94185010217f3e5156c1de9f08b405
2024-03-12 08:34:06 -07:00
Ziqi Zhao 29913c19e4 change the integration test
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

Kubernetes-commit: 02154293c76a0ea54293c82236c9025b96ea0125
2024-03-12 22:49:38 +08:00
Lukasz Szaszkiewicz 80f9ab2a6a apiserver/storage/cacher: decrease of running time of TestEmptyWatchEventCache
updates the test to wait 300 ms instead of 3s
the watch was established otherwise
we would be blocking on a call to cache.Watch(...)
in addition to that, the tests are serial in nature,
meaning that there is no other actor
that could add items to the database,
which could result in receiving new items.

Before:
go test -race  -run TestEmptyWatchEventCache
ok  	k8s.io/apiserver/pkg/storage/cacher	8.450s

After:
go test -race  -run TestEmptyWatchEventCache
ok  	k8s.io/apiserver/pkg/storage/cacher	2.635s

Kubernetes-commit: 926122c035a4f47a880db24d1a0be7ec129dd44d
2024-03-12 13:34:04 +01:00
Lukasz Szaszkiewicz c14671349b apiserver/storage/cacher: decrease of running time of TestWaitUntilWatchCacheFreshAndForceAllEvents
The individual cases can be safely run in parallel.

Before
go test -race  -run TestWaitUntilWatchCacheFreshAndForceAllEvents
ok  	k8s.io/apiserver/pkg/storage/cacher	10.787s

After:
go test -race  -run TestWaitUntilWatchCacheFreshAndForceAllEvents
ok  	k8s.io/apiserver/pkg/storage/cacher	4.857s

Kubernetes-commit: 3ecbb4dee00a5dd1e43e24a5952c2a90ef507ef1
2024-03-12 10:50:44 +01:00
Lukasz Szaszkiewicz 361687d2ad apiserver/storage/cacher: decrease the running time of tests in the cacher package.
It turns out that kube has a custom timeout for tests of 3 minutes.
The tests in the cacher package are utilizing nearly the
entire time and are being terminated, resulting in failing jobs.

Before the change, the TestWatchSemantics took ~43s to run. With this simple change, it now takes ~18s.

When we created the tests, we didn't measure the running time and assumed that waiting 1 second on a watch channel
to make sure no more events are received was sufficient.
This PR decreases the waiting time to 300 milliseconds.
Modern computers can perform many tasks within that time.
In addition to that, the tests are serial in nature, meaning that there is no other
actor that could add items to the database, which could result in receiving new items.

After the change the total running time decreased by 17%.
Before the tests needed ~176s after they need ~146s.
The changes also improved TestWatchSemanticInitialEventsExtended.

Kubernetes-commit: 5a74c8e2202044b664efce4be5d86d700e74506f
2024-03-12 09:15:55 +01:00
Lukasz Szaszkiewicz d4f6eff589 apiserver/pkg/storage/utils: remove unused EverythingFunc
since we don't provide compatibility guarantees for the storage
package it is okay to simply remove unused function.

Kubernetes-commit: a40f25f8e6516d1a59169cf88db8b3850a8c48c7
2024-03-11 11:47:02 +01:00
Lukasz Szaszkiewicz 9bfd27dc1c apiserver/storage: use metav1.InitialEventsAnnotationKey const
Kubernetes-commit: ed2b92c3dfb7d56155021824f0d9a61609dac051
2024-03-11 11:40:21 +01:00
Sean Sullivan 5e1f7568bd adds portforward streamtunnel unit tests
Kubernetes-commit: ffafb2b9ca94c14c07fb6c1fc75fccd3aba26f1f
2024-03-06 16:37:17 -08:00
Marek Siarkowicz 67b6245fc3 Fix enabling consistent list from watch cache also works for resourceVersion=0
Kubernetes-commit: 0b8e79580eb3a63ca7707626b4894adfb9125586
2024-03-04 19:35:34 +01:00
Marek Siarkowicz 483da2032d Fix non-recursive list when consistent list from cache is enabled
Kubernetes-commit: a527cab9fce0b0234db8b4e1e95a0fc20e135df1
2024-03-04 17:59:04 +01:00
Kubernetes Publisher 07ca000ce9 Merge pull request #123732 from serathius/parallel-featureflags
Fix SetFeatureGateDuringTest handling of Parallel tests

Kubernetes-commit: e062f925aec9137ca3f06704c6adb2883812e657
2024-03-12 00:14:01 +00:00
Kubernetes Publisher 469611c7d7 Merge pull request #123719 from enj/enj/f/authn_config_beta
Mark StructuredAuthenticationConfiguration feature gate as beta

Kubernetes-commit: 8f80e0146726c42edefdfaeda6123872a5ec0981
2024-03-10 04:10:37 +00:00
Kubernetes Publisher a4d271c759 Merge pull request #123793 from aramase/aramase/f/authn_config_reload_metrics
Add metrics for authentication config reload

Kubernetes-commit: 09093f270aa811c2c49ea45868989ad5b6eb8a53
2024-03-09 15:58:55 -08:00
Anish Ramasekar ee481149d7 Add metrics for authentication config reload
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 62ac88b9ea5dace6a61b784f4654fcf379b958e2
2024-03-09 13:29:56 -08:00
Kubernetes Publisher 81df735550 Merge pull request #123525 from enj/enj/f/authn_config_reload
Add dynamic reload support for authentication configuration

Kubernetes-commit: 77ecfb7800a5ce6f139818828c8eb49af9c44077
2024-03-10 00:12:37 +00:00
Marek Siarkowicz 3a83dc12eb Fix SetFeatureGateDuringTest handling of Parallel tests
Stop using defer as parallel subtest will might result in main test
finishing before subtest.

Fatal when same flag is set twice.

Kubernetes-commit: 9fcf279e2b91e7549190a433373f256fb5aebe85
2024-03-05 21:56:40 +01:00
Monis Khan aa18faf137 Mark StructuredAuthenticationConfiguration feature gate as beta
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: bc7aa13bf793148b0c6b3b51fd9a8e17bb412712
2024-03-05 10:39:44 -05:00
Patrick Ohly 561da9109f cel: fix conversion of quantity to quantity
The code in ConvertToType checked for conversion into typeValue (=
"kubernetes.URL") instead of conversion into quantityTypeValue (=
"kubernetes.Quantity") and thus most likely failed with an incorrect "type
conversion error".

Kubernetes-commit: 02b4e99c9f0afa4ef9fa0283670c1515e40a5278
2024-03-04 12:23:54 +01:00
Ziqi Zhao 68eb5caed4 rename apiserver trace span to http server guidelines
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

Kubernetes-commit: 84b9fbbdefa3f0bcfb1c4787093aa7840079b7ce
2024-02-29 19:03:43 +08:00
cyclinder eca9e91401 Fix data race in apiserver mux handler
Signed-off-by: cyclinder <kuocyclinder@gmail.com>

Kubernetes-commit: 6a194182a141665cfcb9b03815d77cd1e468d34e
2024-02-20 14:34:22 +08:00
Siyuan Zhang 22612a3528 apiserver: Add API emulation versioning.
Co-authored-by: Siyuan Zhang <sizhang@google.com>
Co-authored-by: Joe Betz <jpbetz@google.com>
Co-authored-by: Alex Zielenski <zielenski@google.com>

Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 403301bfdf2c7312591077827abd2e72f445a53a
2024-01-19 16:07:00 -08:00
Monis Khan 2c1ad21e66 Add dynamic reload support for authentication configuration
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: b4935d910dcf256288694391ef675acfbdb8e7a3
2024-01-10 12:36:55 -05:00
Kubernetes Publisher 86ddcb4842 Merge pull request #123737 from enj/enj/i/cel_email_verified
Require email_verified to be used when email is set as username via CEL

Kubernetes-commit: 9a160fa7808755fddd5fe8573040bef4d2ba7a0c
2024-03-08 20:12:31 +00:00
Monis Khan 5b4b237d07 Require email_verified to be used when email is set as username via CEL
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 121607e80963370c1838f9f620c2b8552041abfc
2024-03-05 17:20:18 -05:00
Kubernetes Publisher 8763b7fa93 Merge pull request #123431 from aramase/aramase/f/kep_3331_multiple_jwt_authenticator
Support multiple JWT authenticators with structured authn config

Kubernetes-commit: c726b2b3a3519309afbac68e0358c99977d1c805
2024-03-07 05:34:55 +00:00
Kubernetes Publisher 5855c335a1 Merge pull request #123696 from aramase/aramase/f/kep_3331_v1beta1_api
Duplicate v1alpha1 AuthenticationConfiguration to v1beta1

Kubernetes-commit: 05cb0a55c88e0cdcfe2fb184328ad9be53e94d5c
2024-03-07 05:34:54 +00:00