Skip to content

scheduling_v1beta1

AllCompositeDisruptionMode

AllDisruptionMode

BasicSchedulingPolicy

CompositeBasicSchedulingPolicy

CompositeDisruptionMode

class lightkube.models.scheduling_v1beta1.CompositeDisruptionMode(all=None, single=None)

CompositeDisruptionMode defines how individual entities within a composite pod group can be disrupted. Exactly one mode must be set.

parameters

CompositeGangSchedulingPolicy

class lightkube.models.scheduling_v1beta1.CompositeGangSchedulingPolicy(minGroupCount)

CompositeGangSchedulingPolicy indicates that the groups belonging to the composite group should be scheduled using all-or-nothing semantics.

parameters

  • minGroupCount int - minGroupCount is the minimum number of child groups that must be schedulable or scheduled at the same time for the scheduler to admit the entire group. It must be a positive integer.

CompositePodGroupSchedulingConstraints

class lightkube.models.scheduling_v1beta1.CompositePodGroupSchedulingConstraints(topology=None)

CompositePodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a CompositePodGroup.

parameters

  • topology Optional[List[TopologyConstraint]] - topology defines the topology constraints for the composite pod group. Currently only a single topology constraint can be specified. This may change in the future.

CompositePodGroupSchedulingPolicy

class lightkube.models.scheduling_v1beta1.CompositePodGroupSchedulingPolicy(basic=None, gang=None)

CompositePodGroupSchedulingPolicy defines the scheduling configuration for a CompositePodGroup. Exactly one policy must be set.

parameters

  • basic Optional[CompositeBasicSchedulingPolicy] - basic specifies that the groups of this composite group should be scheduled independently. This field is immutable.
  • gang Optional[CompositeGangSchedulingPolicy] - gang specifies that the groups of this composite group should be scheduled using all-or-nothing semantics.

CompositePodGroupTemplate

class lightkube.models.scheduling_v1beta1.CompositePodGroupTemplate(name, schedulingPolicy, compositePodGroupTemplates=None, disruptionMode=None, podGroupTemplates=None, preemptionPolicy=None, priority=None, priorityClassName=None, schedulingConstraints=None)

CompositePodGroupTemplate represents a template for a CompositePodGroup with a scheduling policy.

parameters

  • name str - name is a unique identifier for the CompositePodGroupTemplate within the Workload. It must be a DNS label. This field is required.
  • schedulingPolicy CompositePodGroupSchedulingPolicy - schedulingPolicy defines the scheduling policy for this template.
  • compositePodGroupTemplates Optional[List[CompositePodGroupTemplate]] - compositePodGroupTemplates is the list of templates for children CompositePodGroups. The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates or PodGroupTemplates must be set.
  • disruptionMode Optional[CompositeDisruptionMode] - disruptionMode defines the mode in which a given CompositePodGroup can be disrupted. One of Single, All. This field is immutable.
  • podGroupTemplates Optional[List[PodGroupTemplate]] - podGroupTemplates is the list of templates for children PodGroups. The maximum number of templates is 8. At least one entry in CompositePodGroupTemplates or PodGroupTemplates must be set.
  • preemptionPolicy Optional[str] - preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.
  • priority Optional[int] - priority is the value of priority of composite pod groups created from this template. Various system components use this field to find the priority of the composite 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.
  • priorityClassName Optional[str] - priorityClassName indicates the priority that should be considered when scheduling a composite 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, composite pod groups created from this template will have the priority set to zero. This field is immutable.
  • schedulingConstraints Optional[CompositePodGroupSchedulingConstraints] - schedulingConstraints defines optional scheduling constraints (e.g. topology) for this CompositePodGroupTemplate. This field is immutable.

DisruptionMode

class lightkube.models.scheduling_v1beta1.DisruptionMode(all=None, single=None)

DisruptionMode defines how individual entities within a group can be disrupted. Exactly one mode can be set.

parameters

  • all Optional[AllDisruptionMode] - all specifies that all children can only be disrupted together.
  • single Optional[SingleDisruptionMode] - single specifies that children can be disrupted independently from each other.

GangSchedulingPolicy

class lightkube.models.scheduling_v1beta1.GangSchedulingPolicy(minCount)

GangSchedulingPolicy defines the parameters for gang scheduling.

parameters

  • minCount int - 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. Note 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.

PodGroup

class lightkube.models.scheduling_v1beta1.PodGroup(spec, apiVersion=None, kind=None, metadata=None, status=None)

PodGroup represents a runtime instance of pods grouped together. PodGroups are created by workload controllers (Job, LWS, JobSet, etc...) from Workload.podGroupTemplates. PodGroup API enablement is toggled by the GenericWorkload feature gate.

parameters

  • spec PodGroupSpec - spec defines the desired state of the PodGroup.
  • apiVersion Optional[str] - 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
  • kind Optional[str] - 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
  • metadata Optional[meta_v1.ObjectMeta] - metadata is the standard object metadata. More info
  • status Optional[PodGroupStatus] - status represents the current observed state of the PodGroup.

PodGroupList

