Skip to content

Commit 071684a

Browse files
Merge pull request #2968 from czeslavo/1.18-bump-prom-operator-types
[v1.18] Update prometheus-operator types to a pre-v0.86.0 commit (6958a7c)
2 parents 59c0a65 + 7f42ee3 commit 071684a

16 files changed

+696
-49
lines changed

pkg/externalapi/monitoring/v1/alertmanager_types.go

Lines changed: 90 additions & 7 deletions
Large diffs are not rendered by default.

pkg/externalapi/monitoring/v1/dns_types.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ package v1
1818
type PodDNSConfig struct {
1919
// A list of DNS name server IP addresses.
2020
// This will be appended to the base nameservers generated from DNSPolicy.
21-
// +kubebuilder:validation:Optional
21+
// +optional
2222
// +listType:=set
2323
// +kubebuilder:validation:items:MinLength:=1
2424
Nameservers []string `json:"nameservers,omitempty"`
2525

2626
// A list of DNS search domains for host-name lookup.
2727
// This will be appended to the base search paths generated from DNSPolicy.
28-
// +kubebuilder:validation:Optional
28+
// +optional
2929
// +listType:=set
3030
// +kubebuilder:validation:items:MinLength:=1
3131
Searches []string `json:"searches,omitempty"`
@@ -34,7 +34,7 @@ type PodDNSConfig struct {
3434
// This will be merged with the base options generated from DNSPolicy.
3535
// Resolution options given in Options
3636
// will override those that appear in the base DNSPolicy.
37-
// +kubebuilder:validation:Optional
37+
// +optional
3838
// +listType=map
3939
// +listMapKey=name
4040
Options []PodDNSConfigOption `json:"options,omitempty"`
@@ -44,10 +44,11 @@ type PodDNSConfig struct {
4444
type PodDNSConfigOption struct {
4545
// Name is required and must be unique.
4646
// +kubebuilder:validation:MinLength=1
47+
// +required
4748
Name string `json:"name"`
4849

4950
// Value is optional.
50-
// +kubebuilder:validation:Optional
51+
// +optional
5152
Value *string `json:"value,omitempty"`
5253
}
5354

pkg/externalapi/monitoring/v1/monitoring.coreos.com_alertmanagers.yaml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4143,6 +4143,15 @@ spec:
41434143
x-kubernetes-list-map-keys:
41444144
- ip
41454145
x-kubernetes-list-type: map
4146+
hostUsers:
4147+
description: |-
4148+
HostUsers supports the user space in Kubernetes.
4149+
4150+
More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/
4151+
4152+
The feature requires at least Kubernetes 1.28 with the `UserNamespacesSupport` feature gate enabled.
4153+
Starting Kubernetes 1.33, the feature is enabled by default.
4154+
type: boolean
41464155
image:
41474156
description: |-
41484157
Image if specified has precedence over baseImage, tag and sha
@@ -5607,9 +5616,10 @@ spec:
56075616
description: |-
56085617
Minimum number of seconds for which a newly created pod should be ready
56095618
without any of its container crashing for it to be considered available.
5610-
Defaults to 0 (pod will be considered available as soon as it is ready)
5611-
This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
5619+
5620+
If unset, pods will be considered available as soon as they are ready.
56125621
format: int32
5622+
minimum: 0
56135623
type: integer
56145624
nodeSelector:
56155625
additionalProperties:
@@ -5619,7 +5629,7 @@ spec:
56195629
paused:
56205630
description: |-
56215631
If set to true all actions on the underlying managed objects are not
5622-
goint to be performed, except for delete actions.
5632+
going to be performed, except for delete actions.
56235633
type: boolean
56245634
persistentVolumeClaimRetentionPolicy:
56255635
description: |-

pkg/externalapi/monitoring/v1/monitoring.coreos.com_podmonitors.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,8 @@ spec:
11011101
description: |-
11021102
Whether to scrape a classic histogram that is also exposed as a native histogram.
11031103
It requires Prometheus >= v2.45.0.
1104+
1105+
Notice: `scrapeClassicHistograms` corresponds to the `always_scrape_classic_histograms` field in the Prometheus configuration.
11041106
type: boolean
11051107
scrapeProtocols:
11061108
description: |-

pkg/externalapi/monitoring/v1/monitoring.coreos.com_probes.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,33 @@ spec:
623623
- clientSecret
624624
- tokenUrl
625625
type: object
626+
params:
627+
description: |-
628+
The list of HTTP query parameters for the scrape.
629+
Please note that the `.spec.module` field takes precedence over the `module` parameter from this list when both are defined.
630+
The module name must be added using Module under ProbeSpec.
631+
items:
632+
description: ProbeParam defines specification of extra parameters for a Probe.
633+
properties:
634+
name:
635+
description: The parameter name
636+
minLength: 1
637+
type: string
638+
values:
639+
description: The parameter values
640+
items:
641+
minLength: 1
642+
type: string
643+
minItems: 1
644+
type: array
645+
required:
646+
- name
647+
type: object
648+
minItems: 1
649+
type: array
650+
x-kubernetes-list-map-keys:
651+
- name
652+
x-kubernetes-list-type: map
626653
prober:
627654
description: |-
628655
Specification for the prober to use for probing targets.
@@ -711,6 +738,8 @@ spec:
711738
description: |-
712739
Whether to scrape a classic histogram that is also exposed as a native histogram.
713740
It requires Prometheus >= v2.45.0.
741+
742+
Notice: `scrapeClassicHistograms` corresponds to the `always_scrape_classic_histograms` field in the Prometheus configuration.
714743
type: boolean
715744
scrapeProtocols:
716745
description: |-

pkg/externalapi/monitoring/v1/monitoring.coreos.com_prometheuses.yaml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3825,6 +3825,15 @@ spec:
38253825
`ClusterFirstWithHostNet` automatically (unless `.spec.DNSPolicy` is set
38263826
to a different value).
38273827
type: boolean
3828+
hostUsers:
3829+
description: |-
3830+
HostUsers supports the user space in Kubernetes.
3831+
3832+
More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/
3833+
3834+
The feature requires at least Kubernetes 1.28 with the `UserNamespacesSupport` feature gate enabled.
3835+
Starting Kubernetes 1.33, the feature is enabled by default.
3836+
type: boolean
38283837
ignoreNamespaceSelectors:
38293838
description: |-
38303839
When true, `spec.namespaceSelector` from all PodMonitor, ServiceMonitor
@@ -5332,11 +5341,10 @@ spec:
53325341
description: |-
53335342
Minimum number of seconds for which a newly created Pod should be ready
53345343
without any of its container crashing for it to be considered available.
5335-
Defaults to 0 (pod will be considered available as soon as it is ready)
53365344

5337-
This is an alpha field from kubernetes 1.22 until 1.24 which requires
5338-
enabling the StatefulSetMinReadySeconds feature gate.
5345+
If unset, pods will be considered available as soon as they are ready.
53395346
format: int32
5347+
minimum: 0
53405348
type: integer
53415349
nameEscapingScheme:
53425350
description: |-
@@ -5375,15 +5383,36 @@ spec:
53755383
Configures optional translation of OTLP explicit bucket histograms into native histograms with custom buckets.
53765384
It requires Prometheus >= v3.4.0.
53775385
type: boolean
5386+
ignoreResourceAttributes:
5387+
description: |-
5388+
List of OpenTelemetry resource attributes to ignore when `promoteAllResourceAttributes` is true.
5389+
5390+
It requires `promoteAllResourceAttributes` to be true.
5391+
It requires Prometheus >= v3.5.0.
5392+
items:
5393+
minLength: 1
5394+
type: string
5395+
minItems: 1
5396+
type: array
5397+
x-kubernetes-list-type: set
53785398
keepIdentifyingResourceAttributes:
53795399
description: |-
53805400
Enables adding `service.name`, `service.namespace` and `service.instance.id`
53815401
resource attributes to the `target_info` metric, on top of converting them into the `instance` and `job` labels.
53825402

53835403
It requires Prometheus >= v3.1.0.
53845404
type: boolean
5405+
promoteAllResourceAttributes:
5406+
description: |-
5407+
Promote all resource attributes to metric labels except the ones defined in `ignoreResourceAttributes`.
5408+
5409+
Cannot be true when `promoteResourceAttributes` is defined.
5410+
It requires Prometheus >= v3.5.0.
5411+
type: boolean
53855412
promoteResourceAttributes:
5386-
description: List of OpenTelemetry Attributes that should be promoted to metric labels, defaults to none.
5413+
description: |-
5414+
List of OpenTelemetry Attributes that should be promoted to metric labels, defaults to none.
5415+
Cannot be defined when `promoteAllResourceAttributes` is true.
53875416
items:
53885417
minLength: 1
53895418
type: string
@@ -8182,6 +8211,9 @@ spec:
81828211
scrapeClassicHistograms:
81838212
description: |-
81848213
Whether to scrape a classic histogram that is also exposed as a native histogram.
8214+
8215+
Notice: `scrapeClassicHistograms` corresponds to the `always_scrape_classic_histograms` field in the Prometheus configuration.
8216+
81858217
It requires Prometheus >= v3.5.0.
81868218
type: boolean
81878219
scrapeConfigNamespaceSelector:

pkg/externalapi/monitoring/v1/monitoring.coreos.com_servicemonitors.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,8 @@ spec:
11131113
description: |-
11141114
Whether to scrape a classic histogram that is also exposed as a native histogram.
11151115
It requires Prometheus >= v2.45.0.
1116+
1117+
Notice: `scrapeClassicHistograms` corresponds to the `always_scrape_classic_histograms` field in the Prometheus configuration.
11161118
type: boolean
11171119
scrapeProtocols:
11181120
description: |-
@@ -1297,6 +1299,12 @@ spec:
12971299
- resource
12981300
type: object
12991301
type: array
1302+
x-kubernetes-list-map-keys:
1303+
- group
1304+
- resource
1305+
- name
1306+
- namespace
1307+
x-kubernetes-list-type: map
13001308
type: object
13011309
required:
13021310
- spec

pkg/externalapi/monitoring/v1/monitoring.coreos.com_thanosrulers.yaml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,6 +2504,22 @@ spec:
25042504
- Default
25052505
- None
25062506
type: string
2507+
enableFeatures:
2508+
description: |-
2509+
Enable access to Thanos Ruler feature flags. By default, no features are enabled.
2510+
2511+
Enabling features which are disabled by default is entirely outside the
2512+
scope of what the maintainers will support and by doing so, you accept
2513+
that this behaviour may break at any time without notice.
2514+
2515+
For more information see https://thanos.io/tip/components/rule.md/
2516+
2517+
It requires Thanos >= 0.39.0.
2518+
items:
2519+
minLength: 1
2520+
type: string
2521+
type: array
2522+
x-kubernetes-list-type: set
25072523
enableServiceLinks:
25082524
description: Indicates whether information about services should be injected into pod's environment variables
25092525
type: boolean
@@ -2747,6 +2763,15 @@ spec:
27472763
x-kubernetes-list-map-keys:
27482764
- ip
27492765
x-kubernetes-list-type: map
2766+
hostUsers:
2767+
description: |-
2768+
HostUsers supports the user space in Kubernetes.
2769+
2770+
More info: https://kubernetes.io/docs/tasks/configure-pod-container/user-namespaces/
2771+
2772+
The feature requires at least Kubernetes 1.28 with the `UserNamespacesSupport` feature gate enabled.
2773+
Starting Kubernetes 1.33, the feature is enabled by default.
2774+
type: boolean
27502775
image:
27512776
description: Thanos container image URL.
27522777
type: string
@@ -4194,9 +4219,10 @@ spec:
41944219
description: |-
41954220
Minimum number of seconds for which a newly created pod should be ready
41964221
without any of its container crashing for it to be considered available.
4197-
Defaults to 0 (pod will be considered available as soon as it is ready)
4198-
This is an alpha field from kubernetes 1.22 until 1.24 which requires enabling the StatefulSetMinReadySeconds feature gate.
4222+
4223+
If unset, pods will be considered available as soon as they are ready.
41994224
format: int32
4225+
minimum: 0
42004226
type: integer
42014227
nodeSelector:
42024228
additionalProperties:
@@ -5383,6 +5409,10 @@ spec:
53835409
description: Number of thanos ruler instances to deploy.
53845410
format: int32
53855411
type: integer
5412+
resendDelay:
5413+
description: Minimum amount of time to wait before resending an alert to Alertmanager.
5414+
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
5415+
type: string
53865416
resources:
53875417
description: |-
53885418
Resources defines the resource requirements for single Pods.
@@ -5465,6 +5495,13 @@ spec:
54655495
format: int32
54665496
minimum: 1
54675497
type: integer
5498+
ruleGracePeriod:
5499+
description: |-
5500+
Minimum duration between alert and restored "for" state.
5501+
This is maintained only for alerts with configured "for" time greater than grace period.
5502+
It requires Thanos >= v0.30.0.
5503+
pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
5504+
type: string
54685505
ruleNamespaceSelector:
54695506
description: |-
54705507
Namespaces to be selected for Rules discovery. If unspecified, only

pkg/externalapi/monitoring/v1/podmonitor_types.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ const (
4040
//
4141
// `Prometheus` and `PrometheusAgent` objects select `PodMonitor` objects using label and namespace selectors.
4242
type PodMonitor struct {
43-
metav1.TypeMeta `json:",inline"`
43+
metav1.TypeMeta `json:",inline"`
44+
// +optional
4445
metav1.ObjectMeta `json:"metadata,omitempty"`
4546
// Specification of desired Pod selection for target discovery by Prometheus.
47+
// +required
4648
Spec PodMonitorSpec `json:"spec"`
4749
}
4850

@@ -64,11 +66,13 @@ type PodMonitorSpec struct {
6466
//
6567
// If the value of this field is empty, the `job` label of the metrics
6668
// defaults to the namespace and name of the PodMonitor object (e.g. `<namespace>/<name>`).
69+
// +optional
6770
JobLabel string `json:"jobLabel,omitempty"`
6871

6972
// `podTargetLabels` defines the labels which are transferred from the
7073
// associated Kubernetes `Pod` object onto the ingested metrics.
7174
//
75+
// +optional
7276
PodTargetLabels []string `json:"podTargetLabels,omitempty"`
7377

7478
// Defines how to scrape metrics from the selected pods.
@@ -77,6 +81,7 @@ type PodMonitorSpec struct {
7781
PodMetricsEndpoints []PodMetricsEndpoint `json:"podMetricsEndpoints"`
7882

7983
// Label selector to select the Kubernetes `Pod` objects to scrape metrics from.
84+
// +required
8085
Selector metav1.LabelSelector `json:"selector"`
8186

8287
// Mechanism used to select the endpoints to scrape.
@@ -91,6 +96,7 @@ type PodMonitorSpec struct {
9196

9297
// `namespaceSelector` defines in which namespace(s) Prometheus should discover the pods.
9398
// 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.
99+
// +optional
94100
NamespaceSelector NamespaceSelector `json:"namespaceSelector,omitempty"`
95101

96102
// `sampleLimit` defines a per-scrape limit on the number of scraped samples
@@ -210,11 +216,13 @@ type PodMetricsEndpoint struct {
210216
// port must be specified with container port property.
211217
//
212218
// Deprecated: use 'port' or 'portNumber' instead.
219+
// +optional
213220
TargetPort *apimachineryutilintstr.IntOrString `json:"targetPort,omitempty"`
214221

215222
// HTTP path from which to scrape for metrics.
216223
//
217224
// If empty, Prometheus uses the default value (e.g. `/metrics`).
225+
// +optional
218226
Path string `json:"path,omitempty"`
219227

220228
// HTTP scheme to use for scraping.
@@ -225,21 +233,25 @@ type PodMetricsEndpoint struct {
225233
// If empty, Prometheus uses the default value `http`.
226234
//
227235
// +kubebuilder:validation:Enum=http;https
236+
// +optional
228237
Scheme string `json:"scheme,omitempty"`
229238

230239
// `params` define optional HTTP URL parameters.
240+
// +optional
231241
Params map[string][]string `json:"params,omitempty"`
232242

233243
// Interval at which Prometheus scrapes the metrics from the target.
234244
//
235245
// If empty, Prometheus uses the global scrape interval.
246+
// +optional
236247
Interval Duration `json:"interval,omitempty"`
237248

238249
// Timeout after which Prometheus considers the scrape to be failed.
239250
//
240251
// If empty, Prometheus uses the global scrape timeout unless it is less
241252
// than the target's scrape interval value in which the latter is used.
242253
// The value cannot be greater than the scrape interval otherwise the operator will reject the resource.
254+
// +optional
243255
ScrapeTimeout Duration `json:"scrapeTimeout,omitempty"`
244256

245257
// TLS configuration to use when scraping the target.
@@ -258,6 +270,7 @@ type PodMetricsEndpoint struct {
258270

259271
// When true, `honorLabels` preserves the metric's labels when they collide
260272
// with the target's labels.
273+
// +optional
261274
HonorLabels bool `json:"honorLabels,omitempty"`
262275

263276
// `honorTimestamps` controls whether Prometheus preserves the timestamps

0 commit comments

Comments
 (0)