Commit Graph

150 Commits

Author SHA1 Message Date
Siyuan Zhang 5a4ec0a797 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
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
Marek Siarkowicz 67ec836891 Implement streaming proto encoding
Kubernetes-commit: f5dd7107f7144c4f76ca6159c1eeddb48a12feaa
2024-12-19 12:30:39 +01:00
Paco Xu bd0e774416 remove AggregatedDiscoveryEndpoint that was GAed in v1.30
Kubernetes-commit: 8195f82fe82e7bcf36ba50ddc8b78c00fa8df2bc
2025-03-03 11:01:02 +08:00
Marek Siarkowicz 38b01a1f78 Streaming JSON encoder for List
Kubernetes-commit: e7c743b2ebfaed1e3132027c0369ac25b14b6f47
2024-12-19 10:38:30 +01: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
Ben Luddy 0b5852eb9a Wire serving codecs to CBOR feature gate.
Integration testing has to this point relied on patching serving codecs for built-in APIs. The
test-only patching is removed and replaced by feature gated checks at runtime.

Kubernetes-commit: 439d2f7b4028638b3d8d9261bb046c3ba8d9bfcb
2024-11-01 16:05:32 -04: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
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
Patrick Ohly 5ea67c789a apiserver + controllers: enhance context support
27a68aee3a4834 introduced context support for events. Creating an event
broadcaster with context makes tests more resilient against leaking goroutines
when that context gets canceled at the end of a test and enables per-test
output via ktesting.

The context could get passed to the constructor. A cleaner solution is to
enhance context support for the apiserver and then pass the context into the
controller's run method. This ripples up the call stack to all places which
start an apiserver.

Kubernetes-commit: b92273a760503cc57aba37c4d3a28554f7fec7f8
2023-12-01 09:00:59 +01:00
Jefftree d8d3b8c351 Use v2 types with agg discovery
Kubernetes-commit: 462dd326c2e98d937a96d49002883000efe4b2d6
2024-01-19 16:13:47 -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
guangli.bao e59c50c660 Remove GAed feature gates OpenAPIV3
Signed-off-by: guangli.bao <guangli.bao@daocloud.io>

Kubernetes-commit: 27bb40a9d839589ac9f97b6ce80b18a7635e9ae4
2023-10-19 22:30:58 +08:00
Jefftree 2e1024671d Fix v3 spec
Kubernetes-commit: b30c6bdff817cec28b3d88b3bb3e12f1e86488d0
2023-10-04 12:55:49 -04:00
David Eads 5ed33dc31d add list of served versions to storage version
Kubernetes-commit: 90ab7580aaeca1c6e949df15554ad5bc408dca8e
2023-07-12 18:27:27 -04:00
Icarus9913 6099c06f68 fix apiserver InstallAPIGroups slices out of range
Signed-off-by: Icarus9913 <icaruswu66@qq.com>

Kubernetes-commit: 07c945536089e38b1b824b371d199d75075da731
2023-05-17 16:53:27 +08:00
Alexander Zielenski 3783e4af68 Throw error if OpenAPIV3 config is not provided
it is required for Server-SIde-Apply to function correctly (SSA is based on OpenAPI schemas)

Kubernetes-commit: 302daa889c5ddb9c862cd0101b94071e42a3081d
2023-01-11 14:54:03 -08:00
Alexander Zielenski 63812e2f9b allow multiple sources to add/remove from discovery without clobbering each other
Kubernetes-commit: 0740b11073d08262d4d6687ceedd8f0c71819ebd
2023-03-20 10:05:15 -07:00
Antoine Pelisse 85d860d23f managedfields: Move most of fieldmanager package to managefields
Kubernetes-commit: 4f3859ce911bd308dbf6f617a8c9e2bdf3a1883b
2022-12-22 14:34:58 -08:00
Alex Zielenski 298fff883b Revert "Revert "Merge pull request #115324 from alexzielenski/apiserver/smd/use-openapiv3"
Kubernetes-commit: 7b004c4568176c4ccb2fd0dcde6cc10fc3739fd1
2023-02-27 12:22:29 -08: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
Jordan Liggitt 870a2c4b33 Revert "Merge pull request #115324 from alexzielenski/apiserver/smd/use-openapiv3"
This reverts commit 7efa62dfdf96890f7f3cf95d957c7561e09055c4, reversing
changes made to c48a7971e35a56cc2c996e174e3f76e9d2e82eaa.

Kubernetes-commit: 6165a12c718936a8edcc5b7e1a2e6b0f5d6e279e
2023-02-25 16:14:23 -05:00
Alexander Zielenski d58478335d clean up unnecessary field
Kubernetes-commit: 3e96127af1d33b7d958d6cb328eaf06b49904d46
2023-01-11 14:54:03 -08:00
Patrick Ohly 8f8c30ff8f logging: fix names of keys
The stricter checking with the upcoming logcheck v0.4.1 pointed out these names
which don't comply with our recommendations in
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments.

