Commit fe23504
load cron scripts from multiple sources
Summary: For our usage of Pixie, it's convenient to exclude Pixie's dependency on the control plane. This commit allows the query broker:
1. to load cron scripts from config maps in the same namespace
2. to turn on and off loading cron scripts from the cloud or config maps
Type of change: /kind feature
Changes: This commit implements the functionality described above.
* added a `scriptrunner.Source` type that encapsulates how cron scripts are initialized/updated.
* moved existing logic for fetching cron scripts to `scriptrunner.CloudSource`
* added `scriptrunner.ConfigMapSource`
* Modified `scriptrunner.ScriptRunner` to use `scriptrunner.Source`s.
* Added a configuration flag (`--cron_script_sources` or or `PL_CRON_SCRIPT_SOURCES`) that allows a customer to choose which sources cron scripts can be loaded from. By default, it only loads cron scripts from the control plane. If you wanted to use both, for example, you could set `PL_CRON_SCRIPT_SOURCES="cloud configmaps"`.
* Moved many of the fakes/mocks/test helpers to `helper_test.go`
Test Plan: All of these changes have been tested at the unit level in addition to manual testing in all relevant configurations. We did our manual testing on GKE, EKS, and Kind with Kubernetes version 1.25. We don't anticipate other Kubernetes platforms or versions to be a problem since the config map API is stable and consistent across those dimensions. Moving the logic to load scripts from the control plane was probably the riskiest change and might warrant some extra attention.
Co-authored-by: Devon Warshaw <warshawd@vmware.com>
Signed-off-by: Matthew Conger-Eldeen <matthewco@vmware.com>1 parent fa0d741 commit fe23504
File tree
16 files changed
+1986
-962
lines changed- k8s/vizier/base
- src
- utils/template_generator/vizier_yamls
- vizier/services/query_broker
- controllers
- script_runner
16 files changed
+1986
-962
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
2 | 22 | | |
3 | 23 | | |
4 | 24 | | |
5 | | - | |
| 25 | + | |
6 | 26 | | |
7 | 27 | | |
8 | 28 | | |
9 | 29 | | |
10 | 30 | | |
11 | 31 | | |
12 | | - | |
13 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
415 | 427 | | |
416 | 428 | | |
417 | 429 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
511 | | - | |
| 511 | + | |
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
213 | 218 | | |
214 | 219 | | |
215 | 220 | | |
| |||
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
| 226 | + | |
221 | 227 | | |
222 | 228 | | |
223 | 229 | | |
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
42 | 53 | | |
43 | 54 | | |
44 | 55 | | |
| |||
47 | 58 | | |
48 | 59 | | |
49 | 60 | | |
50 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
51 | 67 | | |
52 | 68 | | |
53 | 69 | | |
| 70 | + | |
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
| |||
61 | 78 | | |
62 | 79 | | |
63 | 80 | | |
| 81 | + | |
64 | 82 | | |
65 | | - | |
66 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
67 | 91 | | |
68 | 92 | | |
69 | 93 | | |
| |||
0 commit comments