{
  "description": "PodGroupSpec defines the desired state of a PodGroup.",
  "properties": {
    "disruptionMode": {
      "description": "DisruptionMode defines how individual entities within a group can be disrupted. Exactly one mode can be set.",
      "properties": {
        "all": {
          "description": "AllDisruptionMode specifies that children can only be disrupted together.",
          "type": [
            "object",
            "null"
          ]
        },
        "single": {
          "description": "SingleDisruptionMode specifies that children can be disrupted independently.",
          "type": [
            "object",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ],
      "x-kubernetes-unions": [
        {
          "fields-to-discriminateBy": {
            "all": "All",
            "single": "Single"
          }
        }
      ]
    },
    "parentCompositePodGroupName": {
      "description": "parentCompositePodGroupName contains the name of the parent composite pod group within the same namespace as this pod group. If it's nil, then this pod group is a root of a workload's hierarchy. This field is used only when the CompositePodGroup feature gate is enabled. This field is immutable.",
      "type": [
        "string",
        "null"
      ]
    },
    "preemptionPolicy": {
      "description": "preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. When Priority Admission Controller is enabled, it populates this field from PriorityClassName, and defaults to PreemptLowerPriority if value is unset in PriorityClass. This field is immutable.",
      "type": [
        "string",
        "null"
      ]
    },
    "priority": {
      "description": "priority is the value of priority of this pod group. 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 immutable.",
      "format": "int32",
      "type": [
        "integer",
        "null"
      ]
    },
    "priorityClassName": {
      "description": "priorityClassName defines the priority that should be considered when scheduling this pod group. Controllers are expected to fill this field by copying it from a PodGroupTemplate. Otherwise, it is validated and resolved similarly to the PriorityClassName in Pods (i.e. if no priority class is specified, admission control can set this to the global default priority class if it exists. Otherwise, the pod group's priority will be zero). This field is immutable.",
      "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 a beta-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. Nodes where this label is missing or has an empty value do not belong to any domain instance, so pods within the PodGroup cannot be scheduled onto them. 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. The policy is chosen at creation time by setting either the Basic or Gang field. The PodGroup may not change policy after creation. Fields within chosen policy may be updated after creation when their individual fields allow it.",
      "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. This field is mutable to support workload scaling.\n\nNote that the scheduler operates on an eventually consistent model. Updates to minCount may not be immediately reflected in scheduling decisions due to propagation delays. If minCount is updated while a scheduling cycle is in progress for that group, the new value may not take effect until the next cycle. Moreover, minCount is only enforced during scheduling, meaning that modifications to this field do not affect already-scheduled pods, applying only to those evaluated in future cycles.",
              "format": "int32",
              "type": "integer"
            }
          },
          "required": [
            "minCount"
          ],
          "type": [
            "object",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ],
      "x-kubernetes-unions": [
        {
          "fields-to-discriminateBy": {
            "basic": "Basic",
            "gang": "Gang"
          }
        }
      ]
    },
    "workloadRef": {
      "description": "WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.",
      "properties": {
        "templateName": {
          "description": "templateName is the name of a template within the Workload object that was used to create a pod group. It must be a DNS label. This field is required.",
          "type": "string"
        },
        "workloadName": {
          "description": "workloadName is the name of the Workload object that contains a template that was used when creating a pod group. It must be a DNS name. This field is required.",
          "type": "string"
        }
      },
      "required": [
        "workloadName",
        "templateName"
      ],
      "type": [
        "object",
        "null"
      ]
    }
  },
  "required": [
    "schedulingPolicy"
  ],
  "type": "object",
  "$schema": "http://json-schema.org/schema#"
}