kcr_canaries_flanksource_com 3.20260601.103435

Kubernetes Custom Resource Bindings
Documentation
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
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --docs --derive=Default --derive=PartialEq --smart-derive-elision --filename crd-catalog/flanksource/canary-checker/canaries.flanksource.com/v1/components.yaml
// kopium version: 0.23.0

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use serde::{Serialize, Deserialize};
    pub use std::collections::BTreeMap;
}

use self::prelude::*;

/// ComponentSpec defines the specification for a component.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
#[kube(group = "canaries.flanksource.com", version = "v1", kind = "Component", plural = "components")]
#[kube(namespaced)]
#[kube(status = "ComponentStatus")]
#[kube(schema = "disabled")]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct ComponentSpec {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub checks: Option<Vec<ComponentChecks>>,
    /// Create new child components
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub components: Option<Vec<ComponentComponents>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configID")]
    pub config_id: Option<String>,
    /// Lookup and associate config items with this component
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub configs: Option<Vec<ComponentConfigs>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalID")]
    pub external_id: Option<String>,
    /// Only applies when using lookup, when specified the components and properties
    /// specified under ForEach will be templated using the components returned by the lookup
    /// ${.properties} can be used to reference the properties of the component
    /// ${.component} can be used to reference the component itself
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "forEach")]
    pub for_each: Option<BTreeMap<String, serde_json::Value>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub health: Option<String>,
    /// healthExpr allows defining a cel expression to evaluate the health of a component
    /// based on the summary.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "healthExpr")]
    pub health_expr: Option<String>,
    /// If set to true, do not display in UI
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hidden: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<ComponentId>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
    /// The lifecycle state of the component e.g. production, staging, dev, etc.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lifecycle: Option<String>,
    /// Logs is a list of logs selector for apm-hub.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub logs: Option<Vec<ComponentLogs>>,
    /// Lookup component definitions from an external source, use the
    /// forEach property to iterate over the results to further enrich each component.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lookup: Option<BTreeMap<String, serde_json::Value>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub order: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    /// Reference to populate parent_id
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "parentLookup")]
    pub parent_lookup: Option<ComponentParentLookup>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub properties: Option<Vec<ComponentProperties>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub relationships: Option<Vec<ComponentRelationships>>,
    /// Lookup and associcate other components with this component
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selectors: Option<Vec<ComponentSelectors>>,
    /// statusExpr allows defining a cel expression to evaluate the status of a component
    /// based on the summary.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "statusExpr")]
    pub status_expr: Option<String>,
    /// Summary is the health, incidents, insights & check summary
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub summary: Option<ComponentSummary>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tooltip: Option<String>,
    /// The type of component, e.g. service, API, website, library, database, etc.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentChecks {
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentComponents {
}

/// ConfigQuery is used to look up and associate
/// config items with a component.
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentConfigs {
    /// Agent can be the agent id or the name of the agent.
    ///  Additionally, the special "self" value can be used to select resources without an agent.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub agent: Option<String>,
    /// Cache directives
    ///  'no-cache' (should not fetch from cache but can be cached)
    ///  'no-store' (should not cache)
    ///  'max-age=X' (cache for X duration)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cache: Option<String>,
    /// Deprecated. Use `fieldSelector (config_class=)`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub class: Option<String>,
    /// Deprecated. Use `fieldSelector (external_id=)`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub external_id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldSelector")]
    pub field_selector: Option<String>,
    /// Health filters resources by the health.
    /// Multiple healths can be provided separated by comma.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub health: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "includeDeleted")]
    pub include_deleted: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limit: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,
    /// Search query that applies to the resource name, tag & labels.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
    /// Statuses filter resources by the status
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub statuses: Option<Vec<String>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tagSelector")]
    pub tag_selector: Option<String>,
    /// Deprecated. Use `labelSelector`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tags: Option<BTreeMap<String, String>>,
    /// Deprecated. Use `types`
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    /// Types filter resources by the type
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub types: Option<Vec<String>>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentId {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub expr: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub javascript: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "jsonPath")]
    pub json_path: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub template: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentLogs {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub labels: Option<BTreeMap<String, String>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
}

