Commit Graph

129 Commits

Author SHA1 Message Date
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
Jefftree 649cd36479 Add OpenAPI v3 publishing under feature gate OpenAPIV3
Kubernetes-commit: 5bf3ed7a98e1e5247fe3fc2f6f948e6ed9a23521
2021-10-26 11:11:59 -07:00
Lukasz Szaszkiewicz 67be998d0f rename to muxAndDiscoveryComplete
Kubernetes-commit: 9e2bdfee02a6851fbb13ffe28611e9d2b6242785
2021-10-19 12:24:00 +02:00
Lukasz Szaszkiewicz 5c13ee7dbf genericapiserver: indroduce muxCompleteSignals for holding signals that indicate all known HTTP paths have been registered
the new field exists primarily to avoid returning a 404 response when a resource actually exists but we haven't installed the path to a handler.
it is exposed for easier composition of the individual servers.
the primary users of this field are the WithMuxCompleteProtection filter and the NotFoundHandler.

Kubernetes-commit: ddfbb5d2bb57ee44b3e10f0b58f9cc7001f55802
2021-10-15 18:14:20 +02:00
Lukasz Szaszkiewicz b96eea9892 allow for passing a custom handler to the empty delegate
Kubernetes-commit: 207478c1e6f94b26d8033d5edc7a8a91c69ef716
2021-09-02 14:22:23 +02:00
wojtekt b898581360 Migrate to k8s.io/utils/clock in apiserver
Kubernetes-commit: 859a98c0358610e2c127cd2fba1be601ca975188
2021-09-14 20:36:07 +02:00
Abu Kashem ffb869e08f apiserver: add a new mode for graceful termination
add a new mode for graceful termination with the new server run option
'shutdown-send-retry-after'
- shutdown-send-retry-after=true: we initiate shutdown of the
  HTTP Server when all in-flight request(s) have been drained. during
  this window all incoming requests are rejected with status code
  429 and the following response headers:
    - 'Retry-After: N' - client should retry after N seconds
    - 'Connection: close' - tear down the TCP connection
- shutdown-send-retry-after=false: we initiate shutdown of the
  HTTP Server as soon as shutdown-delay-duration has elapsed. This
  is in keeping with the current behavior.

Kubernetes-commit: 3182b69e970bd1fd036ff839fdf811f14e790244
2021-07-14 10:39:29 -04:00
Lukasz Szaszkiewicz d8c0235e05 remove logging from the Signal method
Kubernetes-commit: 6c88a62cb4c849e3844dcc3870073a1b5e05d301
2021-07-02 12:50:20 +02:00
Lukasz Szaszkiewicz 3f407f0668 rename terminationSignals to lifecycleSignals
Kubernetes-commit: dae08bc3a735e50845af7cf639bdbb8971a2115a
2021-07-02 12:28:07 +02:00
Abu Kashem c1c949723d apiserver: NonBlockingRun should return a listener stopped channel
NonBlockingRun should also return a channel that gets closed when the
underlying http Server has stopped listening (during the graceful
shutdown period)

Kubernetes-commit: a84c1b71005930e8253c1348515020132c5c175b
2021-06-24 16:04:54 -04:00
Abu Kashem 5c1642946b apiserver: refactor graceful termination logic
- refactor graceful termination logic so we can write unit tests
  to assert on the expected behavior.

Kubernetes-commit: d85619030e3a5fec5960ad00136e8d9bd030b5f8
2021-06-24 15:51:38 -04:00
Davanum Srinivas c2350dc583 Switch to github.com/coreos/go-systemd/v22 and drop older package
- We use the new v22 module released on May 10
- We drop the unmaintained `github.com/coreos/pkg`

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

Kubernetes-commit: 7fcdbbef06d0bc8c4416db1d2cbba9f30d30e8c4
2021-06-16 11:14:02 -04:00
Abu Kashem f410577081 apiserver: close handler chain right after shutdown delay duration
Kubernetes-commit: de7e56bf37440ca6a4c634ede8abaf1315fe9de3
2021-06-07 18:13:24 -04:00
David Eads 2286099903 update integration tests to reflect the kube version to stop serving removed APIs
Kubernetes-commit: d6a4afa5b8f6b7a17868649ea40b370c7f12a37f
2021-05-11 15:17:40 -04:00
Gautier Delorme af9424d2c9 remove go-openapi/spec
Signed-off-by: Gautier Delorme <gautier.delorme@gmail.com>

Kubernetes-commit: 34b0fcef5fc47e3fcddf7f6ca1b3e6176b2a5323
2021-04-20 17:48:33 +02:00
Kevin Delgado a11399dd98 Add ability to skip OpenAPI handler installation
Kubernetes-commit: 66d2f4359efadd2cf85f9d901676f2ea28555951
2021-03-17 00:26:23 +00:00
David Eads 3f9e652c39 provide directly decodable versions for storageversion API
Kubernetes-commit: fa03dee68cea605b285b00ae5b6ce22659d95026
2021-03-08 09:33:46 -05:00
Haowei Cai 0273686309 require APIServerIdentity to be enabled to run StorageVersionAPI
without APIServerIdentity enabled, stale apiserver leases won't be GC'ed
and the same for stale storage version entries. In that case the storage
migrator won't operate correctly without manual intervention.

Kubernetes-commit: 1c2d446648662529282a3bb1528a6dbb50700fdb
2020-11-08 19:06:30 -08:00
Chao Xu cfa0865e12 Collect storage versions as ResourceInfo when installing API endpoints.
Co-authored-by: Haowei Cai <haoweic@google.com>

Kubernetes-commit: 369475681679e1cb68c23c3355542599a3c0e1e3
2020-02-24 15:35:14 -08:00
Haowei Cai 8e0bbdb835 add kube-apiserver-lease-controller poststart hook
Kubernetes-commit: 3761a00e5b4bd1fab01f0b6682830aa1ef86a131
2020-10-26 13:17:00 -07:00
David Eads beb1fce6bb remove dead apiserver field
Kubernetes-commit: 4dcf3807ac534377439b948d9772101ef8ac0259
2020-11-04 14:35:13 -05:00
Jefftree ce4c2eff1a Reuse SSA type converter for resources in the same API Group
Kubernetes-commit: 7182d84b109bb1c928bd5bf92d8c175432b9eeae
2020-10-20 11:16:51 -07:00