class lightkube.models.scheduling_v1beta1.PodGroupList(items, apiVersion=None, kind=None, metadata=None)

PodGroupList contains a list of PodGroup resources.

parameters

  • items List[PodGroup] - Items is the list of PodGroups.
  • apiVersion Optional[str] - 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
  • kind Optional[str] - 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
  • metadata Optional[meta_v1.ListMeta] - Standard list metadata.

PodGroupResourceClaim

class lightkube.models.scheduling_v1beta1.PodGroupResourceClaim(name, resourceClaimName=None, resourceClaimTemplateName=None)

PodGroupResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the PodGroup.

It 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.

parameters

  • name str - name uniquely identifies this resource claim inside the PodGroup. This must be a DNS_LABEL.
  • resourceClaimName Optional[str] - 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. Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set.
  • resourceClaimTemplateName Optional[str] - resourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this PodGroup. The 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. This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim. Exactly one of ResourceClaimName and ResourceClaimTemplateName must be set.

PodGroupResourceClaimStatus

class lightkube.models.scheduling_v1beta1.PodGroupResourceClaimStatus(name, resourceClaimName=None)

PodGroupResourceClaimStatus is stored in the PodGroupStatus for each PodGroupResourceClaim which references a ResourceClaimTemplate. It stores the generated name for the corresponding ResourceClaim.

parameters

  • name str - name uniquely identifies this resource claim inside the PodGroup. This must match the name of an entry in podgroup.spec.resourceClaims, which implies that the string must be a DNS_LABEL.
  • resourceClaimName Optional[str] - resourceClaimName is the name of the ResourceClaim that was generated for the PodGroup in the namespace of the PodGroup. If this is unset, then generating a ResourceClaim was not necessary. The podgroup.spec.resourceClaims entry can be ignored in this case.

PodGroupSchedulingConstraints

class lightkube.models.scheduling_v1beta1.PodGroupSchedulingConstraints(topology=None)

PodGroupSchedulingConstraints defines scheduling constraints (e.g. topology) for a PodGroup.

parameters

  • topology Optional[List[TopologyConstraint]] - topology defines the topology constraints for the pod group. Currently only a single topology constraint can be specified. This may change in the future.

PodGroupSchedulingPolicy

class lightkube.models.scheduling_v1beta1.PodGroupSchedulingPolicy(basic=None, gang=None)

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.

parameters

  • basic Optional[BasicSchedulingPolicy] - basic specifies that the pods in this group should be scheduled using standard Kubernetes scheduling behavior. Setting this field at group creation time opts this group to basic scheduling; this field cannot be changed afterward.
  • gang Optional[GangSchedulingPolicy] - gang specifies that the pods in this group should be scheduled using all-or-nothing semantics. Setting this field at group creation time opts this group to gang scheduling; this field cannot be set or unset afterward. The minCount field within Gang scheduling policy remains mutable after group creation.

PodGroupSpec

class lightkube.models.scheduling_v1beta1.PodGroupSpec(schedulingPolicy, disruptionMode=None, parentCompositePodGroupName=None, preemptionPolicy=None, priority=None, priorityClassName=None, resourceClaims=None, schedulingConstraints=None, workloadRef=None)

PodGroupSpec defines the desired state of a PodGroup.

