kubernetes-fluent-client 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.prettierignore +4 -0
  2. package/README.md +24 -0
  3. package/dist/cli.js +21 -1
  4. package/dist/fileSystem.d.ts +11 -0
  5. package/dist/fileSystem.d.ts.map +1 -0
  6. package/dist/fileSystem.js +42 -0
  7. package/dist/fileSystem.test.d.ts +2 -0
  8. package/dist/fileSystem.test.d.ts.map +1 -0
  9. package/dist/fileSystem.test.js +75 -0
  10. package/dist/generate.d.ts +71 -11
  11. package/dist/generate.d.ts.map +1 -1
  12. package/dist/generate.js +130 -117
  13. package/dist/generate.test.js +293 -346
  14. package/dist/postProcessing.d.ts +246 -0
  15. package/dist/postProcessing.d.ts.map +1 -0
  16. package/dist/postProcessing.js +497 -0
  17. package/dist/postProcessing.test.d.ts +2 -0
  18. package/dist/postProcessing.test.d.ts.map +1 -0
  19. package/dist/postProcessing.test.js +550 -0
  20. package/e2e/cli.e2e.test.ts +123 -0
  21. package/e2e/crds/policyreports.default.expected/policyreport-v1alpha1.ts +332 -0
  22. package/e2e/crds/policyreports.default.expected/policyreport-v1alpha2.ts +360 -0
  23. package/e2e/crds/policyreports.default.expected/policyreport-v1beta1.ts +360 -0
  24. package/e2e/crds/policyreports.no.post.expected/policyreport-v1alpha1.ts +331 -0
  25. package/e2e/crds/policyreports.no.post.expected/policyreport-v1alpha2.ts +360 -0
  26. package/e2e/crds/policyreports.no.post.expected/policyreport-v1beta1.ts +360 -0
  27. package/e2e/crds/test.yaml/policyreports.test.yaml +1008 -0
  28. package/e2e/crds/test.yaml/uds-podmonitors.test.yaml +1245 -0
  29. package/e2e/crds/uds-podmonitors.default.expected/podmonitor-v1.ts +1333 -0
  30. package/e2e/crds/uds-podmonitors.no.post.expected/podmonitor-v1.ts +1360 -0
  31. package/package.json +10 -9
  32. package/src/cli.ts +25 -1
  33. package/src/fileSystem.test.ts +67 -0
  34. package/src/fileSystem.ts +25 -0
  35. package/src/generate.test.ts +368 -358
  36. package/src/generate.ts +173 -154
  37. package/src/postProcessing.test.ts +742 -0
  38. package/src/postProcessing.ts +568 -0
