kind: CustomResourceDefinition
apiVersion: apiextensions.k8s.io/v1
metadata:
  annotations:
    polaris-slo-cloud.github.io/schema-gen-version: 0.3.0
  name: costefficiencymetricmappings.metrics.polaris-slo-cloud.github.io
spec:
  group: metrics.polaris-slo-cloud.github.io
  names:
    kind: CostEfficiencyMetricMapping
    listKind: CostEfficiencyMetricMappingList
    singular: costefficiencymetricmapping
    plural: costefficiencymetricmappings
  scope: Namespaced
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          required:
            - metadata
            - spec
            - apiVersion
            - kind
          description: >-
            Used to configure a cost efficiency composed metric controller to
            compute its metric for a specific target.
          properties:
            metadata:
              type: object
            spec:
              type: object
              required:
                - targetRef
                - metricConfig
              description: >-
                Defines the configuration data for a composed metric mapping
                that is used for configuring a composed metric controller.
              properties:
                targetRef:
                  type: object
                  required:
                    - kind
                    - name
                    - apiVersion
                  description: Identifies that target workload for an SLO mapping.
                  properties:
                    kind:
                      type: string
                      description: >-
                        Kind is a string value representing the REST resource
                        this object represents. Servers may infer this from the
                        endpoint the client submits requests to. Cannot be
                        updated. In CamelCase. More info:
                        https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
                    name:
                      type: string
                      description: The name of the instance.
                    apiVersion:
                      type: string
                      description: >-
                        APIVersion defines the versioned schema of this
                        representation of an object. Servers should convert
                        recognized schemas to the latest internal value, and may
                        reject unrecognized values. More info:
                        https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
                metricConfig:
                  type: object
                  properties:
                    targetThreshold:
                      type: integer
                      description: >-
                        The target threshold for the `performance` part of the
                        cost efficiency equation.


                        Depending on the specific cost efficiency metric
                        implementation, the threshold may be considered as a
                        lower bound (`performance` samples should be above the
                        threshold) or as an upper bound (`performance` samples
                        should be below the threshold).


                        If the implementation of the metric relies on a
                        bucketing mechanism (e.g., Prometheus histograms), the
                        set of allowed values may be limited.
                      format: int64
                  required:
                    - targetThreshold
                  description: >-
                    Limited alternative for `Omit<T, K>` that provides a
                    workaround for an issue with ts-json-schema-generator.


                    While ts-json-schema-generator can handle `Omit<SomeType,
                    K>`, it throws the following error when `SomeType` is itself
                    a generic parameter: ``` LogicError: Unexpected key type
                    "undefined" for type "{     [P in K]: T[P]; }" (expected
                    "UnionType" or "StringType") ```


                    `CrdOmit` does not remove the properties from `T` like
                    `Omit` would, but it's workaround that works with
                    ts-json-schema-generator.
            apiVersion:
              type: string
              description: >-
                APIVersion defines the versioned schema of this representation
                of an object. Servers should convert recognized schemas to the
                latest internal value, and may reject unrecognized values. More
                info:
                https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
            kind:
              type: string
              description: >-
                Kind is a string value representing the REST resource this
                object represents. Servers may infer this from the endpoint the
                client submits requests to. Cannot be updated. In CamelCase.
                More info:
                https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
