Commit Graph

219 Commits

Author SHA1 Message Date
Siyuan Zhang 9ca332f5c7 bug fix: fix version order in emulation forward compatibility.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: b1a9cc347311012bade7230b55ab95229a1e22c9
2025-04-07 18:38:43 -07:00
David Ashpole 6898b8387d restrict trace context propagation to system:master and system:monitoring
Kubernetes-commit: 3842d74d97d803372eb8e2d6cfc3d3d56a4c7a0d
2024-09-01 18:03:26 +00:00
Siyuan Zhang 942f114031 Add option to explicitly enable future gv or gvr in runtime-config.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 3d2d8db83509eadcad0529fda1f8ef81e1682ca5
2025-02-07 16:43:58 -08:00
Siyuan Zhang 5a72bc815b Add emulation forward compatibility into api enablement and RemoveDeletedKinds.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 819cb8fe22fe37bf691f460bc32d0f03f53cce09
2025-02-04 10:11:56 -08:00
yongruilin b6717882da feat: extend version information with more detailed version fields
- Add new version fields to version.Info struct:
  * EmulationMajor and EmulationMinor to track emulated version
  * MinCompatibilityMajor and MinCompatibilityMinor for compatibility tracking
- Update related code to populate and use these new fields
- Improve version information documentation and OpenAPI generation
- Modify version routes and documentation to reflect new version information structure

Kubernetes-commit: a3094ccbe6f9f134da29aedf4d6d87a9a97bf463
2025-02-06 16:11:12 -08:00
Paco Xu bd0e774416 remove AggregatedDiscoveryEndpoint that was GAed in v1.30
Kubernetes-commit: 8195f82fe82e7bcf36ba50ddc8b78c00fa8df2bc
2025-03-03 11:01:02 +08:00
Siyuan Zhang 9bb4aa730a Refactor compatibility version code
Replace DefaultComponentGlobalsRegistry with new instance of componentGlobalsRegistry in test api server.

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

move kube effective version validation out of component base.

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

move DefaultComponentGlobalsRegistry out of component base.

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

move ComponentGlobalsRegistry out of featuregate pkg.

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

remove usage of DefaultComponentGlobalsRegistry in test files.

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

change non-test DefaultKubeEffectiveVersion to use DefaultBuildEffectiveVersion.

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

Restore useDefaultBuildBinaryVersion in effective version.

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

rename DefaultKubeEffectiveVersion to DefaultKubeEffectiveVersionForTest.

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

pass options.ComponentGlobalsRegistry into config for controller manager and scheduler.

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

Pass apiserver effective version to DefaultResourceEncodingConfig.

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

change statusz registry to take effective version from the components.

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

Address review comments

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

update vendor

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

Kubernetes-commit: 8fc3a33454ba38783bb63de41ecf5343e2ced67c
2024-12-20 07:03:03 +00:00
Richa Banker 10dc325a69 Add flagz implementation and enablement in apiserver
Kubernetes-commit: da8dc433e9b5fb29f3cc91f79ed15f366addefd1
2024-03-28 19:41:00 -07:00
Richa Banker d520e75de3 add statusz implementation and enablement in apiserver
Kubernetes-commit: 8bf6eecedffaa85c6d06ef2c8ad412ded77cb309
2024-06-18 20:30:43 -07:00
Ben Luddy ca9c3d965e Add CBOR feature gates.
For alpha, there is one apiserver feature gate and two client-go feature gates controlling
CBOR. They were initially wired to separate test-only feature gate instances in order to prevent
them from being configurable at runtime via command-line flags or environment variables (for
client-go feature gates outside of Kubernetes components). All of the integration tests required by
the KEP as alpha criteria have been implemented. This adds the feature gates to the usual feature
gate instances and removes the temporary code to support separate test-only feature gate instances.

Kubernetes-commit: 072dfcb416fd4e1ddab0a89ac4faf519e268bc96
2024-11-04 10:40:19 -05:00
Kubernetes Prow Robot 4bece4d457 Merge pull request #128196 from richabanker/move-version
Move k8s.io/apiserver/pkg/util/version to component-base

Kubernetes-commit: 119f114f012ae6d1cd851bdb2c3f849307e83258
2024-10-29 18:49:35 +00:00
Ben Luddy f27bb5491e Wire test-only feature gate for CBOR serving.
To mitigate the risk of introducing a new protocol, integration tests for CBOR will be written using
a test-only feature gate instance that is not wired to runtime options. On alpha graduation, the
test-only feature gate instance will be replaced by a normal feature gate in the existing apiserver
feature gate instance.

Kubernetes-commit: 0cad1a89b6721308746cc1a12f12de31a259a0d3
2024-10-23 16:36:25 -04:00
Mangirdas Judeikis 3e52ced45d fully remove StopCh
Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt>

