/ abyss / crds / monitoring.coreos.com_servicemonitors.yaml
monitoring.coreos.com_servicemonitors.yaml
  1  ---
  2  apiVersion: apiextensions.k8s.io/v1
  3  kind: CustomResourceDefinition
  4  metadata:
  5    annotations:
  6      controller-gen.kubebuilder.io/version: v0.9.2
  7    creationTimestamp: null
  8    name: servicemonitors.monitoring.coreos.com
  9  spec:
 10    group: monitoring.coreos.com
 11    names:
 12      categories:
 13      - prometheus-operator
 14      kind: ServiceMonitor
 15      listKind: ServiceMonitorList
 16      plural: servicemonitors
 17      shortNames:
 18      - smon
 19      singular: servicemonitor
 20    scope: Namespaced
 21    versions:
 22    - name: v1
 23      schema:
 24        openAPIV3Schema:
 25          description: ServiceMonitor defines monitoring for a set of services.
 26          properties:
 27            apiVersion:
 28              description: 'APIVersion defines the versioned schema of this representation
 29                of an object. Servers should convert recognized schemas to the latest
 30                internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
 31              type: string
 32            kind:
 33              description: 'Kind is a string value representing the REST resource this
 34                object represents. Servers may infer this from the endpoint the client
 35                submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
 36              type: string
 37            metadata:
 38              type: object
 39            spec:
 40              description: Specification of desired Service selection for target discovery
 41                by Prometheus.
 42              properties:
 43                attachMetadata:
 44                  description: Attaches node metadata to discovered targets. Requires
 45                    Prometheus v2.37.0 and above.
 46                  properties:
 47                    node:
 48                      description: When set to true, Prometheus must have permissions
 49                        to get Nodes.
 50                      type: boolean
 51                  type: object
 52                endpoints:
 53                  description: A list of endpoints allowed as part of this ServiceMonitor.
 54                  items:
 55                    description: Endpoint defines a scrapeable endpoint serving Prometheus
 56                      metrics.
 57                    properties:
 58                      authorization:
 59                        description: Authorization section for this endpoint
 60                        properties:
 61                          credentials:
 62                            description: The secret's key that contains the credentials
 63                              of the request
 64                            properties:
 65                              key:
 66                                description: The key of the secret to select from.  Must
 67                                  be a valid secret key.
 68                                type: string
 69                              name:
 70                                description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
 71                                  TODO: Add other useful fields. apiVersion, kind, uid?'
 72                                type: string
 73                              optional:
 74                                description: Specify whether the Secret or its key must
 75                                  be defined
 76                                type: boolean
 77                            required:
 78                            - key
 79                            type: object
 80                            x-kubernetes-map-type: atomic
 81                          type:
 82                            description: Set the authentication type. Defaults to Bearer,
 83                              Basic will cause an error
 84                            type: string
 85                        type: object
 86                      basicAuth:
 87                        description: 'BasicAuth allow an endpoint to authenticate over
 88                          basic authentication More info: https://prometheus.io/docs/operating/configuration/#endpoints'
 89                        properties:
 90                          password:
 91                            description: The secret in the service monitor namespace
 92                              that contains the password for authentication.
 93                            properties:
 94                              key:
 95                                description: The key of the secret to select from.  Must
 96                                  be a valid secret key.
 97                                type: string
 98                              name:
 99                                description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
