{
  "description": "ResourceFlavor is the Schema for the resourceflavors API.",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "spec is the specification of the ResourceFlavor.",
      "properties": {
        "nodeLabels": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "nodeLabels are labels that associate the ResourceFlavor with Nodes that\nhave the same labels.\nWhen a Workload is admitted, its podsets can only get assigned\nResourceFlavors whose nodeLabels match the nodeSelector and nodeAffinity\nfields.\nOnce a ResourceFlavor is assigned to a podSet, the ResourceFlavor's\nnodeLabels should be injected into the pods of the Workload by the\ncontroller that integrates with the Workload object.\n\nnodeLabels can be up to 8 elements.",
          "maxProperties": 8,
          "type": "object",
          "x-kubernetes-map-type": "atomic"
        },
        "nodeTaints": {
          "description": "nodeTaints are taints that the nodes associated with this ResourceFlavor\nhave.\nWorkloads' podsets must have tolerations for these nodeTaints in order to\nget assigned this ResourceFlavor during admission.\nWhen this ResourceFlavor has also set the matching tolerations (in .spec.tolerations),\nthen the nodeTaints are not considered during admission.\nOnly the 'NoSchedule' and 'NoExecute' taint effects are evaluated,\nwhile 'PreferNoSchedule' is ignored.\n\nAn example of a nodeTaint is\ncloud.provider.com/preemptible=\"true\":NoSchedule\n\nnodeTaints can be up to 8 elements.",
          "items": {
            "description": "The node this Taint is attached to has the \"effect\" on\nany pod that does not tolerate the Taint.",
            "properties": {
              "effect": {
                "description": "Required. The effect of the taint on pods\nthat do not tolerate the taint.\nValid effects are NoSchedule, PreferNoSchedule and NoExecute.",
                "type": "string"
              },
              "key": {
                "description": "Required. The taint key to be applied to a node.",
                "type": "string"
              },
              "timeAdded": {
                "description": "TimeAdded represents the time at which the taint was added.",
                "format": "date-time",
                "type": "string"
              },
              "value": {
                "description": "The taint value corresponding to the taint key.",
                "type": "string"
              }
            },
            "required": [
              "effect",
              "key"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "maxItems": 8,
          "type": "array",
          "x-kubernetes-list-type": "atomic",
          "x-kubernetes-validations": [
            {
              "message": "supported taint effect values: 'NoSchedule', 'PreferNoSchedule', 'NoExecute'",
              "rule": "self.all(x, x.effect in ['NoSchedule', 'PreferNoSchedule', 'NoExecute'])"
            }
          ]
        },
        "tolerations": {
          "description": "tolerations are extra tolerations that will be added to the pods admitted in\nthe quota associated with this resource flavor.\n\nAn example of a toleration is\ncloud.provider.com/preemptible=\"true\":NoSchedule\n\ntolerations can be up to 8 elements.",
          "items": {
            "description": "The pod this Toleration is attached to tolerates any taint that matches\nthe triple <key,value,effect> using the matching operator <operator>.",
            "properties": {
              "effect": {
                "description": "Effect indicates the taint effect to match. Empty means match all taint effects.\nWhen specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.",
                "type": "string"
              },
              "key": {
                "description": "Key is the taint key that the toleration applies to. Empty means match all taint keys.\nIf the key is empty, operator must be Exists; this combination means to match all values and all keys.",
                "type": "string"
              },
              "operator": {
                "description": "Operator represents a key's relationship to the value.\nValid operators are Exists and Equal. Defaults to Equal.\nExists is equivalent to wildcard for value, so that a pod can\ntolerate all taints of a particular category.",
                "type": "string"
              },
              "tolerationSeconds": {
                "description": "TolerationSeconds represents the period of time the toleration (which must be\nof effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,\nit is not set, which means tolerate the taint forever (do not evict). Zero and\nnegative values will be treated as 0 (evict immediately) by the system.",
                "format": "int64",
                "type": "integer"
              },
              "value": {
                "description": "Value is the taint value the toleration matches to.\nIf the operator is Exists, the value should be empty, otherwise just a regular string.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "maxItems": 8,
          "type": "array",
          "x-kubernetes-list-type": "atomic",
          "x-kubernetes-validations": [
            {
              "message": "operator must be Exists when 'key' is empty, which means 'match all values and all keys'",
              "rule": "self.all(x, !has(x.key) ? x.operator == 'Exists' : true)"
            },
            {
              "message": "effect must be 'NoExecute' when 'tolerationSeconds' is set",
              "rule": "self.all(x, has(x.tolerationSeconds) ? x.effect == 'NoExecute' : true)"
            },
            {
              "message": "supported toleration values: 'Equal'(default), 'Exists'",
              "rule": "self.all(x, !has(x.operator) || x.operator in ['Equal', 'Exists'])"
            },
            {
              "message": "a value must be empty when 'operator' is 'Exists'",
              "rule": "self.all(x, has(x.operator) && x.operator == 'Exists' ? !has(x.value) : true)"
            },
            {
              "message": "supported taint effect values: 'NoSchedule', 'PreferNoSchedule', 'NoExecute'",
              "rule": "self.all(x, !has(x.effect) || x.effect in ['NoSchedule', 'PreferNoSchedule', 'NoExecute'])"
            }
          ]
        },
        "topologyName": {
          "description": "topologyName indicates topology for the TAS ResourceFlavor.\nWhen specified, it enables scraping of the topology information from the\nnodes matching to the Resource Flavor node labels.",
          "maxLength": 253,
          "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
          "type": "string"
        }
      },
      "type": "object",
      "x-kubernetes-validations": [
        {
          "message": "at least one nodeLabel is required when topology is set",
          "rule": "!has(self.topologyName) || self.nodeLabels.size() >= 1"
        },
        {
          "message": "resourceFlavorSpec are immutable when topologyName is set",
          "rule": "!has(oldSelf.topologyName) || self == oldSelf"
        }
      ],
      "additionalProperties": false
    }
  },
  "type": "object"
}
