kubernetes-fluent-client 3.0.3 → 4.0.0-rc-http2-watch

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