@@ -0,0 +1,1245 @@
1
+ ---
2
+ apiVersion: apiextensions.k8s.io/v1
3
+ kind: CustomResourceDefinition
4
+ metadata:
5
+ annotations:
6
+ controller-gen.kubebuilder.io/version: v0.15.0
7
+ operator.prometheus.io/version: 0.76.1
8
+ name: uds-podmonitors
9
+ spec:
10
+ group: monitoring.coreos.com
11
+ names:
12
+ categories:
13
+ - prometheus-operator
14
+ kind: PodMonitor
15
+ listKind: PodMonitorList
16
+ plural: podmonitors
17
+ shortNames:
18
+ - pmon
19
+ singular: podmonitor
20
+ scope: Namespaced
21
+ versions:
22
+ - name: v1
23
+ schema:
24
+ openAPIV3Schema:
25
+ description: |-
26
+ The `PodMonitor` custom resource definition (CRD) defines how `Prometheus` and `PrometheusAgent` can scrape metrics from a group of pods.
27
+ Among other things, it allows to specify:
28
+ * The pods to scrape via label selectors.
29
+ * The container ports to scrape.
30
+ * Authentication credentials to use.
31
+ * Target and metric relabeling.
32
+
33
+
34
+ `Prometheus` and `PrometheusAgent` objects select `PodMonitor` objects using label and namespace selectors.
35
+ properties:
36
+ apiVersion:
37
+ description: |-
38
+ APIVersion defines the versioned schema of this representation of an object.
39
+ Servers should convert recognized schemas to the latest internal value, and
40
+ may reject unrecognized values.
41
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
42
+ type: string
43
+ kind:
44
+ description: |-
45
+ Kind is a string value representing the REST resource this object represents.
46
+ Servers may infer this from the endpoint the client submits requests to.
47
+ Cannot be updated.
48
+ In CamelCase.
49
+ More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
50
+ type: string
51
+ metadata:
52
+ type: object
53
+ spec:
54
+ description: Specification of desired Pod selection for target discovery
55
+ by Prometheus.
56
+ properties:
57
+ attachMetadata:
58
+ description: |-
59
+ `attachMetadata` defines additional metadata which is added to the
60
+ discovered targets.
61
+
62
+
63
+ It requires Prometheus >= v2.35.0.
64
+ properties:
65
+ node:
66
+ description: |-
67
+ When set to true, Prometheus attaches node metadata to the discovered
68
+ targets.
69
+
70
+
71
+ The Prometheus service account must have the `list` and `watch`
72
+ permissions on the `Nodes` objects.
73
+ type: boolean
74
+ type: object
75
+ bodySizeLimit:
76
+ description: |-
77
+ When defined, bodySizeLimit specifies a job level limit on the size
78
+ of uncompressed response body that will be accepted by Prometheus.
79
+
80
+
81
+ It requires Prometheus >= v2.28.0.
82
+ pattern: (^0|([0-9]*[.])?[0-9]+((K|M|G|T|E|P)i?)?B)$
83
+ type: string
84
+ jobLabel:
85
+ description: |-
86
+ The label to use to retrieve the job name from.
87
+ `jobLabel` selects the label from the associated Kubernetes `Pod`
88
+ object which will be used as the `job` label for all metrics.
89
+
90
+
91
+ For example if `jobLabel` is set to `foo` and the Kubernetes `Pod`
92
+ object is labeled with `foo: bar`, then Prometheus adds the `job="bar"`
93
+ label to all ingested metrics.
94
+
95
+
96
+ If the value of this field is empty, the `job` label of the metrics
97
+ defaults to the namespace and name of the PodMonitor object (e.g. `<namespace>/<name>`).
98
+ type: string
99
+ keepDroppedTargets:
100
+ description: |-
101
+ Per-scrape limit on the number of targets dropped by relabeling
102
+ that will be kept in memory. 0 means no limit.
103
+
104
+
105
+ It requires Prometheus >= v2.47.0.
106
+ format: int64
107
+ type: integer
108
+ labelLimit:
109
+ description: |-
110
+ Per-scrape limit on number of labels that will be accepted for a sample.
111
+
112
+
113
+ It requires Prometheus >= v2.27.0.
114
+ format: int64
115
+ type: integer
116
+ labelNameLengthLimit:
117
+ description: |-
118
+ Per-scrape limit on length of labels name that will be accepted for a sample.
119
+
120
+
121
+ It requires Prometheus >= v2.27.0.
122
+ format: int64
123
+ type: integer
124
+ labelValueLengthLimit:
125
+ description: |-
126
+ Per-scrape limit on length of labels value that will be accepted for a sample.
127
+
128
+
129
+ It requires Prometheus >= v2.27.0.
130
+ format: int64
131
+ type: integer
132
+ namespaceSelector:
133
+ description: |-
134
+ `namespaceSelector` defines in which namespace(s) Prometheus should discover the pods.
135
+ By default, the pods are discovered in the same namespace as the `PodMonitor` object but it is possible to select pods across different/all namespaces.
136
+ properties:
137
+ any:
138
+ description: |-
139
+ Boolean describing whether all namespaces are selected in contrast to a
140
+ list restricting them.
141
+ type: boolean
142
+ matchNames:
143
+ description: List of namespace names to select from.
144
+ items:
145
+ type: string
146
+ type: array
147
+ type: object
148
+ podMetricsEndpoints:
149
+ description: Defines how to scrape metrics from the selected pods.
150
+ items:
151
+ description: |-
152
+ PodMetricsEndpoint defines an endpoint serving Prometheus metrics to be scraped by
153
+ Prometheus.
154
+ properties:
155
+ authorization:
156
+ description: |-
157
+ `authorization` configures the Authorization header credentials to use when
158
+ scraping the target.
159
+
160
+
161
+ Cannot be set at the same time as `basicAuth`, or `oauth2`.
162
+ properties:
163
+ credentials:
164
+ description: Selects a key of a Secret in the namespace
165
+ that contains the credentials for authentication.
166
+ properties:
167
+ key:
168
+ description: The key of the secret to select from. Must
169
+ be a valid secret key.
170
+ type: string
171
+ name:
172
+ default: ""
173
+ description: |-
174
+ Name of the referent.
175
+ This field is effectively required, but due to backwards compatibility is
176
+ allowed to be empty. Instances of this type with an empty value here are
177
+ almost certainly wrong.
178
+ TODO: Add other useful fields. apiVersion, kind, uid?
179
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
180
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
181
+ type: string
182
+ optional:
183
+ description: Specify whether the Secret or its key must
184
+ be defined
185
+ type: boolean
186
+ required:
187
+ - key
188
+ type: object
189
+ x-kubernetes-map-type: atomic
190
+ type:
191
+ description: |-
192
+ Defines the authentication type. The value is case-insensitive.
193
+
194
+
195
+ "Basic" is not a supported value.
196
+
197
+
198
+ Default: "Bearer"
199
+ type: string
200
+ type: object
201
+ basicAuth:
202
+ description: |-
203
+ `basicAuth` configures the Basic Authentication credentials to use when
204
+ scraping the target.
205
+
206
+
207
+ Cannot be set at the same time as `authorization`, or `oauth2`.
208
+ properties:
209
+ password:
210
+ description: |-
211
+ `password` specifies a key of a Secret containing the password for
212
+ authentication.
213
+ properties:
214
+ key:
215
+ description: The key of the secret to select from. Must
216
+ be a valid secret key.
217
+ type: string
218
+ name:
219
+ default: ""
220
+ description: |-
221
+ Name of the referent.
222
+ This field is effectively required, but due to backwards compatibility is
223
+ allowed to be empty. Instances of this type with an empty value here are
224
+ almost certainly wrong.
225
+ TODO: Add other useful fields. apiVersion, kind, uid?
226
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
227
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
228
+ type: string
229
+ optional:
230
+ description: Specify whether the Secret or its key must
231
+ be defined
232
+ type: boolean
233
+ required:
234
+ - key
235
+ type: object
236
+ x-kubernetes-map-type: atomic
237
+ username:
238
+ description: |-
239
+ `username` specifies a key of a Secret containing the username for
240
+ authentication.
241
+ properties:
242
+ key:
243
+ description: The key of the secret to select from. Must
244
+ be a valid secret key.
245
+ type: string
246
+ name:
247
+ default: ""
248
+ description: |-
249
+ Name of the referent.
250
+ This field is effectively required, but due to backwards compatibility is
251
+ allowed to be empty. Instances of this type with an empty value here are
252
+ almost certainly wrong.
253
+ TODO: Add other useful fields. apiVersion, kind, uid?
254
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
255
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
256
+ type: string
257
+ optional:
258
+ description: Specify whether the Secret or its key must
259
+ be defined
260
+ type: boolean
261
+ required:
262
+ - key
263
+ type: object
264
+ x-kubernetes-map-type: atomic
265
+ type: object
266
+ bearerTokenSecret:
267
+ description: |-
268
+ `bearerTokenSecret` specifies a key of a Secret containing the bearer
269
+ token for scraping targets. The secret needs to be in the same namespace
270
+ as the PodMonitor object and readable by the Prometheus Operator.
271
+
272
+
273
+ Deprecated: use `authorization` instead.
274
+ properties:
275
+ key:
276
+ description: The key of the secret to select from. Must
277
+ be a valid secret key.
278
+ type: string
279
+ name:
280
+ default: ""
281
+ description: |-
282
+ Name of the referent.
283
+ This field is effectively required, but due to backwards compatibility is
284
+ allowed to be empty. Instances of this type with an empty value here are
285
+ almost certainly wrong.
286
+ TODO: Add other useful fields. apiVersion, kind, uid?
287
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
288
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
289
+ type: string
290
+ optional:
291
+ description: Specify whether the Secret or its key must
292
+ be defined
293
+ type: boolean
294
+ required:
295
+ - key
296
+ type: object
297
+ x-kubernetes-map-type: atomic
298
+ enableHttp2:
299
+ description: "`enableHttp2` can be used to disable HTTP2 when
300
+ scraping the target."
301
+ type: boolean
302
+ filterRunning:
303
+ description: |-
304
+ When true, the pods which are not running (e.g. either in Failed or
305
+ Succeeded state) are dropped during the target discovery.
306
+
307
+
308
+ If unset, the filtering is enabled.
309
+
310
+
311
+ More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase
312
+ type: boolean
313
+ followRedirects:
314
+ description: |-
315
+ `followRedirects` defines whether the scrape requests should follow HTTP
316
+ 3xx redirects.
317
+ type: boolean
318
+ honorLabels:
319
+ description: |-
320
+ When true, `honorLabels` preserves the metric's labels when they collide
321
+ with the target's labels.
322
+ type: boolean
323
+ honorTimestamps:
324
+ description: |-
325
+ `honorTimestamps` controls whether Prometheus preserves the timestamps
326
+ when exposed by the target.
327
+ type: boolean
328
+ interval:
329
+ description: |-
330
+ Interval at which Prometheus scrapes the metrics from the target.
331
+
332
+
333
+ If empty, Prometheus uses the global scrape interval.
334
+ pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
335
+ type: string
336
+ metricRelabelings:
337
+ description: |-
338
+ `metricRelabelings` configures the relabeling rules to apply to the
339
+ samples before ingestion.
340
+ items:
341
+ description: |-
342
+ RelabelConfig allows dynamic rewriting of the label set for targets, alerts,
343
+ scraped samples and remote write samples.
344
+
345
+
346
+ More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
347
+ properties:
348
+ action:
349
+ default: replace
350
+ description: |-
351
+ Action to perform based on the regex matching.
352
+
353
+
354
+ `Uppercase` and `Lowercase` actions require Prometheus >= v2.36.0.
355
+ `DropEqual` and `KeepEqual` actions require Prometheus >= v2.41.0.
356
+
357
+
358
+ Default: "Replace"
359
+ enum:
360
+ - replace
361
+ - Replace
362
+ - keep
363
+ - Keep
364
+ - drop
365
+ - Drop
366
+ - hashmod
367
+ - HashMod
368
+ - labelmap
369
+ - LabelMap
370
+ - labeldrop
371
+ - LabelDrop
372
+ - labelkeep
373
+ - LabelKeep
374
+ - lowercase
375
+ - Lowercase
376
+ - uppercase
377
+ - Uppercase
378
+ - keepequal
379
+ - KeepEqual
380
+ - dropequal
381
+ - DropEqual
382
+ type: string
383
+ modulus:
384
+ description: |-
385
+ Modulus to take of the hash of the source label values.
386
+
387
+
388
+ Only applicable when the action is `HashMod`.
389
+ format: int64
390
+ type: integer
391
+ regex:
392
+ description: Regular expression against which the extracted
393
+ value is matched.
394
+ type: string
395
+ replacement:
396
+ description: |-
397
+ Replacement value against which a Replace action is performed if the
398
+ regular expression matches.
399
+
400
+
401
+ Regex capture groups are available.
402
+ type: string
403
+ separator:
404
+ description: Separator is the string between concatenated
405
+ SourceLabels.
406
+ type: string
407
+ sourceLabels:
408
+ description: |-
409
+ The source labels select values from existing labels. Their content is
410
+ concatenated using the configured Separator and matched against the
411
+ configured regular expression.
412
+ items:
413
+ description: |-
414
+ LabelName is a valid Prometheus label name which may only contain ASCII
415
+ letters, numbers, as well as underscores.
416
+ pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
417
+ type: string
418
+ type: array
419
+ targetLabel:
420
+ description: |-
421
+ Label to which the resulting string is written in a replacement.
422
+
423
+
424
+ It is mandatory for `Replace`, `HashMod`, `Lowercase`, `Uppercase`,
425
+ `KeepEqual` and `DropEqual` actions.
426
+
427
+
428
+ Regex capture groups are available.
429
+ type: string
430
+ type: object
431
+ type: array
432
+ oauth2:
433
+ description: |-
434
+ `oauth2` configures the OAuth2 settings to use when scraping the target.
435
+
436
+
437
+ It requires Prometheus >= 2.27.0.
438
+
439
+
440
+ Cannot be set at the same time as `authorization`, or `basicAuth`.
441
+ properties:
442
+ clientId:
443
+ description: |-
444
+ `clientId` specifies a key of a Secret or ConfigMap containing the
445
+ OAuth2 client's ID.
446
+ properties:
447
+ configMap:
448
+ description: ConfigMap containing data to use for the
449
+ targets.
450
+ properties:
451
+ key:
452
+ description: The key to select.
453
+ type: string
454
+ name:
455
+ default: ""
456
+ description: |-
457
+ Name of the referent.
458
+ This field is effectively required, but due to backwards compatibility is
459
+ allowed to be empty. Instances of this type with an empty value here are
460
+ almost certainly wrong.
461
+ TODO: Add other useful fields. apiVersion, kind, uid?
462
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
463
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
464
+ type: string
465
+ optional:
466
+ description: Specify whether the ConfigMap or its
467
+ key must be defined
468
+ type: boolean
469
+ required:
470
+ - key
471
+ type: object
472
+ x-kubernetes-map-type: atomic
473
+ secret:
474
+ description: Secret containing data to use for the targets.
475
+ properties:
476
+ key:
477
+ description: The key of the secret to select from. Must
478
+ be a valid secret key.
479
+ type: string
480
+ name:
481
+ default: ""
482
+ description: |-
483
+ Name of the referent.
484
+ This field is effectively required, but due to backwards compatibility is
485
+ allowed to be empty. Instances of this type with an empty value here are
486
+ almost certainly wrong.
487
+ TODO: Add other useful fields. apiVersion, kind, uid?
488
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
489
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
490
+ type: string
491
+ optional:
492
+ description: Specify whether the Secret or its key
493
+ must be defined
494
+ type: boolean
495
+ required:
496
+ - key
497
+ type: object
498
+ x-kubernetes-map-type: atomic
499
+ type: object
500
+ clientSecret:
501
+ description: |-
502
+ `clientSecret` specifies a key of a Secret containing the OAuth2
503
+ client's secret.
504
+ properties:
505
+ key:
506
+ description: The key of the secret to select from. Must
507
+ be a valid secret key.
508
+ type: string
509
+ name:
510
+ default: ""
511
+ description: |-
512
+ Name of the referent.
513
+ This field is effectively required, but due to backwards compatibility is
514
+ allowed to be empty. Instances of this type with an empty value here are
515
+ almost certainly wrong.
516
+ TODO: Add other useful fields. apiVersion, kind, uid?
517
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
518
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
519
+ type: string
520
+ optional:
521
+ description: Specify whether the Secret or its key must
522
+ be defined
523
+ type: boolean
524
+ required:
525
+ - key
526
+ type: object
527
+ x-kubernetes-map-type: atomic
528
+ endpointParams:
529
+ additionalProperties:
530
+ type: string
531
+ description: |-
532
+ `endpointParams` configures the HTTP parameters to append to the token
533
+ URL.
534
+ type: object
535
+ noProxy:
536
+ description: |-
537
+ `noProxy` is a comma-separated string that can contain IPs, CIDR notation, domain names
538
+ that should be excluded from proxying. IP and domain names can
539
+ contain port numbers.
540
+
541
+
542
+ It requires Prometheus >= v2.43.0.
543
+ type: string
544
+ proxyConnectHeader:
545
+ additionalProperties:
546
+ items:
547
+ description: SecretKeySelector selects a key of a Secret.
548
+ properties:
549
+ key:
550
+ description: The key of the secret to select from. Must
551
+ be a valid secret key.
552
+ type: string
553
+ name:
554
+ default: ""
555
+ description: |-
556
+ Name of the referent.
557
+ This field is effectively required, but due to backwards compatibility is
558
+ allowed to be empty. Instances of this type with an empty value here are
559
+ almost certainly wrong.
560
+ TODO: Add other useful fields. apiVersion, kind, uid?
561
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
562
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
563
+ type: string
564
+ optional:
565
+ description: Specify whether the Secret or its key
566
+ must be defined
567
+ type: boolean
568
+ required:
569
+ - key
570
+ type: object
571
+ x-kubernetes-map-type: atomic
572
+ type: array
573
+ description: |-
574
+ ProxyConnectHeader optionally specifies headers to send to
575
+ proxies during CONNECT requests.
576
+
577
+
578
+ It requires Prometheus >= v2.43.0.
579
+ type: object
580
+ x-kubernetes-map-type: atomic
581
+ proxyFromEnvironment:
582
+ description: |-
583
+ Whether to use the proxy configuration defined by environment variables (HTTP_PROXY, HTTPS_PROXY, and NO_PROXY).
584
+ If unset, Prometheus uses its default value.
585
+
586
+
587
+ It requires Prometheus >= v2.43.0.
588
+ type: boolean
589
+ proxyUrl:
590
+ description: |-
591
+ `proxyURL` defines the HTTP proxy server to use.
592
+
593
+
594
+ It requires Prometheus >= v2.43.0.
595
+ pattern: ^http(s)?://.+$
596
+ type: string
597
+ scopes:
598
+ description: "`scopes` defines the OAuth2 scopes used for
599
+ the token request."
600
+ items:
601
+ type: string
602
+ type: array
603
+ tlsConfig:
604
+ description: |-
605
+ TLS configuration to use when connecting to the OAuth2 server.
606
+ It requires Prometheus >= v2.43.0.
607
+ properties:
608
+ ca:
609
+ description: Certificate authority used when verifying
610
+ server certificates.
611
+ properties:
612
+ configMap:
613
+ description: ConfigMap containing data to use for
614
+ the targets.
615
+ properties:
616
+ key:
617
+ description: The key to select.
618
+ type: string
619
+ name:
620
+ default: ""
621
+ description: |-
622
+ Name of the referent.
623
+ This field is effectively required, but due to backwards compatibility is
624
+ allowed to be empty. Instances of this type with an empty value here are
625
+ almost certainly wrong.
626
+ TODO: Add other useful fields. apiVersion, kind, uid?
627
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
628
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
629
+ type: string
630
+ optional:
631
+ description: Specify whether the ConfigMap or
632
+ its key must be defined
633
+ type: boolean
634
+ required:
635
+ - key
636
+ type: object
637
+ x-kubernetes-map-type: atomic
638
+ secret:
639
+ description: Secret containing data to use for the
640
+ targets.
641
+ properties:
642
+ key:
643
+ description: The key of the secret to select
644
+ from. Must be a valid secret key.
645
+ type: string
646
+ name:
647
+ default: ""
648
+ description: |-
649
+ Name of the referent.
650
+ This field is effectively required, but due to backwards compatibility is
651
+ allowed to be empty. Instances of this type with an empty value here are
652
+ almost certainly wrong.
653
+ TODO: Add other useful fields. apiVersion, kind, uid?
654
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
655
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
656
+ type: string
657
+ optional:
658
+ description: Specify whether the Secret or its
659
+ key must be defined
660
+ type: boolean
661
+ required:
662
+ - key
663
+ type: object
664
+ x-kubernetes-map-type: atomic
665
+ type: object
666
+ cert:
667
+ description: Client certificate to present when doing
668
+ client-authentication.
669
+ properties:
670
+ configMap:
671
+ description: ConfigMap containing data to use for
672
+ the targets.
673
+ properties:
674
+ key:
675
+ description: The key to select.
676
+ type: string
677
+ name:
678
+ default: ""
679
+ description: |-
680
+ Name of the referent.
681
+ This field is effectively required, but due to backwards compatibility is
682
+ allowed to be empty. Instances of this type with an empty value here are
683
+ almost certainly wrong.
684
+ TODO: Add other useful fields. apiVersion, kind, uid?
685
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
686
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
687
+ type: string
688
+ optional:
689
+ description: Specify whether the ConfigMap or
690
+ its key must be defined
691
+ type: boolean
692
+ required:
693
+ - key
694
+ type: object
695
+ x-kubernetes-map-type: atomic
696
+ secret:
697
+ description: Secret containing data to use for the
698
+ targets.
699
+ properties:
700
+ key:
701
+ description: The key of the secret to select
702
+ from. Must be a valid secret key.
703
+ type: string
704
+ name:
705
+ default: ""
706
+ description: |-
707
+ Name of the referent.
708
+ This field is effectively required, but due to backwards compatibility is
709
+ allowed to be empty. Instances of this type with an empty value here are
710
+ almost certainly wrong.
711
+ TODO: Add other useful fields. apiVersion, kind, uid?
712
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
713
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
714
+ type: string
715
+ optional:
716
+ description: Specify whether the Secret or its
717
+ key must be defined
718
+ type: boolean
719
+ required:
720
+ - key
721
+ type: object
722
+ x-kubernetes-map-type: atomic
723
+ type: object
724
+ insecureSkipVerify:
725
+ description: Disable target certificate validation.
726
+ type: boolean
727
+ keySecret:
728
+ description: Secret containing the client key file for
729
+ the targets.
730
+ properties:
731
+ key:
732
+ description: The key of the secret to select from. Must
733
+ be a valid secret key.
734
+ type: string
735
+ name:
736
+ default: ""
737
+ description: |-
738
+ Name of the referent.
739
+ This field is effectively required, but due to backwards compatibility is
740
+ allowed to be empty. Instances of this type with an empty value here are
741
+ almost certainly wrong.
742
+ TODO: Add other useful fields. apiVersion, kind, uid?
743
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
744
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
745
+ type: string
746
+ optional:
747
+ description: Specify whether the Secret or its key
748
+ must be defined
749
+ type: boolean
750
+ required:
751
+ - key
752
+ type: object
753
+ x-kubernetes-map-type: atomic
754
+ maxVersion:
755
+ description: |-
756
+ Maximum acceptable TLS version.
757
+
758
+
759
+ It requires Prometheus >= v2.41.0.
760
+ enum:
761
+ - TLS10
762
+ - TLS11
763
+ - TLS12
764
+ - TLS13
765
+ type: string
766
+ minVersion:
767
+ description: |-
768
+ Minimum acceptable TLS version.
769
+
770
+
771
+ It requires Prometheus >= v2.35.0.
772
+ enum:
773
+ - TLS10
774
+ - TLS11
775
+ - TLS12
776
+ - TLS13
777
+ type: string
778
+ serverName:
779
+ description: Used to verify the hostname for the targets.
780
+ type: string
781
+ type: object
782
+ tokenUrl:
783
+ description: "`tokenURL` configures the URL to fetch the
784
+ token from."
785
+ minLength: 1
786
+ type: string
787
+ required:
788
+ - clientId
789
+ - clientSecret
790
+ - tokenUrl
791
+ type: object
792
+ params:
793
+ additionalProperties:
794
+ items:
795
+ type: string
796
+ type: array
797
+ description: "`params` define optional HTTP URL parameters."
798
+ type: object
799
+ path:
800
+ description: |-
801
+ HTTP path from which to scrape for metrics.
802
+
803
+
804
+ If empty, Prometheus uses the default value (e.g. `/metrics`).
805
+ type: string
806
+ port:
807
+ description: |-
808
+ Name of the Pod port which this endpoint refers to.
809
+
810
+
811
+ It takes precedence over `targetPort`.
812
+ type: string
813
+ proxyUrl:
814
+ description: |-
815
+ `proxyURL` configures the HTTP Proxy URL (e.g.
816
+ "http://proxyserver:2195") to go through when scraping the target.
817
+ type: string
818
+ relabelings:
819
+ description: |-
820
+ `relabelings` configures the relabeling rules to apply the target's
821
+ metadata labels.
822
+
823
+
824
+ The Operator automatically adds relabelings for a few standard Kubernetes fields.
825
+
826
+
827
+ The original scrape job's name is available via the `__tmp_prometheus_job_name` label.
828
+
829
+
830
+ More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
831
+ items:
832
+ description: |-
833
+ RelabelConfig allows dynamic rewriting of the label set for targets, alerts,
834
+ scraped samples and remote write samples.
835
+
836
+
837
+ More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
838
+ properties:
839
+ action:
840
+ default: replace
841
+ description: |-
842
+ Action to perform based on the regex matching.
843
+
844
+
845
+ `Uppercase` and `Lowercase` actions require Prometheus >= v2.36.0.
846
+ `DropEqual` and `KeepEqual` actions require Prometheus >= v2.41.0.
847
+
848
+
849
+ Default: "Replace"
850
+ enum:
851
+ - replace
852
+ - Replace
853
+ - keep
854
+ - Keep
855
+ - drop
856
+ - Drop
857
+ - hashmod
858
+ - HashMod
859
+ - labelmap
860
+ - LabelMap
861
+ - labeldrop
862
+ - LabelDrop
863
+ - labelkeep
864
+ - LabelKeep
865
+ - lowercase
866
+ - Lowercase
867
+ - uppercase
868
+ - Uppercase
869
+ - keepequal
870
+ - KeepEqual
871
+ - dropequal
872
+ - DropEqual
873
+ type: string
874
+ modulus:
875
+ description: |-
876
+ Modulus to take of the hash of the source label values.
877
+
878
+
879
+ Only applicable when the action is `HashMod`.
880
+ format: int64
881
+ type: integer
882
+ regex:
883
+ description: Regular expression against which the extracted
884
+ value is matched.
885
+ type: string
886
+ replacement:
887
+ description: |-
888
+ Replacement value against which a Replace action is performed if the
889
+ regular expression matches.
890
+
891
+
892
+ Regex capture groups are available.
893
+ type: string
894
+ separator:
895
+ description: Separator is the string between concatenated
896
+ SourceLabels.
897
+ type: string
898
+ sourceLabels:
899
+ description: |-
900
+ The source labels select values from existing labels. Their content is
901
+ concatenated using the configured Separator and matched against the
902
+ configured regular expression.
903
+ items:
904
+ description: |-
905
+ LabelName is a valid Prometheus label name which may only contain ASCII
906
+ letters, numbers, as well as underscores.
907
+ pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
908
+ type: string
909
+ type: array
910
+ targetLabel:
911
+ description: |-
912
+ Label to which the resulting string is written in a replacement.
913
+
914
+
915
+ It is mandatory for `Replace`, `HashMod`, `Lowercase`, `Uppercase`,
916
+ `KeepEqual` and `DropEqual` actions.
917
+
918
+
919
+ Regex capture groups are available.
920
+ type: string
921
+ type: object
922
+ type: array
923
+ scheme:
924
+ description: |-
925
+ HTTP scheme to use for scraping.
926
+
927
+
928
+ `http` and `https` are the expected values unless you rewrite the
929
+ `__scheme__` label via relabeling.
930
+
931
+
932
+ If empty, Prometheus uses the default value `http`.
933
+ enum:
934
+ - http
935
+ - https
936
+ type: string
937
+ scrapeTimeout:
938
+ description: |-
939
+ Timeout after which Prometheus considers the scrape to be failed.
940
+
941
+
942
+ If empty, Prometheus uses the global scrape timeout unless it is less
943
+ than the target's scrape interval value in which the latter is used.
944
+ pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
945
+ type: string
946
+ targetPort:
947
+ anyOf:
948
+ - type: integer
949
+ - type: string
950
+ description: |-
951
+ Name or number of the target port of the `Pod` object behind the Service, the
952
+ port must be specified with container port property.
953
+
954
+
955
+ Deprecated: use 'port' instead.
956
+ x-kubernetes-int-or-string: true
957
+ tlsConfig:
958
+ description: TLS configuration to use when scraping the target.
959
+ properties:
960
+ ca:
961
+ description: Certificate authority used when verifying server
962
+ certificates.
963
+ properties:
964
+ configMap:
965
+ description: ConfigMap containing data to use for the
966
+ targets.
967
+ properties:
968
+ key:
969
+ description: The key to select.
970
+ type: string
971
+ name:
972
+ default: ""
973
+ description: |-
974
+ Name of the referent.
975
+ This field is effectively required, but due to backwards compatibility is
976
+ allowed to be empty. Instances of this type with an empty value here are
977
+ almost certainly wrong.
978
+ TODO: Add other useful fields. apiVersion, kind, uid?
979
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
980
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
981
+ type: string
982
+ optional:
983
+ description: Specify whether the ConfigMap or its
984
+ key must be defined
985
+ type: boolean
986
+ required:
987
+ - key
988
+ type: object
989
+ x-kubernetes-map-type: atomic
990
+ secret:
991
+ description: Secret containing data to use for the targets.
992
+ properties:
993
+ key:
994
+ description: The key of the secret to select from. Must
995
+ be a valid secret key.
996
+ type: string
997
+ name:
998
+ default: ""
999
+ description: |-
1000
+ Name of the referent.
1001
+ This field is effectively required, but due to backwards compatibility is
1002
+ allowed to be empty. Instances of this type with an empty value here are
1003
+ almost certainly wrong.
1004
+ TODO: Add other useful fields. apiVersion, kind, uid?
1005
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1006
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
1007
+ type: string
1008
+ optional:
1009
+ description: Specify whether the Secret or its key
1010
+ must be defined
1011
+ type: boolean
1012
+ required:
1013
+ - key
1014
+ type: object
1015
+ x-kubernetes-map-type: atomic
1016
+ type: object
1017
+ cert:
1018
+ description: Client certificate to present when doing client-authentication.
1019
+ properties:
1020
+ configMap:
1021
+ description: ConfigMap containing data to use for the
1022
+ targets.
1023
+ properties:
1024
+ key:
1025
+ description: The key to select.
1026
+ type: string
1027
+ name:
1028
+ default: ""
1029
+ description: |-
1030
+ Name of the referent.
1031
+ This field is effectively required, but due to backwards compatibility is
1032
+ allowed to be empty. Instances of this type with an empty value here are
1033
+ almost certainly wrong.
1034
+ TODO: Add other useful fields. apiVersion, kind, uid?
1035
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1036
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
1037
+ type: string
1038
+ optional:
1039
+ description: Specify whether the ConfigMap or its
1040
+ key must be defined
1041
+ type: boolean
1042
+ required:
1043
+ - key
1044
+ type: object
1045
+ x-kubernetes-map-type: atomic
1046
+ secret:
1047
+ description: Secret containing data to use for the targets.
1048
+ properties:
1049
+ key:
1050
+ description: The key of the secret to select from. Must
1051
+ be a valid secret key.
1052
+ type: string
1053
+ name:
1054
+ default: ""
1055
+ description: |-
1056
+ Name of the referent.
1057
+ This field is effectively required, but due to backwards compatibility is
1058
+ allowed to be empty. Instances of this type with an empty value here are
1059
+ almost certainly wrong.
1060
+ TODO: Add other useful fields. apiVersion, kind, uid?
1061
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1062
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
1063
+ type: string
1064
+ optional:
1065
+ description: Specify whether the Secret or its key
1066
+ must be defined
1067
+ type: boolean
1068
+ required:
1069
+ - key
1070
+ type: object
1071
+ x-kubernetes-map-type: atomic
1072
+ type: object
1073
+ insecureSkipVerify:
1074
+ description: Disable target certificate validation.
1075
+ type: boolean
1076
+ keySecret:
1077
+ description: Secret containing the client key file for the
1078
+ targets.
1079
+ properties:
1080
+ key:
1081
+ description: The key of the secret to select from. Must
1082
+ be a valid secret key.
1083
+ type: string
1084
+ name:
1085
+ default: ""
1086
+ description: |-
1087
+ Name of the referent.
1088
+ This field is effectively required, but due to backwards compatibility is
1089
+ allowed to be empty. Instances of this type with an empty value here are
1090
+ almost certainly wrong.
1091
+ TODO: Add other useful fields. apiVersion, kind, uid?
1092
+ More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1093
+ TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896.
1094
+ type: string
1095
+ optional:
1096
+ description: Specify whether the Secret or its key must
1097
+ be defined
1098
+ type: boolean
1099
+ required:
1100
+ - key
1101
+ type: object
1102
+ x-kubernetes-map-type: atomic
1103
+ maxVersion:
1104
+ description: |-
1105
+ Maximum acceptable TLS version.
1106
+
1107
+
1108
+ It requires Prometheus >= v2.41.0.
1109
+ enum:
1110
+ - TLS10
1111
+ - TLS11
1112
+ - TLS12
1113
+ - TLS13
1114
+ type: string
1115
+ minVersion:
1116
+ description: |-
1117
+ Minimum acceptable TLS version.
1118
+
1119
+
1120
+ It requires Prometheus >= v2.35.0.
1121
+ enum:
1122
+ - TLS10
1123
+ - TLS11
1124
+ - TLS12
1125
+ - TLS13
1126
+ type: string
1127
+ serverName:
1128
+ description: Used to verify the hostname for the targets.
1129
+ type: string
1130
+ type: object
1131
+ trackTimestampsStaleness:
1132
+ description: |-
1133
+ `trackTimestampsStaleness` defines whether Prometheus tracks staleness of
1134
+ the metrics that have an explicit timestamp present in scraped data.
1135
+ Has no effect if `honorTimestamps` is false.
1136
+
1137
+
1138
+ It requires Prometheus >= v2.48.0.
1139
+ type: boolean
1140
+ type: object
1141
+ type: array
1142
+ podTargetLabels:
1143
+ description: |-
1144
+ `podTargetLabels` defines the labels which are transferred from the
1145
+ associated Kubernetes `Pod` object onto the ingested metrics.
1146
+ items:
1147
+ type: string
1148
+ type: array
1149
+ sampleLimit:
1150
+ description: |-
1151
+ `sampleLimit` defines a per-scrape limit on the number of scraped samples
1152
+ that will be accepted.
1153
+ format: int64
1154
+ type: integer
1155
+ scrapeClass:
1156
+ description: The scrape class to apply.
1157
+ minLength: 1
1158
+ type: string
1159
+ scrapeProtocols:
1160
+ description: |-
1161
+ `scrapeProtocols` defines the protocols to negotiate during a scrape. It tells clients the
1162
+ protocols supported by Prometheus in order of preference (from most to least preferred).
1163
+
1164
+
1165
+ If unset, Prometheus uses its default value.
1166
+
1167
+
1168
+ It requires Prometheus >= v2.49.0.
1169
+ items:
1170
+ description: |-
1171
+ ScrapeProtocol represents a protocol used by Prometheus for scraping metrics.
1172
+ Supported values are:
1173
+ * `OpenMetricsText0.0.1`
1174
+ * `OpenMetricsText1.0.0`
1175
+ * `PrometheusProto`
1176
+ * `PrometheusText0.0.4`
1177
+ enum:
1178
+ - PrometheusProto
1179
+ - OpenMetricsText0.0.1
1180
+ - OpenMetricsText1.0.0
1181
+ - PrometheusText0.0.4
1182
+ type: string
1183
+ type: array
1184
+ x-kubernetes-list-type: set
1185
+ selector:
1186
+ description: Label selector to select the Kubernetes `Pod` objects
1187
+ to scrape metrics from.
1188
+ properties:
1189
+ matchExpressions:
1190
+ description: matchExpressions is a list of label selector requirements.
1191
+ The requirements are ANDed.
1192
+ items:
1193
+ description: |-
1194
+ A label selector requirement is a selector that contains values, a key, and an operator that
1195
+ relates the key and values.
1196
+ properties:
1197
+ key:
1198
+ description: key is the label key that the selector applies
1199
+ to.
1200
+ type: string
1201
+ operator:
1202
+ description: |-
1203
+ operator represents a key's relationship to a set of values.
1204
+ Valid operators are In, NotIn, Exists and DoesNotExist.
1205
+ type: string
1206
+ values:
1207
+ description: |-
1208
+ values is an array of string values. If the operator is In or NotIn,
1209
+ the values array must be non-empty. If the operator is Exists or DoesNotExist,
1210
+ the values array must be empty. This array is replaced during a strategic
1211
+ merge patch.
1212
+ items:
1213
+ type: string
1214
+ type: array
1215
+ x-kubernetes-list-type: atomic
1216
+ required:
1217
+ - key
1218
+ - operator
1219
+ type: object
1220
+ type: array
1221
+ x-kubernetes-list-type: atomic
1222
+ matchLabels:
1223
+ additionalProperties:
1224
+ type: string
1225
+ description: |-
1226
+ matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
1227
+ map is equivalent to an element of matchExpressions, whose key field is "key", the
1228
+ operator is "In", and the values array contains only "value". The requirements are ANDed.
1229
+ type: object
1230
+ type: object
1231
+ x-kubernetes-map-type: atomic
1232
+ targetLimit:
1233
+ description: |-
1234
+ `targetLimit` defines a limit on the number of scraped targets that will
1235
+ be accepted.
1236
+ format: int64
1237
+ type: integer
1238
+ required:
1239
+ - selector
1240
+ type: object
1241
+ required:
1242
+ - spec
1243
+ type: object
1244
+ served: true
1245
+ storage: true