Kubernetes-commit: bc6c7fa91201348d010b638fbadf32007c0ac546
2023-01-16 15:04:01 +01:00
Abu Kashem 9e60654b8a apiserver: refactor WithWaitGroup handler
Kubernetes-commit: 9093f126b87cb686784bb27b08be9eb12b4d5453
2023-01-10 15:55:19 -05:00
Antoine Pelisse 94f827cb28 Hide OpeAPI details behind the NewTypeConverter
The fact that we're building the OpenAPI using the proto.Models is an
implementation detail that we shouldn't have to expose. Since we're
going to change the way this is transformed, let's first hide it behind
the common NewTypeConverter so that the next change is transparent.

This will also enable other clean-ups like hiding the gvkParser which
shouldn't be exposed and prevent some refactoring.

Kubernetes-commit: a7ab6b86db83e31ff599e4d21a065f6845fb93dd
2023-01-03 14:26:06 -08: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
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
Nick Turner e1dde980a4 Fix formatting of API server diagram
Kubernetes-commit: 02e3fbfeff5c3044321fc59f0427b64fbcfec70d
2022-11-06 16:41:11 -08:00
Wojciech Tyczyński baa5a012e9 Lock ServerSideApply feature to true
Kubernetes-commit: 57c95fbfa12bc04456330d8b0b29f333106cf156
2022-09-27 11:13:00 +02:00
Davanum Srinivas 7e94033a61 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
2022-07-19 20:54:13 -04:00
Ikko Ashimine f0eede2023 fix typo in genericapiserver.go
runnning -> running

Kubernetes-commit: a3f66a45977f95274ede281a6994350352b5fd36
2022-03-20 23:29:01 +09:00
Abu Kashem 658eeac034 fix preshutdown hook behavor with graceful termination
Kubernetes-commit: 9644edc321e3b7e5180eb7c15a27bf28e19485db
2022-05-12 19:58:33 -04:00
Abu Kashem eb2b1d986c apiserver: refactor graceful termination test
Kubernetes-commit: f28710bc465189b56c085876caf5aaa1ad037654
2022-05-18 22:58:36 -04:00
Abu Kashem 2000c163ec apiserver: add lifecycle signal for preshutdown hook
Kubernetes-commit: b1f7b60515798934b011d27bfeba1cee4fcd26b7
2022-05-17 12:00:04 -04:00
Abu Kashem 771df84108 apiserver: refactor - move AuditBackend.Run out of NonBlockingRun
Kubernetes-commit: 6b8398318c005753383700f27bd398f4724b37a9
2022-05-17 11:14:11 -04:00
Wojciech Tyczyński 751a040f24 Cleanup CRD storage on shutdown
Kubernetes-commit: 01cf641ffbb3c876c4fc6c3e53a0613356f883e5
2022-05-15 22:25:43 +02:00
Wojciech Tyczyński 30c4077e0e Diagram for graceful shutdown
Kubernetes-commit: 1145582de367b9aa4072e631845ce3abc37b8540
2022-05-12 17:22:36 +02:00
Wojciech Tyczyński 8010e8e7e3 Implement Destroy() method for all registries
Kubernetes-commit: 80060a502c3f86f00800fbeba7684a85f1ce5e17
2022-04-05 12:26:22 +02:00
Wojciech Tyczyński fbdcc3ee50 Cleanup rest storage resources on shutdown
Kubernetes-commit: 0527a0dd453c4b76259389ec8e8e6888c5e2a5ab
2022-04-05 11:00:06 +02:00
Jefftree e4486afb41 Separate OpenAPI V2 and V3 Config
Kubernetes-commit: 67d3dbfaae87a5bf3325fadda7266ed223766a53
2022-03-28 13:18:56 -07:00
Abu Kashem af86802d1a apiserver: stop http server after pre shutdown hooks
Kubernetes-commit: 8d96cc2dfbd650544660e41c5e8efc8d1e1033a3
2022-02-09 16:40:57 -05:00
David Eads 7fd5822a08 migrate more rest handlers to select by resource enablement
Kubernetes-commit: 0ec20f97d27e08be8d8bbbbff52e68a4409ab43c
2022-02-21 16:10:25 -05:00
Wojciech Tyczyński 5e8e1ff118 Relax to using namer instead of selflinker in API groupversion
Kubernetes-commit: 0ad588b27b6845d9ece955bfdde0e2863b8e1394
2022-01-13 16:34:56 +01:00
Arda Güçlü 1fbc8d31a2 Rename ServeWithListenerStopped to Serve in secure_serving
This PR removes Serve function and uses all required places
ServeWithListenerStopped which takes place new Serve function.

This function returns ListenerStopped channel can be used to drain
requests before shutting down the server.

Kubernetes-commit: a8d2b3a7926394b1c53621804cdeb93e4a61b7c8
2021-11-08 17:20:31 +03:00