...

Text file src/edge-infra.dev/test/fixtures/crds/prometheus-operator/monitoring.coreos.com_servicemonitors.yaml

Documentation: edge-infra.dev/test/fixtures/crds/prometheus-operator

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

View as plain text