Kubernetes-commit: fd76176811654c409cd6799de4a174bcb051a90d
2024-09-13 12:08:57 +03:00
Lukasz Szaszkiewicz 3257d91a56 server/config: assing system:apiserver user to system:authenticated group
Kubernetes-commit: dfeb560d4a2294c7a9a6233e2acb6b27039ed37a
2024-10-07 17:39:10 +02:00
Eric Lin 5d14d72b5c Fix httplog not logging watch duration in separate goroutines
Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 06c7058115e623126884d05c54a30db511a9cb71
2024-06-21 10:03:31 +00:00
Wojciech Tyczyński a643e14347 Implement resilient watchcache initialization post-start-hook
Kubernetes-commit: a5772bd42593f6492f5169eef49bc9884f95abba
2024-06-13 11:02:18 +02:00
Siyuan Zhang b26fefe178 add DefaultComponentGlobalsRegistry flags in ServerRunOptions
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 379676c4bef48e5d2add28851302b55b41fcabcf
2024-06-10 17:50:22 +00:00
Siyuan Zhang 00857ca9ec Add version mapping in ComponentGlobalsRegistry.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 4352c4ad2762ce49ce30e62381f8ceb24723fbcc
2024-05-31 20:29:48 -07: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
Stephen Kitt 942c16fb6a Use canonical json-patch v4 import
The canonical import for json-patch v4 is
gopkg.in/evanphx/json-patch.v4 (see
https://github.com/evanphx/json-patch/blob/master/README.md#get-it for
reference).