100                                  TODO: Add other useful fields. apiVersion, kind, uid?'
101                                type: string
102                              optional:
103                                description: Specify whether the Secret or its key must
104                                  be defined
105                                type: boolean
106                            required:
107                            - key
108                            type: object
109                            x-kubernetes-map-type: atomic
110                          username:
111                            description: The secret in the service monitor namespace
112                              that contains the username for authentication.
113                            properties:
114                              key:
115                                description: The key of the secret to select from.  Must
116                                  be a valid secret key.
117                                type: string
118                              name:
119                                description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
120                                  TODO: Add other useful fields. apiVersion, kind, uid?'
121                                type: string
122                              optional:
123                                description: Specify whether the Secret or its key must
124                                  be defined
125                                type: boolean
126                            required:
127                            - key
128                            type: object
129                            x-kubernetes-map-type: atomic
130                        type: object
131                      bearerTokenFile:
132                        description: File to read bearer token for scraping targets.
133                        type: string
134                      bearerTokenSecret:
135                        description: Secret to mount to read bearer token for scraping
136                          targets. The secret needs to be in the same namespace as the
137                          service monitor and accessible by the Prometheus Operator.
138                        properties:
139                          key:
140                            description: The key of the secret to select from.  Must
141                              be a valid secret key.
142                            type: string
143                          name:
144                            description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
145                              TODO: Add other useful fields. apiVersion, kind, uid?'
146                            type: string
147                          optional:
148                            description: Specify whether the Secret or its key must
149                              be defined
150                            type: boolean
151                        required:
152                        - key
153                        type: object
154                        x-kubernetes-map-type: atomic
155                      enableHttp2:
156                        description: Whether to enable HTTP2.
157                        type: boolean
158                      filterRunning:
159                        description: 'Drop pods that are not running. (Failed, Succeeded).
160                          Enabled by default. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase'
161                        type: boolean
162                      followRedirects:
163                        description: FollowRedirects configures whether scrape requests
164                          follow HTTP 3xx redirects.
165                        type: boolean
166                      honorLabels:
167                        description: HonorLabels chooses the metric's labels on collisions
168                          with target labels.
169                        type: boolean
170                      honorTimestamps:
171                        description: HonorTimestamps controls whether Prometheus respects
172                          the timestamps present in scraped data.
173                        type: boolean
174                      interval:
175                        description: Interval at which metrics should be scraped If
176                          not specified Prometheus' global scrape interval is used.
177                        pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
178                        type: string
179                      metricRelabelings:
180                        description: MetricRelabelConfigs to apply to samples before
181                          ingestion.
182                        items:
183                          description: 'RelabelConfig allows dynamic rewriting of the
184                            label set, being applied to samples before ingestion. It
185                            defines `<metric_relabel_configs>`-section of Prometheus
186                            configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
187                          properties:
188                            action:
189                              default: replace
190                              description: Action to perform based on regex matching.
191                                Default is 'replace'. uppercase and lowercase actions
192                                require Prometheus >= 2.36.
193                              enum:
194                              - replace
195                              - Replace
196                              - keep
197                              - Keep
198                              - drop
199                              - Drop
200                              - hashmod
201                              - HashMod
202                              - labelmap
203                              - LabelMap
204                              - labeldrop
205                              - LabelDrop
206                              - labelkeep
207                              - LabelKeep
208                              - lowercase
209                              - Lowercase
210                              - uppercase
211                              - Uppercase
212                              - keepequal
213                              - KeepEqual
214                              - dropequal
215                              - DropEqual
216                              type: string
217                            modulus:
218                              description: Modulus to take of the hash of the source
219                                label values.
220                              format: int64
221                              type: integer
222                            regex:
223                              description: Regular expression against which the extracted
224                                value is matched. Default is '(.*)'
225                              type: string
226                            replacement:
227                              description: Replacement value against which a regex replace
228                                is performed if the regular expression matches. Regex
229                                capture groups are available. Default is '$1'
230                              type: string
231                            separator:
232                              description: Separator placed between concatenated source
233                                label values. default is ';'.
234                              type: string
235                            sourceLabels:
236                              description: The source labels select values from existing
237                                labels. Their content is concatenated using the configured
238                                separator and matched against the configured regular
239                                expression for the replace, keep, and drop actions.
240                              items:
241                                description: LabelName is a valid Prometheus label name
242                                  which may only contain ASCII letters, numbers, as
243                                  well as underscores.
244                                pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
245                                type: string
246                              type: array
247                            targetLabel:
248                              description: Label to which the resulting value is written
249                                in a replace action. It is mandatory for replace actions.
250                                Regex capture groups are available.
251                              type: string
252                          type: object
253                        type: array
254                      oauth2:
255                        description: OAuth2 for the URL. Only valid in Prometheus versions
256                          2.27.0 and newer.
257                        properties:
258                          clientId:
259                            description: The secret or configmap containing the OAuth2
260                              client id
261                            properties:
262                              configMap:
263                                description: ConfigMap containing data to use for the
264                                  targets.
265                                properties:
266                                  key:
267                                    description: The key to select.
268                                    type: string
269                                  name:
270                                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
271                                      TODO: Add other useful fields. apiVersion, kind,
272                                      uid?'
273                                    type: string
274                                  optional:
275                                    description: Specify whether the ConfigMap or its
276                                      key must be defined
277                                    type: boolean
278                                required:
279                                - key
280                                type: object
281                                x-kubernetes-map-type: atomic
282                              secret:
283                                description: Secret containing data to use for the targets.
284                                properties:
285                                  key:
286                                    description: The key of the secret to select from.  Must
287                                      be a valid secret key.
288                                    type: string
289                                  name:
290                                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
291                                      TODO: Add other useful fields. apiVersion, kind,
292                                      uid?'
293                                    type: string
294                                  optional:
295                                    description: Specify whether the Secret or its key
296                                      must be defined
297                                    type: boolean
298                                required:
299                                - key
300                                type: object
301                                x-kubernetes-map-type: atomic
302                            type: object
303                          clientSecret:
304                            description: The secret containing the OAuth2 client secret
305                            properties:
306                              key:
307                                description: The key of the secret to select from.  Must
308                                  be a valid secret key.
309                                type: string
310                              name:
311                                description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
312                                  TODO: Add other useful fields. apiVersion, kind, uid?'
313                                type: string
314                              optional:
315                                description: Specify whether the Secret or its key must
316                                  be defined
317                                type: boolean
318                            required:
319                            - key
320                            type: object
321                            x-kubernetes-map-type: atomic
322                          endpointParams:
323                            additionalProperties:
324                              type: string
325                            description: Parameters to append to the token URL
326                            type: object
327                          scopes:
328                            description: OAuth2 scopes used for the token request
329                            items:
330                              type: string
331                            type: array
332                          tokenUrl:
333                            description: The URL to fetch the token from
334                            minLength: 1
335                            type: string
336                        required:
337                        - clientId
338                        - clientSecret
339                        - tokenUrl
340                        type: object
341                      params:
342                        additionalProperties:
343                          items:
344                            type: string
345                          type: array
346                        description: Optional HTTP URL parameters
347                        type: object
348                      path:
349                        description: HTTP path to scrape for metrics. If empty, Prometheus
350                          uses the default value (e.g. `/metrics`).
351                        type: string
352                      port:
353                        description: Name of the service port this endpoint refers to.
354                          Mutually exclusive with targetPort.
355                        type: string
356                      proxyUrl:
357                        description: ProxyURL eg http://proxyserver:2195 Directs scrapes
358                          to proxy through this endpoint.
359                        type: string
360                      relabelings:
361                        description: 'RelabelConfigs to apply to samples before scraping.
362                          Prometheus Operator automatically adds relabelings for a few
363                          standard Kubernetes fields. The original scrape job''s name
364                          is available via the `__tmp_prometheus_job_name` label. More
365                          info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config'
366                        items:
367                          description: 'RelabelConfig allows dynamic rewriting of the
368                            label set, being applied to samples before ingestion. It
369                            defines `<metric_relabel_configs>`-section of Prometheus
370                            configuration. More info: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs'
371                          properties:
372                            action:
373                              default: replace
374                              description: Action to perform based on regex matching.
375                                Default is 'replace'. uppercase and lowercase actions
376                                require Prometheus >= 2.36.
377                              enum:
378                              - replace
379                              - Replace
380                              - keep
381                              - Keep
382                              - drop
383                              - Drop
384                              - hashmod
385                              - HashMod
386                              - labelmap
387                              - LabelMap
388                              - labeldrop
389                              - LabelDrop
390                              - labelkeep
391                              - LabelKeep
392                              - lowercase
393                              - Lowercase
394                              - uppercase
395                              - Uppercase
396                              - keepequal
397                              - KeepEqual
398                              - dropequal
399                              - DropEqual
400                              type: string
401                            modulus:
402                              description: Modulus to take of the hash of the source
403                                label values.
404                              format: int64
405                              type: integer
406                            regex:
407                              description: Regular expression against which the extracted
408                                value is matched. Default is '(.*)'
409                              type: string
410                            replacement:
411                              description: Replacement value against which a regex replace
412                                is performed if the regular expression matches. Regex
413                                capture groups are available. Default is '$1'
414                              type: string
415                            separator:
416                              description: Separator placed between concatenated source
417                                label values. default is ';'.
418                              type: string
419                            sourceLabels:
420                              description: The source labels select values from existing
421                                labels. Their content is concatenated using the configured
422                                separator and matched against the configured regular
423                                expression for the replace, keep, and drop actions.
424                              items:
425                                description: LabelName is a valid Prometheus label name
426                                  which may only contain ASCII letters, numbers, as
427                                  well as underscores.
428                                pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
429                                type: string
430                              type: array
431                            targetLabel:
432                              description: Label to which the resulting value is written
433                                in a replace action. It is mandatory for replace actions.
434                                Regex capture groups are available.
435                              type: string
436                          type: object
437                        type: array
438                      scheme:
439                        description: HTTP scheme to use for scraping. `http` and `https`
440                          are the expected values unless you rewrite the `__scheme__`
441                          label via relabeling. If empty, Prometheus uses the default
442                          value `http`.
443                        enum:
444                        - http
445                        - https
446                        type: string
447                      scrapeTimeout:
448                        description: Timeout after which the scrape is ended If not
449                          specified, the Prometheus global scrape timeout is used unless
450                          it is less than `Interval` in which the latter is used.
451                        pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
452                        type: string
453                      targetPort:
454                        anyOf:
455                        - type: integer
456                        - type: string
457                        description: Name or number of the target port of the Pod behind
458                          the Service, the port must be specified with container port
459                          property. Mutually exclusive with port.
460                        x-kubernetes-int-or-string: true
461                      tlsConfig:
462                        description: TLS configuration to use when scraping the endpoint
463                        properties:
464                          ca:
465                            description: Certificate authority used when verifying server
466                              certificates.
467                            properties:
468                              configMap:
469                                description: ConfigMap containing data to use for the
470                                  targets.
471                                properties:
472                                  key:
473                                    description: The key to select.
474                                    type: string
475                                  name:
476                                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
477                                      TODO: Add other useful fields. apiVersion, kind,
478                                      uid?'
479                                    type: string
480                                  optional:
481                                    description: Specify whether the ConfigMap or its
482                                      key must be defined
483                                    type: boolean
484                                required:
485                                - key
486                                type: object
487                                x-kubernetes-map-type: atomic
488                              secret:
489                                description: Secret containing data to use for the targets.
490                                properties:
491                                  key:
492                                    description: The key of the secret to select from.  Must
493                                      be a valid secret key.
494                                    type: string
495                                  name:
496                                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
497                                      TODO: Add other useful fields. apiVersion, kind,
498                                      uid?'
499                                    type: string
500                                  optional:
501                                    description: Specify whether the Secret or its key
502                                      must be defined
503                                    type: boolean
504                                required:
505                                - key
506                                type: object
507                                x-kubernetes-map-type: atomic
508                            type: object
509                          caFile:
510                            description: Path to the CA cert in the Prometheus container
511                              to use for the targets.
512                            type: string
513                          cert:
514                            description: Client certificate to present when doing client-authentication.
515                            properties:
516                              configMap:
517                                description: ConfigMap containing data to use for the
518                                  targets.
519                                properties:
520                                  key:
521                                    description: The key to select.
522                                    type: string
523                                  name:
524                                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
525                                      TODO: Add other useful fields. apiVersion, kind,
526                                      uid?'
527                                    type: string
528                                  optional:
529                                    description: Specify whether the ConfigMap or its
530                                      key must be defined
531                                    type: boolean
532                                required:
533                                - key
534                                type: object
535                                x-kubernetes-map-type: atomic
536                              secret:
537                                description: Secret containing data to use for the targets.
538                                properties:
539                                  key:
540                                    description: The key of the secret to select from.  Must
541                                      be a valid secret key.
542                                    type: string
543                                  name:
544                                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
545                                      TODO: Add other useful fields. apiVersion, kind,
546                                      uid?'
547                                    type: string
548                                  optional:
549                                    description: Specify whether the Secret or its key
550                                      must be defined
551                                    type: boolean
552                                required:
553                                - key
554                                type: object
555                                x-kubernetes-map-type: atomic
556                            type: object
557                          certFile:
558                            description: Path to the client cert file in the Prometheus
559                              container for the targets.
560                            type: string
561                          insecureSkipVerify:
562                            description: Disable target certificate validation.
563                            type: boolean
564                          keyFile:
565                            description: Path to the client key file in the Prometheus
566                              container for the targets.
567                            type: string
568                          keySecret:
569                            description: Secret containing the client key file for the
570                              targets.
571                            properties:
572                              key:
573                                description: The key of the secret to select from.  Must
574                                  be a valid secret key.
575                                type: string
576                              name:
577                                description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
578                                  TODO: Add other useful fields. apiVersion, kind, uid?'
579                                type: string
580                              optional:
581                                description: Specify whether the Secret or its key must
582                                  be defined
583                                type: boolean
584                            required:
585                            - key
586                            type: object
587                            x-kubernetes-map-type: atomic
588                          serverName:
589                            description: Used to verify the hostname for the targets.
590                            type: string
591                        type: object
592                    type: object
593                  type: array
594                jobLabel:
595                  description: "JobLabel selects the label from the associated Kubernetes
596                    service which will be used as the `job` label for all metrics. \n
597                    For example: If in `ServiceMonitor.spec.jobLabel: foo` and in `Service.metadata.labels.foo:
598                    bar`, then the `job=\"bar\"` label is added to all metrics. \n If
599                    the value of this field is empty or if the label doesn't exist for
600                    the given Service, the `job` label of the metrics defaults to the
601                    name of the Kubernetes Service."
602                  type: string
603                labelLimit:
604                  description: Per-scrape limit on number of labels that will be accepted
605                    for a sample. Only valid in Prometheus versions 2.27.0 and newer.
606                  format: int64
607                  type: integer
608                labelNameLengthLimit:
609                  description: Per-scrape limit on length of labels name that will be
610                    accepted for a sample. Only valid in Prometheus versions 2.27.0
611                    and newer.
612                  format: int64
613                  type: integer
614                labelValueLengthLimit:
615                  description: Per-scrape limit on length of labels value that will
616                    be accepted for a sample. Only valid in Prometheus versions 2.27.0
617                    and newer.
618                  format: int64
619                  type: integer
620                namespaceSelector:
621                  description: Selector to select which namespaces the Kubernetes Endpoints
622                    objects are discovered from.
623                  properties:
624                    any:
625                      description: Boolean describing whether all namespaces are selected
626                        in contrast to a list restricting them.
627                      type: boolean
628                    matchNames:
629                      description: List of namespace names to select from.
630                      items:
631                        type: string
632                      type: array
633                  type: object
634                podTargetLabels:
635                  description: PodTargetLabels transfers labels on the Kubernetes `Pod`
636                    onto the created metrics.
637                  items:
638                    type: string
639                  type: array
640                sampleLimit:
641                  description: SampleLimit defines per-scrape limit on number of scraped
642                    samples that will be accepted.
643                  format: int64
644                  type: integer
645                selector:
646                  description: Selector to select Endpoints objects.
647                  properties:
648                    matchExpressions:
649                      description: matchExpressions is a list of label selector requirements.
650                        The requirements are ANDed.
651                      items:
652                        description: A label selector requirement is a selector that
653                          contains values, a key, and an operator that relates the key
654                          and values.
655                        properties:
656                          key:
657                            description: key is the label key that the selector applies
658                              to.
659                            type: string
660                          operator:
661                            description: operator represents a key's relationship to
662                              a set of values. Valid operators are In, NotIn, Exists
663                              and DoesNotExist.
664                            type: string
665                          values:
666                            description: values is an array of string values. If the
667                              operator is In or NotIn, the values array must be non-empty.
668                              If the operator is Exists or DoesNotExist, the values
669                              array must be empty. This array is replaced during a strategic
670                              merge patch.
671                            items:
672                              type: string
673                            type: array
674                        required:
675                        - key
676                        - operator
677                        type: object
678                      type: array
679                    matchLabels:
680                      additionalProperties:
681                        type: string
682                      description: matchLabels is a map of {key,value} pairs. A single
683                        {key,value} in the matchLabels map is equivalent to an element
684                        of matchExpressions, whose key field is "key", the operator
685                        is "In", and the values array contains only "value". The requirements
686                        are ANDed.
687                      type: object
688                  type: object
689                  x-kubernetes-map-type: atomic
690                targetLabels:
691                  description: TargetLabels transfers labels from the Kubernetes `Service`
692                    onto the created metrics.
693                  items:
694                    type: string
695                  type: array
696                targetLimit:
697                  description: TargetLimit defines a limit on the number of scraped
698                    targets that will be accepted.
699                  format: int64
700                  type: integer
701              required:
702              - endpoints
703              - selector
704              type: object
705          required:
706          - spec
707          type: object
708      served: true
709      storage: true