{
  "description": "WorkloadSpec defines the desired state of a Workload.",
  "properties": {
    "controllerRef": {
      "description": "TypedLocalObjectReference allows to reference typed object inside the same namespace.",
      "properties": {
        "apiGroup": {
          "description": "APIGroup is the group for the resource being referenced. If APIGroup is empty, the specified Kind must be in the core API group. For any other third-party types, setting APIGroup is required. It must be a DNS subdomain.",
          "type": [
            "string",
            "null"
          ]
        },
        "kind": {
          "description": "Kind is the type of resource being referenced. It must be a path segment name.",
          "type": "string"
        },
        "name": {
          "description": "Name is the name of resource being referenced. It must be a path segment name.",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "name"
      ],
      "type": [
        "object",
        "null"
      ]
    },
    "podGroupTemplates": {
      "description": "PodGroupTemplates is the list of templates that make up the Workload. The maximum number of templates is 8. This field is immutable.",
      "items": {
        "description": "PodGroupTemplate represents a template for a set of pods with a scheduling policy.",
        "properties": {
          "disruptionMode": {
            "description": "DisruptionMode defines the mode in which a given PodGroup can be disrupted. One of Pod, PodGroup. This field is available only when the WorkloadAwarePreemption feature gate is enabled.",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "description": "Name is a unique identifier for the PodGroupTemplate within the Workload. It must be a DNS label. This field is immutable.",
            "type": "string"
          },
          "priority": {
            "description": "Priority is the value of priority of pod groups created from this template. Various system components use this field to find the priority of the pod group. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. This field is available only when the WorkloadAwarePreemption feature gate is enabled.",
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "priorityClassName": {
            "description": "PriorityClassName indicates the priority that should be considered when scheduling a pod group created from this template. If no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, pod groups created from this template will have the priority set to zero. This field is available only when the WorkloadAwarePreemption feature gate is enabled.",
            "type": [
              "string",
              "null"
            ]
          },
          "resourceClaims": {
            "description": "ResourceClaims defines which ResourceClaims may be shared among Pods in the group. Pods consume the devices allocated to a PodGroup's claim by defining a claim in its own Spec.ResourceClaims that matches the PodGroup's claim exactly. The claim must have the same name and refer to the same ResourceClaim or ResourceClaimTemplate.\n\nThis is an alpha-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled.\n\nThis field is immutable.",
            "items": {
              "description": "PodGroupResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the PodGroup.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the PodGroup. Pods that need access to the ResourceClaim define a matching reference in its own Spec.ResourceClaims. The Pod's claim must match all fields of the PodGroup's claim exactly.",
              "properties": {
                "name": {
                  "description": "Name uniquely identifies this resource claim inside the PodGroup. This must be a DNS_LABEL.",
                  "type": "string"
                },
                "resourceClaimName": {
                  "description": "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this PodGroup. The ResourceClaim will be reserved for the PodGroup instead of its individual pods.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "resourceClaimTemplateName": {
                  "description": "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this PodGroup.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this PodGroup. When this PodGroup is deleted, the ResourceClaim will also be deleted. The PodGroup name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in podgroup.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "name"
              ],
              "type": [
                "object",
                "null"
              ]
            },
            "type": [
              "array",
              "null"
            ],
            "x-kubernetes-list-map-keys": [
              "name"
            ],
            "x-kubernetes-list-type": "map",
            "x-kubernetes-patch-merge-key": "name",
            "x-kubernetes-patch-strategy": "merge,retainKeys"
          },
          "schedulingConstraints": {
            "description": "PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup.",
            "properties": {
              "topology": {
                "description": "Topology defines the topology constraints for the pod group. Currently only a single topology constraint can be specified. This may change in the future.",
                "items": {
                  "description": "TopologyConstraint defines a topology constraint for a PodGroup.",
                  "properties": {
                    "key": {
                      "description": "Key specifies the key of the node label representing the topology domain. All pods within the PodGroup must be colocated within the same domain instance. Different PodGroups can land on different domain instances even if they derive from the same PodGroupTemplate. Examples: \"topology.kubernetes.io/rack\"",
                      "type": "string"
                    }
                  },
                  "required": [
                    "key"
                  ],
                  "type": [
                    "object",
                    "null"
                  ]
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "schedulingPolicy": {
            "description": "PodGroupSchedulingPolicy defines the scheduling configuration for a PodGroup. Exactly one policy must be set.",
            "properties": {
              "basic": {
                "description": "BasicSchedulingPolicy indicates that standard Kubernetes scheduling behavior should be used.",
                "type": [
                  "object",
                  "null"
                ]
              },
              "gang": {
                "description": "GangSchedulingPolicy defines the parameters for gang scheduling.",
                "properties": {
                  "minCount": {
                    "description": "MinCount is the minimum number of pods that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer.",
                    "format": "int32",
                    "type": "integer"
                  }
                },
                "required": [
                  "minCount"
                ],
                "type": [
                  "object",
                  "null"
                ]
              }
            },
            "type": "object",
            "x-kubernetes-unions": [
              {
                "fields-to-discriminateBy": {
                  "basic": "Basic",
                  "gang": "Gang"
                }
              }
            ]
          }
        },
        "required": [
          "name",
          "schedulingPolicy"
        ],
        "type": [
          "object",
          "null"
        ]
      },
      "type": [
        "array",
        "null"
      ],
      "x-kubernetes-list-map-keys": [
        "name"
      ],
      "x-kubernetes-list-type": "map"
    }
  },
  "required": [
    "podGroupTemplates"
  ],
  "type": "object",
  "$schema": "http://json-schema.org/schema#"
}