Commit 69505a3
Create a new KubernetesPeonClient that uses fabric8 informers to reduce load on an underlying k8s API (#18599)
* app code working but needs cleanup and testing
* caching side cleaner. need to add back direct client
* Implementation ready for deeper UT and ET writing
* checkstyle cleanup
* Remove the busy waiting. Overhaul caching client testing
* some config and instantion cleanup along with basic docs
* extnd the K8s task runner docker test to run with both direct and caching mode for the k8s client
* fix spelling and add resync to dictionary
* fix strict compile issues
* fixup checkstyle
* fix k8s overlord module setup
* few small fixups
* fix checkstyle
* fix up some issues with wait for job completion
* cleanup and fix some tests
* Make DruidKubernetesClient defend against invalid use if caching is off
* cleanup checkstyle
* dont use deprecated method
* doc update
* fix spelling
* fix checkstyle after merge with master
* Improve reliability of the Caching K8s Peon Client code and associated embedded tests
* fix checkstyle
* Modifications to try and reduce caching client api impact even more
* Fixup tests now that we have refactored log fetching
* remove some whitespace from the diff. Can be corrected in a future formatting patch
* one more whitespace cleanup
* more diff cleanup
* Make another api usage optimization for the caching client. Clean up code and javadocs
* diff cleanup
* Some better class javadocs for the k8s clients
* logging and comment cleanup
* DruidKubernetesClient tidy up
* javadoc link add
* Use background propagation policy when deleting jobs to lessen load on k8s api
* fix an npe and add a test to caching client
* Remove AbstractK8sClient, rename DirectClient
* Remove formatting changes in KubernetesPeonClient
* Remove more formatting changes
* Address the more minor review comments
* re-add log watch refactors to KubernetesPeonClient, they reduce API traffic
* migrate timers to stopwatch in caching k8s client per review comments
* Remove unused code
* style fix
* remove unneeded code
* Extract Caching client code from DruidKubernetesClient per review
* Make name for cache read methods more logical
* Stop exposing the EventNotifier in DruidKubernetesCachingClient
* Improve informer executor name per review
* Simplify informer setup for caching client
* cleanup caching client tests and add a lifecycle stop to the informers
* Improve thread safety of KubernetesResourceEventNotifier
* Simply the peon waiting code for the caching client
* Fix the k8s overlord module for the caching client
* fix configs for docker embedded test
* fix broken embedded tests
* use the indexer not informer for cache reads
* Cleanup after another review round
---------
Co-authored-by: Kashif Faraz <[email protected]>1 parent 6275277 commit 69505a3
File tree
31 files changed
+2065
-192
lines changed- docs/development/extensions-core
- embedded-tests/src/test/java/org/apache/druid/testing/embedded
- indexing
- k8s
- extensions-core/kubernetes-overlord-extensions/src
- main/java/org/apache/druid/k8s/overlord
- common
- test/java/org/apache/druid/k8s/overlord
- common
- taskadapter
- services/src/test/java/org/apache/druid/testing/embedded
- website
31 files changed
+2065
-192
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
36 | 61 | | |
37 | 62 | | |
38 | 63 | | |
| |||
798 | 823 | | |
799 | 824 | | |
800 | 825 | | |
801 | | - | |
| 826 | + | |
| 827 | + | |
802 | 828 | | |
803 | 829 | | |
804 | 830 | | |
| |||
Lines changed: 5 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
| |||
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
43 | | - | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| |||
243 | 239 | | |
244 | 240 | | |
245 | 241 | | |
246 | | - | |
| 242 | + | |
247 | 243 | | |
248 | 244 | | |
249 | 245 | | |
| |||
308 | 304 | | |
309 | 305 | | |
310 | 306 | | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
318 | 311 | | |
319 | 312 | | |
320 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 61 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| |||
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
171 | | - | |
172 | 177 | | |
173 | 178 | | |
174 | 179 | | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
179 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
| |||
199 | 206 | | |
200 | 207 | | |
201 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
202 | 261 | | |
203 | 262 | | |
204 | 263 | | |
| |||
Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
75 | 94 | | |
76 | 95 | | |
77 | 96 | | |
| |||
100 | 119 | | |
101 | 120 | | |
102 | 121 | | |
| 122 | + | |
| 123 | + | |
103 | 124 | | |
104 | 125 | | |
105 | 126 | | |
| |||
232 | 253 | | |
233 | 254 | | |
234 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
235 | 268 | | |
236 | 269 | | |
237 | 270 | | |
| |||
255 | 288 | | |
256 | 289 | | |
257 | 290 | | |
258 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
259 | 294 | | |
260 | 295 | | |
261 | 296 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
180 | 192 | | |
181 | 193 | | |
182 | 194 | | |
| |||
0 commit comments