@@ -15,7 +15,7 @@ apiVersion: apiextensions.k8s.io/v1
1515kind : CustomResourceDefinition
1616metadata :
1717 annotations :
18- controller-gen.kubebuilder.io/version : v0.17.1
18+ controller-gen.kubebuilder.io/version : v0.17.1-0.20250103184936-50893dee96da
1919 name : clusterpodmonitorings.monitoring.googleapis.com
2020spec :
2121 group : monitoring.googleapis.com
9595 Type is the authentication type. Defaults to Bearer.
9696 Basic will cause an error, as the BasicAuth object should be used instead.
9797 type : string
98+ x-kubernetes-validations :
99+ - message : authorization type cannot be set to "basic",
100+ use "basic_auth" instead
101+ rule : self != 'Basic'
98102 type : object
99103 basicAuth :
100104 description : BasicAuth is the HTTP basic authentication credentials
@@ -132,7 +136,6 @@ spec:
132136 description : Interval at which to scrape metrics. Must be a
133137 valid Prometheus duration.
134138 format : duration
135- pattern : ^((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)$
136139 type : string
137140 metricRelabeling :
138141 description : |-
@@ -158,7 +161,6 @@ spec:
158161 - hashmod
159162 - labeldrop
160163 - labelkeep
161- format : relabel_action
162164 type : string
163165 modulus :
164166 description : Modulus to take of the hash of the source
@@ -168,7 +170,14 @@ spec:
168170 regex :
169171 description : Regular expression against which the extracted
170172 value is matched. Defaults to '(.*)'.
173+ maxLength : 100
171174 type : string
175+ x-kubernetes-validations :
176+ - rule : ' !'' project_id'' .matches(self) && !'' location'' .matches(self)
177+ && !'' cluster'' .matches(self) && !'' namespace'' .matches(self)
178+ && !'' instance'' .matches(self) && !'' top_level_controller'' .matches(self)
179+ && !'' top_level_controller_type'' .matches(self) &&
180+ !'' __address__'' .matches(self) && !'' cluster'' .matches(self)'
172181 replacement :
173182 description : |-
174183 Replacement value against which a regex replace is performed if the
@@ -184,18 +193,29 @@ spec:
184193 using the configured separator and matched against the configured regular expression
185194 for the replace, keep, and drop actions.
186195 items :
187- format : labelname
188- pattern : ' [a-zA-Z_][a-zA-Z0-9_]*'
196+ pattern : ^[a-zA-Z_][a-zA-Z0-9_]*$
189197 type : string
198+ maxItems : 100
190199 type : array
191200 targetLabel :
192201 description : |-
193202 Label to which the resulting value is written in a replace action.
194203 It is mandatory for replace actions. Regex capture groups are available.
195- format : labelname
196- pattern : ' [a-zA-Z_][a-zA-Z0-9_]*'
204+ pattern : ^[a-zA-Z_][a-zA-Z0-9_]*$
197205 type : string
206+ x-kubernetes-validations :
207+ - messageExpression : ' '' cannot relabel onto protected
208+ label "%s"'' .format([self])'
209+ rule : self != 'project_id' && self != 'location' &&
210+ self != 'cluster' && self != 'namespace' && self !=
211+ ' job' && self != 'instance' && self != 'top_level_controller'
212+ && self != 'top_level_controller_type' && self !=
213+ ' __address__'
198214 type : object
215+ x-kubernetes-validations :
216+ - rule : ' !has(self.action) || self.action != '' labeldrop''
217+ || has(self.regex)'
218+ maxItems : 50
199219 type : array
200220 oauth2 :
201221 description : OAuth2 is the OAuth2 client credentials used to
@@ -240,7 +260,10 @@ spec:
240260 ProxyURL is the HTTP proxy server to use to connect to the targets.
241261
242262 Encoded passwords are not supported.
263+ maxLength : 2000
243264 type : string
265+ x-kubernetes-validations :
266+ - rule : isURL(self) && !self.matches('@')
244267 scopes :
245268 description : Scopes represents the scopes for the token
246269 request.
@@ -337,6 +360,11 @@ spec:
337360
338361 If unset, Prometheus will use Go default minimum version, which is TLS 1.2.
339362 See MinVersion in https://pkg.go.dev/crypto/tls#Config.
363+ enum :
364+ - TLS10
365+ - TLS11
366+ - TLS12
367+ - TLS13
340368 type : string
341369 minVersion :
342370 description : |-
@@ -345,6 +373,11 @@ spec:
345373
346374 If unset, Prometheus will use Go default minimum version, which is TLS 1.2.
347375 See MinVersion in https://pkg.go.dev/crypto/tls#Config.
376+ enum :
377+ - TLS10
378+ - TLS11
379+ - TLS12
380+ - TLS13
348381 type : string
349382 serverName :
350383 description : ServerName is used to verify the hostname
@@ -377,13 +410,22 @@ spec:
377410 Name or number of the port to scrape.
378411 The container metadata label is only populated if the port is referenced by name
379412 because port numbers are not unique across containers.
413+ maxLength : 253
414+ minLength : 1
415+ pattern : ^[a-z0-9]([a-z0-9-]{0,251}[a-z0-9])?$
380416 x-kubernetes-int-or-string : true
417+ x-kubernetes-validations :
418+ - message : Port is required
419+ rule : self != 0
381420 proxyUrl :
382421 description : |-
383422 ProxyURL is the HTTP proxy server to use to connect to the targets.
384423
385424 Encoded passwords are not supported.
425+ maxLength : 2000
386426 type : string
427+ x-kubernetes-validations :
428+ - rule : isURL(self) && !self.matches('@')
387429 scheme :
388430 description : Protocol scheme to use to scrape.
389431 enum :
@@ -395,7 +437,6 @@ spec:
395437 Timeout for metrics scrapes. Must be a valid Prometheus duration.
396438 Must not be larger than the scrape interval.
397439 format : duration
398- pattern : ^((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)$
399440 type : string
400441 tls :
401442 description : TLS configures the scrape request's TLS settings.
@@ -487,6 +528,11 @@ spec:
487528
488529 If unset, Prometheus will use Go default minimum version, which is TLS 1.2.
489530 See MinVersion in https://pkg.go.dev/crypto/tls#Config.
531+ enum :
532+ - TLS10
533+ - TLS11
534+ - TLS12
535+ - TLS13
490536 type : string
491537 minVersion :
492538 description : |-
@@ -495,6 +541,11 @@ spec:
495541
496542 If unset, Prometheus will use Go default minimum version, which is TLS 1.2.
497543 See MinVersion in https://pkg.go.dev/crypto/tls#Config.
544+ enum :
545+ - TLS10
546+ - TLS11
547+ - TLS12
548+ - TLS13
498549 type : string
499550 serverName :
500551 description : ServerName is used to verify the hostname for
@@ -506,13 +557,16 @@ spec:
506557 when either is provided
507558 rule : has(self.cert) == has(self.key)
508559 required :
560+ - interval
509561 - port
510562 type : object
511563 x-kubernetes-validations :
512- - messageExpression : ' '' "scrape timeout " + self.timeout + "must
513- not be greater than scrape interval" + self.interval'' '
514- rule : ' !has(self.interval) || !has(self.timeout) || self.interval
515- <= self.timeout'
564+ - messageExpression : ' '' scrape timeout (%s) must not be greater
565+ than scrape interval (%s)'' .format([self.timeout, self.interval])'
566+ rule : ' !has(self.timeout) || self.timeout <= self.interval'
567+ - rule : ' ((has(self.authorization) ? 1 : 0) + (has(self.basicAuth)
568+ ? 1 : 0) + (has(self.oauth2) ? 1 : 0)) <= 1'
569+ maxItems : 100
516570 minItems : 1
517571 type : array
518572 filterRunning :
@@ -626,19 +680,25 @@ spec:
626680 properties :
627681 from :
628682 description : Kubernetes resource label to remap.
629- format : labelname
630- pattern : ' [a-zA-Z_][a-zA-Z0-9_]*'
683+ pattern : ^[a-zA-Z_][a-zA-Z0-9_]*$
631684 type : string
632685 to :
633686 description : |-
634687 Remapped Prometheus target label.
635688 Defaults to the same name as `From`.
636- format : labelname
637- pattern : ' [a-zA-Z_][a-zA-Z0-9_]*'
689+ pattern : ^[a-zA-Z_][a-zA-Z0-9_]*$
638690 type : string
691+ x-kubernetes-validations :
692+ - messageExpression : ' '' cannot relabel onto protected label
693+ "%s"'' .format([self])'
694+ rule : self != 'project_id' && self != 'location' && self
695+ != 'cluster' && self != 'namespace' && self != 'job'
696+ && self != 'instance' && self != 'top_level_controller'
697+ && self != 'top_level_controller_type' && self != '__address__'
639698 required :
640699 - from
641700 type : object
701+ maxItems : 100
642702 type : array
643703 metadata :
644704 description : |-
0 commit comments