parameters

  • schedulingPolicy PodGroupSchedulingPolicy - schedulingPolicy defines the scheduling policy for this instance of the PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate.
  • disruptionMode Optional[DisruptionMode] - disruptionMode defines the mode in which a given PodGroup can be disrupted. Controllers are expected to fill this field by copying it from a PodGroupTemplate. One of Single, All. Defaults to Single if unset. This field is immutable.
  • parentCompositePodGroupName Optional[str] - 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.
  • preemptionPolicy Optional[str] - 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. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.
  • priority Optional[int] - 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.
  • priorityClassName Optional[str] - 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 on PodGroupTemplate (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.
  • resourceClaims Optional[List[PodGroupResourceClaim]] - 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. This is a beta-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled. This field is immutable.
  • schedulingConstraints Optional[PodGroupSchedulingConstraints] - schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroup. Controllers are expected to fill this field by copying it from a PodGroupTemplate. This field is immutable. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled.
  • workloadRef Optional[WorkloadReference] - workloadRef references an optional PodGroup template within the Workload object that was used to create the PodGroup. This field is immutable.

PodGroupStatus

class lightkube.models.scheduling_v1beta1.PodGroupStatus(conditions=None, resourceClaimStatuses=None)

PodGroupStatus represents information about the status of a pod group.

parameters

  • conditions Optional[List[meta_v1.Condition]] - conditions represent the latest observations of the PodGroup's state. Known condition types: - "PodGroupInitiallyScheduled": Indicates whether the scheduling requirement has been satisfied. Once this condition transitions to True, it serves as a terminal state and will never revert to False, even if pods are subsequently evicted and group constraints are no longer met. - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated due to disruption such as preemption. Known reasons for the PodGroupInitiallyScheduled condition: - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints, affinity/anti-affinity rules, or insufficient capacity for the gang.
  • "SchedulerError": The PodGroup cannot be scheduled due to some internal error that happened during scheduling, for example due to nodeAffinity parsing errors. Known reasons for the DisruptionTarget condition: - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for higher-priority PodGroups or Pods.
  • resourceClaimStatuses Optional[List[PodGroupResourceClaimStatus]] - resourceClaimStatuses is status of resource claims.

PodGroupTemplate

class lightkube.models.scheduling_v1beta1.PodGroupTemplate(name, schedulingPolicy, disruptionMode=None, preemptionPolicy=None, priority=None, priorityClassName=None, resourceClaims=None, schedulingConstraints=None)

PodGroupTemplate represents a template for a set of pods with a scheduling policy.

parameters

  • name str - name is a unique identifier for the PodGroupTemplate within the Workload. It must be a DNS label. This field is immutable.
  • schedulingPolicy PodGroupSchedulingPolicy - schedulingPolicy defines the scheduling policy for this PodGroupTemplate.
  • disruptionMode Optional[DisruptionMode] - disruptionMode defines the mode in which a given PodGroup can be disrupted. One of Single, All. This field is immutable.
  • preemptionPolicy Optional[str] - preemptionPolicy is the Policy for preempting pods/podgroups with lower priority. One of Never, PreemptLowerPriority. This field is immutable. This field is available only when the PodGroupPreemptionPolicy feature gate is enabled.
  • priority Optional[int] - 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. The higher the value, the higher the priority. This field is immutable.
  • priorityClassName Optional[str] - priorityClassName indicates the priority that should be considered when scheduling a pod group created from this template. This field is immutable.
  • resourceClaims Optional[List[PodGroupResourceClaim]] - 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. This is a beta-level field and requires that the DRAWorkloadResourceClaims feature gate is enabled. This field is immutable.
  • schedulingConstraints Optional[PodGroupSchedulingConstraints] - schedulingConstraints defines optional scheduling constraints (e.g. topology) for this PodGroupTemplate. This field is only available when the TopologyAwareWorkloadScheduling feature gate is enabled. This field is immutable.

SingleCompositeDisruptionMode

SingleDisruptionMode

TopologyConstraint

class lightkube.models.scheduling_v1beta1.TopologyConstraint(key)

TopologyConstraint defines a topology constraint for a PodGroup.

parameters

  • key str - 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"

TypedLocalObjectReference

class lightkube.models.scheduling_v1beta1.TypedLocalObjectReference(kind, name, apiGroup=None)

TypedLocalObjectReference allows to reference typed object inside the same namespace.

parameters

  • kind str - kind is the type of resource being referenced. It must be a path segment name.
  • name str - name is the name of resource being referenced. It must be a path segment name.
  • apiGroup Optional[str] - 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.

Workload

class lightkube.models.scheduling_v1beta1.Workload(spec, apiVersion=None, kind=None, metadata=None)

Workload allows for expressing scheduling constraints that should be used when managing the lifecycle of workloads from the scheduling perspective, including scheduling, preemption, eviction and other phases. Workload API enablement is toggled by the GenericWorkload feature gate.

parameters

  • spec WorkloadSpec - spec defines the desired behavior of a Workload.
  • apiVersion Optional[str] - 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
  • kind Optional[str] - 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
  • metadata Optional[meta_v1.ObjectMeta] - metadata is the standard object metadata. More info

WorkloadList

class lightkube.models.scheduling_v1beta1.WorkloadList(items, apiVersion=None, kind=None, metadata=None)

WorkloadList contains a list of Workload resources.

parameters

  • items List[Workload] - items is the list of Workloads.
  • apiVersion Optional[str] - 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
  • kind Optional[str] - 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
  • metadata Optional[meta_v1.ListMeta] - metadata is the standard list metadata.

WorkloadReference

class lightkube.models.scheduling_v1beta1.WorkloadReference(templateName, workloadName)

WorkloadReference references the Workload object together with the template that was used to create a particular PodGroup.

parameters

  • templateName str - 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.
  • workloadName str - 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.

WorkloadSpec

class lightkube.models.scheduling_v1beta1.WorkloadSpec(compositePodGroupTemplates=None, controllerRef=None, podGroupTemplates=None)

WorkloadSpec defines the desired state of a Workload.

parameters

  • compositePodGroupTemplates Optional[List[CompositePodGroupTemplate]] - compositePodGroupTemplates is the list of CompositePodGroup templates that make up the Workload. The maximum number of templates is 8. This field is immutable. Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set. This field is used only when the CompositePodGroup feature gate is enabled.
  • controllerRef Optional[TypedLocalObjectReference] - controllerRef is an optional reference to the controlling object, such as a Deployment or Job. This field is intended for use by tools like CLIs to provide a link back to the original workload definition. This field is immutable.
  • podGroupTemplates Optional[List[PodGroupTemplate]] - podGroupTemplates is the list of templates that make up the Workload. The maximum number of templates is 8. Templates cannot be added or removed after the workload is created. Existing templates may still be updated where their individual fields allow it. Exactly one of CompositePodGroupTemplates and PodGroupTemplates must be set.