/// Reference to populate parent_id
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentParentLookup {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "externalID")]
    pub external_id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentProperties {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub color: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "configLookup")]
    pub config_lookup: Option<ComponentPropertiesConfigLookup>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub headline: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub hidden: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "lastTransition")]
    pub last_transition: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub links: Option<Vec<ComponentPropertiesLinks>>,
    /// CanarySpec defines the desired state of Canary
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub lookup: Option<BTreeMap<String, serde_json::Value>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub max: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub min: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub order: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub summary: Option<ComponentPropertiesSummary>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tooltip: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    /// e.g. milliseconds, bytes, millicores, epoch etc.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unit: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub value: Option<i64>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentPropertiesConfigLookup {
    /// Lookup a config by it
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub config: Option<ComponentPropertiesConfigLookupConfig>,
    /// Apply transformations to the value
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub display: Option<ComponentPropertiesConfigLookupDisplay>,
    /// A JSONPath expression to lookup the value in the config
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub field: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
}

/// Lookup a config by it
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentPropertiesConfigLookupConfig {
    /// Agent can be the agent id or the name of the agent.
    ///  Additionally, the special "self" value can be used to select resources without an agent.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub agent: Option<String>,
    /// Cache directives
    ///  'no-cache' (should not fetch from cache but can be cached)
    ///  'no-store' (should not cache)
    ///  'max-age=X' (cache for X duration)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cache: Option<String>,
    /// Deprecated. Use `fieldSelector (config_class=)`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub class: Option<String>,
    /// Deprecated. Use `fieldSelector (external_id=)`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub external_id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldSelector")]
    pub field_selector: Option<String>,
    /// Health filters resources by the health.
    /// Multiple healths can be provided separated by comma.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub health: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "includeDeleted")]
    pub include_deleted: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limit: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,
    /// Search query that applies to the resource name, tag & labels.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
    /// Statuses filter resources by the status
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub statuses: Option<Vec<String>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tagSelector")]
    pub tag_selector: Option<String>,
    /// Deprecated. Use `labelSelector`
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tags: Option<BTreeMap<String, String>>,
    /// Deprecated. Use `types`
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    /// Types filter resources by the type
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub types: Option<Vec<String>>,
}

/// Apply transformations to the value
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentPropertiesConfigLookupDisplay {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub expr: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub javascript: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "jsonPath")]
    pub json_path: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub template: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentPropertiesLinks {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub icon: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tooltip: Option<String>,
    /// e.g. documentation, support, playbook
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentPropertiesSummary {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub expr: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub javascript: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "jsonPath")]
    pub json_path: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub template: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentRelationships {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "ref")]
    pub r#ref: Option<String>,
    /// The type of relationship, e.g. dependsOn, subcomponentOf, providesApis, consumesApis
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
    pub r#type: Option<String>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentSelectors {
    /// Agent can be the agent id or the name of the agent.
    ///  Additionally, the special "self" value can be used to select resources without an agent.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub agent: Option<String>,
    /// Cache directives
    ///  'no-cache' (should not fetch from cache but can be cached)
    ///  'no-store' (should not cache)
    ///  'max-age=X' (cache for X duration)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cache: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldSelector")]
    pub field_selector: Option<String>,
    /// Health filters resources by the health.
    /// Multiple healths can be provided separated by comma.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub health: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "includeDeleted")]
    pub include_deleted: Option<bool>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "labelSelector")]
    pub label_selector: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub limit: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub scope: Option<String>,
    /// Search query that applies to the resource name, tag & labels.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub search: Option<String>,
    /// Statuses filter resources by the status
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub statuses: Option<Vec<String>>,
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "tagSelector")]
    pub tag_selector: Option<String>,
    /// Types filter resources by the type
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub types: Option<Vec<String>>,
}

/// Summary is the health, incidents, insights & check summary
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentSummary {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub checks: Option<BTreeMap<String, i64>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub healthy: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub incidents: Option<BTreeMap<String, BTreeMap<String, i64>>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub info: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub insights: Option<BTreeMap<String, BTreeMap<String, i64>>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub unhealthy: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub warning: Option<i64>,
}

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct ComponentStatus {
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")]
    pub observed_generation: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
}