Eric Lin
a2e6b85db4
handlers/watch: refactor watch serving to prepare offloading
...
Signed-off-by: Eric Lin <exlin@google.com>
Kubernetes-commit: 87d817e62d8c6e93cf45bf90a7ecadfe4156ab1f
2023-11-27 10:06:50 +00:00
Wojciech Tyczyński
697d456e35
Minor cleanup in watch handlers
...
Kubernetes-commit: d907062308563b1a9e52152c48f4240a6e11aade
2023-11-29 22:31:05 +01:00
Wojciech Tyczyński
442cc39449
Unify watch handler across http and websockets
...
Kubernetes-commit: 55e60db88b126013f00135f49df3296f52b2572a
2023-11-29 21:57:39 +01:00
Wojciech Tyczyński
d64b183dbd
Address review comments
...
Kubernetes-commit: 0dd495e6dc253f94b0ad0bb92178fb5e8981116b
2023-10-13 10:48:16 +02:00
Wojciech Tyczyński
65d3be7b39
Refactor watch event serialization to allow caching
...
Kubernetes-commit: 7ff866463af46b5f7cf068ba8d51c68e417b9ece
2023-08-25 15:41:14 +02:00
Lukasz Szaszkiewicz
cd87b8f62d
handlers/watch: calculate and record WatchList latency metric.
...
Kubernetes-commit: 772b1f4cd84a738f632716e28d4067c00f0b7f13
2023-09-19 03:05:00 +02:00
Wojciech Tyczyński
3bcdefc0fd
Refactor transformers for watch to implement Encoder interface
...
Kubernetes-commit: 160589a0edb2038f2e22e376b6a0b71a24d21f22
2023-08-11 21:43:49 +02:00
Wojciech Tyczyński
70b023f369
Minor cleanup tranformers interface
...
Kubernetes-commit: 3fcc045bce9d77704f872d6089d7c09342e26a44
2023-08-09 19:49:59 +02:00
Wojciech Tyczyński
3fd71eeb11
Refactor WatchServer to prepare for using encoders
...
Kubernetes-commit: ff56d3b6914dbc9e16683ab731eb8c0a485b4ab4
2023-08-03 21:50:08 +02:00
Sean Sullivan
cdd93b4685
Refactor wsstream library from apiserver to apimachinery
...
Kubernetes-commit: 8f3109da7913ef17c6656893f12f0e29ceabbde0
2023-05-22 10:03:17 -07:00
Eric Lin
edd537cbe3
Do not copy bytes for cached serializations
...
Since cachingObject has the encoded data cached and they are not
supposed to change. It's memory efficient to just copy the slice
references.
Signed-off-by: Eric Lin <exlin@google.com>
Kubernetes-commit: 3085b57869a2a7bf5290ab97facaf17fedfa88a0
2023-05-31 19:12:32 +00:00
Abu Kashem
4995a4f631
apiserver: watch gets notified on server shutdown signal
...
Kubernetes-commit: 697d96710856f96329a79a2574e109abd2f1626a
2023-01-13 18:02:41 -05:00
Han Kang
a414002089
cleanup deprecated metrics and usages
...
Kubernetes-commit: f223b900907b71431d7b6ceefa1642bb44fd9d84
2022-06-01 11:55:14 -07:00
Lukasz Szaszkiewicz
457184ab3a
update the watch server to use EncoderWithAllocator during object serialization.
...
It allows us to allocate a single buffer for the entire watch session and release it when a watch connection is closed.
Previously memory was allocated for every object serialization putting a lot of pressure on GC and consuming more memory than needed.
Kubernetes-commit: eda1b0c68ec166ee52c50e4a6ab682ce7227b6a5
2022-02-17 16:04:50 +01:00
Abu Kashem
6013da2b94
apiserver: wrap ResponseWriter using abstraction
...
Kubernetes-commit: 0d50c969c587c8a6c16e0962118305ac652c5a6b
2021-09-20 11:21:56 -04:00
yoyinzyc
74c8267082
add context to metrics in apiserver/endpoint
...
Kubernetes-commit: 266d67bd5124725befe775d580289b67a59f496c
2021-01-20 13:13:00 -08:00
chenjun.cj
d1465bc6c3
fix potential memory leak issue in processing watch request
...
Kubernetes-commit: b911aa6471a83b1d2b4ea346e5c6b442dfa9b53b
2019-11-18 16:43:15 +08:00
Jordan Liggitt
3aa0552959
Switch TableGenerator/TableConvertor interfaces to metav1
...
Kubernetes-commit: 36eb250cbb441984260ded6f7abeb796974031c3
2019-11-26 13:13:25 -05:00
chenjun.cj
455e205726
use context to check client closed instead of http.CloseNotifier in processing watch request
...
Kubernetes-commit: 1daa08c5c8634af762b0352ff4a49bdef6924c5f
2019-11-18 21:27:05 +08:00
Ted Yu
48d357e235
Stop Watching when there is encoding error
...
Kubernetes-commit: 639af77d463a4d07bc5d7d19366bd98310b55724
2019-11-07 14:32:47 -08:00
Maciej Borsz
9baeaec78d
Add 'apiserver_watch_events_sizes'.
...
That metric can be used to estimate the size of watch events sent out to
the clients.
Kubernetes-commit: 4af189aab9cca61d1a701133596f6f82b1ca0719
2019-07-23 12:55:11 +02:00
Dr. Stefan Schimanski
c4286f7b60
apiserver: store httplog in context
...
Kubernetes-commit: e848eaa566b750ad5e5fd26a64eecfc883f936f3
2019-06-14 13:09:13 +02:00
Maciej Borsz
df684d906a
Add 'apiserver_watch_events_total' metric.
...
We found this metric useful to understand the CPU usage of the
kube-apiserver process.
Kubernetes-commit: 58d3338ddd5e406988fdfaa9019fd7200996c49f
2019-06-05 14:27:09 +02:00
leigh capili
7762f62741
Refactor loops over SupportedMediaTypes() where mediaType is used to match a single SerializerInfo{}
...
We have an existing helper function for this: runtime.SerializerInfoForMediaType()
This is common prep-work for encoding runtime.Objects into JSON/YAML for transmission over the wire or writing to ComponentConfigs.
Kubernetes-commit: 47e52d2981dc2a5c5950042f50688cf24dd92eda
2019-04-04 19:01:01 -06:00
Clayton Coleman
c8f7d5017d
Make RequestScope be a pointer consistently for better memory use
...
RequestScope is a large struct and causes stack growth when we pass
it by value into multiple stack levels. Avoid the allocations for
this read only struct by passing a pointer.
Kubernetes-commit: 8fede0b18a81a6fb1acc1a48857f482857c25286
2019-03-25 23:33:48 -04:00
Clayton Coleman
8e43494f09
Avoid allocating the watch shim object more than once
...
We can reset and reuse this object repeatedly without triggering an
allocation.
Kubernetes-commit: 316a87ce7dff525555483eaac962899fd365177d
2019-03-26 23:34:25 -04:00
Clayton Coleman
8d7b330c4c
Support Table and PartialObjectMetadata on watch
...
Clean up the code paths that lead to objects being transformed and output with negotiation.
Remove some duplicate code that was not consistent. Now, watch will respond correctly to
Table and PartialObjectMetadata requests. Add unit and integration tests.
When transforming responses to Tables, only the first watch event for a given type will
include the columns. Columns will not change unless the watch is restarted.
Add a volume attachment printer and tighten up table validation error cases.
Disable protobuf from table conversion because Tables don't have protobuf because they
use `interface{}`
Kubernetes-commit: 3230a0b4fd14a6166f8362d4732e199e8779c426
2018-11-28 23:50:12 -05:00
Antoine Pelisse
337fc9ccde
API Machinery, Kubectl and tests
...
Kubernetes-commit: 0e1d50e70fdc9ed838d75a7a1abbe5fa607d22a1
2019-01-16 21:14:42 -08:00
Clayton Coleman
2b9b0922e8
Make conversion function names match expected values
...
Kubernetes-commit: ba95744bc56970ccc67e51589122911bfdb5425a
2018-07-03 16:06:44 -04:00
Clayton Coleman
9a797b9333
Print type information when unknown watch error
...
Got
```
E0628 00:23:07.106285 1 watch.go:274] unable to encode watch object: expected pointer, but got invalid kind
```
on a production system and had no way to debug what type was being sent.
Kubernetes-commit: 307849baef076d8ee61a3b9649f9260a765f7ac0
2018-06-27 20:34:48 -04:00
wojtekt
27dca16e75
Track number of registered watchers in apiserver
...
Kubernetes-commit: bdd9492da0c992e532c5e5d07cae3b68c9b7b78f
2018-05-14 11:22:10 +02:00
Jordan Liggitt
25758bf0f8
Remove request context mapper
...
Kubernetes-commit: 8ea88a5092c767fc3141512db924fd0435f7670e
2018-04-18 11:12:15 -04:00
jianglingxia
0167d09496
squash the commits into one
...
Kubernetes-commit: fa6b60120b5d54b5f9c13b76973283e68d053f8a
2017-07-28 13:56:11 +00:00
Wojciech Tyczynski
1d0b329280
Pass RequestInfo to GenerateLink
...
Kubernetes-commit: b4018f7da18f1e61e59c5c48cae4178db2714f85
2017-06-13 20:47:27 +00:00
Wojciech Tyczynski
d82b8bc329
Pass Context to GenerateLink
...
Kubernetes-commit: 25f0fe1adb199697565487b9dfacc4ed8ecdccbb
2017-06-13 20:47:27 +00:00
deads2k
63fa51033e
build external watch event so simple encoders can encode
...
Kubernetes-commit: f53c9a7e59fe71c038cf727ac2072e5eb9efc6b9
2017-04-28 20:36:29 +00:00
deads2k
540c5cf18e
remove dependency on gorestful for rest handling
...
Kubernetes-commit: c5e2f7c229d8194386de97df7ff6c1b0f71be4c7
2017-04-11 20:35:21 +00:00
Dr. Stefan Schimanski
f3c3e07241
Mechanical move: pkg/genericapiserver -> k8s.io/apiserver
2017-02-13 07:36:41 -05:00