Using the v4-specific path should also reduce the risk of unwanted v5
upgrade attempts, because they won't be offered as automated upgrades
by dependency upgrade management tools, and they won't happen through
indirect dependencies (see
https://github.com/kubernetes/kubernetes/pull/120327 for context).

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 5300466a5c8988b479a151ceb77f49dd00065c83
2024-02-16 13:57:24 +01:00
Eric Lin 000601bdbe Add handler to run watch serving in separate goroutine
This handler allows running execution prior to actual serving in a separate
goroutine when serving requests. Doing so benefits cases in serving long running
requests because it allows freeing memory used by the separate goroutine
and keeps the serving routines slim.

Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 7b2698a5e5c61b303481c2006847409fc8704746
2023-10-10 08:53:26 +00:00
Jordan Liggitt c2310e1279 Implement authz config file reloading
Kubernetes-commit: 5dc92ada068cb80a2866cfaa1f9aa760d2524680
2023-11-08 08:49:58 -06:00
Abu Kashem eff38efc48 apiserver: warning should not panic when request times out
Kubernetes-commit: 7cab0ad2d2b2688575c1d6c8b5ecee2bfa5a39ff
2023-01-26 08:56:10 -05:00
Siyuan Zhang 06103a07ae k8s.io/apiserver: refactor GenericAPIServer healthz code.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Kubernetes-commit: 12c9bfc21d6c9799c2cd6bf0e9dcca6f1534812d
2023-11-15 12:36:04 -08:00
Abu Kashem b3499eec62 apiserver: set APF featuregate to ga
Kubernetes-commit: c7fcef187562e1b3ffdaa2e2109c65d800b8f5d5
2023-10-31 08:35:52 -04:00
Ben Luddy 91d0f39545 Restrict supported media types for new apiservers.
This is to prevent the enablement of new data formats (CBOR) in the early stages of phased
implementation.

Kubernetes-commit: ced56a6adabdd86f99455b100b1c0c7a2b4f3c55
2023-10-17 14:06:46 -04:00
Jefftree 2e1024671d Fix v3 spec
Kubernetes-commit: b30c6bdff817cec28b3d88b3bb3e12f1e86488d0
2023-10-04 12:55:49 -04:00
Abu Kashem a2e63604f2 apf: use context for queue wait
Kubernetes-commit: f39213a7e44f21a8cedcdf38d3c2531456a526d6
2023-08-28 17:01:16 -04:00
Han Kang bd7db816d7 promote component SLIs to GA; remove feature gates for component slis
Kubernetes-commit: e6435e98eda93fbf96e94110af6ca5a10ad1e926
2023-09-11 08:52:50 -07:00
Richa Banker 8a38d429d8 Add impl for uvip
Kubernetes-commit: cd5f3d9f9d5ae3153206178e6114d573dc24ad73
2023-03-29 17:20:25 -07:00
Andrew Sy Kim f00505bddc priority & fairness: support dynamically configuring work estimator max seats
Max seats from prioriy & fairness work estimator is now min(0.15 x
nominalCL, nominalCL/handSize)

'Max seats' calculated by work estimator is currently hard coded to 10.
When using lower values for --max-requests-inflight, a single
LIST request taking up 10 seats could end up using all if not most seats in
the priority level. This change updates the default work estimator
config such that 'max seats' is at most 10% of the
maximum concurrency limit for a priority level, with an upper limit of 10.
This ensures seats taken from LIST request is proportional to the total
available seats.

Signed-off-by: Andrew Sy Kim <andrewsy@google.com>

Kubernetes-commit: d3ef2d4fe95c3ef7b1c606ad01be1183659da391
2023-04-26 11:13:14 +00:00
Dr. Stefan Schimanski 8f40ac3bd1 k8s.io/apiserver: remove skewed completion from EtcdOptions
Kubernetes-commit: e9e4acb1dde69243a6e675e58833ae7936df9ce5
2023-06-02 20:25:31 +02:00
Monis Khan 9c69aab43c Clear front proxy headers after authentication is complete
This matches the logic we have for the Authorization header as well
as the impersonation headers.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: e9866d2794675aa8dc82ba2637ae45f9f3a27dff
2023-03-20 13:11:38 -04:00
Jefftree 31f3fb382d Add metrics for aggregated discovery
Kubernetes-commit: 387d97605ee81cb8beacad990255439ee464b5f3
2023-02-08 21:11:15 +00:00
Abu Kashem 62a4b39be7 apiserver: make watch termination during shutdown configurable
Kubernetes-commit: 791fcd6fb429002349b3f697b1bcc68ff7146dde
2023-02-10 11:43:06 -05:00
Abu Kashem 61a789ab70 apiserver: terminate watch with a rate limiter during shutdown
Kubernetes-commit: 6385b86a9b124eb03848af9a3029e8bc9058d72f
2023-01-13 18:04:13 -05:00
Andrew Sy Kim 885060394e apiserver: use the identity value in the apiserver identity hash
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>

Kubernetes-commit: a7de3e15a50bafdd65adf55f5fdc14567e3fa3e2
2023-01-13 15:49:30 -05:00
Andrew Sy Kim 2d94c4699b apiserver: update lease identity prefix from kube-apiserver- to apiserver-
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>

Kubernetes-commit: fb066a883de2b56e533eb622677056bd723748ce
2022-12-19 13:33:24 -05:00
Abu Kashem 9e60654b8a apiserver: refactor WithWaitGroup handler
Kubernetes-commit: 9093f126b87cb686784bb27b08be9eb12b4d5453
2023-01-10 15:55:19 -05:00
Antoine Pelisse 76a233ebec Allow profiling information to be served on Unix-Domain Socket
Serving profiling information can leak information or expose the
apiserver to possible DoS attacks. Serving on a UDS is more secure
though slightly less convenient. One can't use `go tool pprof` directly
against the socket since it's not supported, but can either run a proxy
to copy from the socket over to http, or use `curl --unix-socket` to
download the profile and then use `go tool pprof`.

Kubernetes-commit: 667599b0ddfad8ba760d3bbfe006aae0d8f7dec6
2022-11-29 11:07:15 -08:00
Jefftree 987645aaa7 add aggregated /apis handler for genericapiserver
so that aggregated-apiservers can also take advantage. discovered by e2e tests with feature enabled

Kubernetes-commit: c9b34884004079ed3f184b475f7408984f9226f4
2022-11-09 18:29:27 +00:00
Alexander Zielenski b2bf3ca966 add new aggregated resourcemanager to genericapiserver
Co-authored-by: Jeffrey Ying <jeffrey.ying86@live.com>

Kubernetes-commit: 6e83f6750598d394fb257f66c5d0721cf88f45db
2022-11-08 12:37:50 -08:00
Andrew Sy Kim c4a89b8fc6 apiserver identity : use SHA256 hash in lease names
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>

Kubernetes-commit: 5b3a9e2d758650ff2919b8343d2a34ba8ca84b2b
2022-11-05 13:52:07 -04:00
David Ashpole 0cf3af5b9f add otel tracing to latency filters
Kubernetes-commit: ed1610ad15f91b72017c5d69dc4f7d59a17c270f
2022-10-20 16:17:02 +00:00
Andrew Sy Kim 0a5efb307f apiserver identity: use persistent identity format based on hostname
Signed-off-by: Andrew Sy Kim <andrewsy@google.com>

Kubernetes-commit: 21507902ba123c5c60eaa73436b95c4ae9b75908
2022-10-24 11:24:26 -04:00
David Ashpole 0b88ce8f83 shut down tracerprovider when stopping the kube-apiserver
Kubernetes-commit: 2342721c157e8a715747187b44af2bd9bacd432f
2022-11-02 13:15:27 +00:00
Tim Allclair 4b329cff47 Rename WithAuditID to WithAuditInit
Kubernetes-commit: ea28a21a6790d40c1fe540c64a296c8f0db17c65
2022-07-12 14:46:27 -07:00
Tim Allclair bd7c7f52c2 Consolidate AuditContext
Kubernetes-commit: f1d684b7b60b39b7dc1eb4156307c593f0ba74e1
2022-07-12 11:53:57 -07:00
Mohammad Zuber Khan 6fe4f87105 add superuser fallback to authorizer (#111558)
* add superuser fallback to authorizer

* change the order of authorizers

* change the order of authorizers

* remove the duplicate superuser authorizer

* add integration test for superuser permissions

Kubernetes-commit: f86acbad68baf1a99d6fa153f6f0cdc7b93932e4
2022-10-19 04:02:04 +00:00
Jiahui Feng ac0ce38abe use DefaultMaxRequestSizeBytes for maxRequestSizeBytes.
Kubernetes-commit: 755f41a185e828d9c64ae3ac37ce829e60592ad1
2022-10-10 14:42:24 -07:00