@@ -131,8 +131,9 @@ metadata:
131131 namespace : ns-1
132132spec :
133133 podGroupTemplateRef :
134- workloadName : training-workload
135- podGroupTemplateName : pd-1-template
134+ workload :
135+ workloadName : training-workload
136+ podGroupTemplateName : pd-1-template
136137 schedulingPolicy :
137138 gang :
138139 minCount : 2
@@ -294,35 +295,44 @@ type PodGroupSpec struct {
294295 SchedulingPolicy *PodGroupSchedulingPolicy
295296}
296297
297- // PodGroupTemplateReference references the PodGroupTemplate name within
298- // the Workload object .
298+ // PodGroupTemplateReference references a PodGroup template defined in some object (e.g. Workload).
299+ // Exactly one reference must be set .
299300type PodGroupTemplateReference struct {
300- // WorkloadName defines the name of the Workload object this PodGroup is part of.
301- //
302- // +optional
303- WorkloadName string
301+ // Workload references the PodGroupTemplate within the Workload object that was used to create
302+ // the PodGroup.
303+ // +optional
304+ Workload *WorkloadPodGroupTemplateReference
305+ }
304306
305- // PodGroupTemplateName references the PodGroupTemplate name that was used to
306- // create this PodGroup.
307- //
308- // +optional
309- PodGroupTemplateName string
307+ // WorkloadPodGroupTemplateReference references the PodGroupTemplate within the Workload object.
308+ type WorkloadPodGroupTemplateReference struct {
309+ // WorkloadName defines the name of the Workload object.
310+ // +required
311+ WorkloadName string
312+
313+ // PodGroupTemplateName defines the PodGroupTemplate name within the Workload object.
314+ // +required
315+ PodGroupTemplateName string
310316}
311317
318+ // PodGroupStatus represents information about the status of a pod group.
312319type PodGroupStatus struct {
313320 // Conditions represent the latest observations of the PodGroup's state.
314321 //
315322 // Known condition types:
316323 // - "PodGroupScheduled": Indicates whether the scheduling requirement has been satisfied.
317- // - Status=True: All required pods have been assigned to nodes.
318- // - Status=False: Scheduling failed (i.e., timeout, unschedulable, etc.) .
324+ // - "DisruptionTarget": Indicates whether the PodGroup is about to be terminated
325+ // due to disruption such as preemption .
319326 //
320- // Known reasons for PodGroupScheduled condition:
321- // - "Scheduled": All required pods have been successfully scheduled.
327+ // Known reasons for the PodGroupScheduled condition:
322328 // - "Unschedulable": The PodGroup cannot be scheduled due to resource constraints,
323329 // affinity/anti-affinity rules, or insufficient capacity for the gang.
324- // - "Preempted": The PodGroup was preempted to make room for higher-priority workloads.
325- // - "Timeout": The PodGroup failed to schedule within the configured timeout.
330+ // - "SchedulerError": The PodGroup cannot be scheduled due to some internal error
331+ // that happened during scheduling, for example due to nodeAffinity parsing errors.
332+ //
333+ // Known reasons for the DisruptionTarget condition:
334+ // - "PreemptionByScheduler": The PodGroup was preempted by the scheduler to make room for
335+ // higher-priority PodGroups or Pods.
326336 //
327337 // +optional
328338 Conditions []metav1.Condition
0 commit comments