@@ -84,14 +84,12 @@ type InstanceSetSpec struct {
8484 // +optional
8585 Replicas * int32 `json:"replicas,omitempty"`
8686
87- // Specifies the desired Ordinals of the default template .
88- // The Ordinals used to specify the ordinal of the instance (pod) names to be generated under the default template .
87+ // Specifies the desired Ordinals.
88+ // The Ordinals used to specify the ordinal of the instance (pod) names to be generated under the InstanceSet .
8989 // If Ordinals are defined, their number must be equal to or more than the corresponding replicas.
9090 //
91- // For example, if Ordinals is {ranges: [{start: 0, end: 1}], discrete: [7]},
92- // then the instance names generated under the default template would be
93- // $(cluster.name)-$(component.name)-0、$(cluster.name)-$(component.name)-1 and $(cluster.name)-$(component.name)-7
94- DefaultTemplateOrdinals kbappsv1.Ordinals `json:"defaultTemplateOrdinals,omitempty"`
91+ // +optional
92+ Ordinals Ordinals `json:"ordinals,omitempty"`
9593
9694 // Defines the minimum number of seconds a newly created pod should be ready
9795 // without any of its container crashing to be considered available.
@@ -236,6 +234,12 @@ type InstanceSetSpec struct {
236234 // +optional
237235 Paused bool `json:"paused,omitempty"`
238236
237+ // Stop the InstanceSet.
238+ // If set, all the computing resources will be released.
239+ //
240+ // +optional
241+ Stop * bool `json:"stop,omitempty"`
242+
239243 // Describe the configs to be reconfigured.
240244 //
241245 // +optional
@@ -283,11 +287,6 @@ type InstanceSetStatus struct {
283287 // replicas is the number of instances created by the InstanceSet controller.
284288 Replicas int32 `json:"replicas"`
285289
286- // Ordinals is the ordinals used by the instances of the InstanceSet except the template instances.
287- //
288- // +optional
289- Ordinals []int32 `json:"ordinals,omitempty"`
290-
291290 // readyReplicas is the number of instances created for this InstanceSet with a Ready Condition.
292291 //
293292 // +optional
@@ -353,9 +352,21 @@ type InstanceSetStatus struct {
353352 // +optional
354353 UpdateRevisions map [string ]string `json:"updateRevisions,omitempty"`
355354
356- // TemplatesStatus represents status of each instance generated by InstanceTemplates
355+ // TemplatesStatus represents status of each instance generated by InstanceTemplates.
356+ //
357357 // +optional
358358 TemplatesStatus []InstanceTemplateStatus `json:"templatesStatus,omitempty"`
359+
360+ // AssignedOrdinals is the ordinals assigned to the workload instances.
361+ //
362+ // This field represents the authoritative set of ordinal identifiers currently in use by the workload.
363+ // It enables support for non-contiguous ordinals, allowing any instance to be terminated without affecting others.
364+ //
365+ // The controller uses this to maintain identity consistency and to decide which specific ordinal
366+ // to allocate next during scaling up, or which identity is preserved during a restart.
367+ //
368+ // +optional
369+ AssignedOrdinals map [string ]Ordinals `json:"assignedOrdinals,omitempty"`
359370}
360371
361372// PersistentVolumeClaimRetentionPolicy describes the policy used for PVCs created from the VolumeClaimTemplates.
@@ -402,6 +413,8 @@ type InstanceTemplate struct {
402413 // then the instance names generated under this InstanceTemplate would be
403414 // $(cluster.name)-$(component.name)-$(template.name)-0、$(cluster.name)-$(component.name)-$(template.name)-1 and
404415 // $(cluster.name)-$(component.name)-$(template.name)-7
416+ //
417+ // +optional
405418 Ordinals Ordinals `json:"ordinals,omitempty"`
406419
407420 // Specifies a map of key-value pairs to be merged into the Pod's existing annotations.
@@ -579,10 +592,6 @@ type InstanceTemplateStatus struct {
579592 // +optional
580593 Replicas int32 `json:"replicas,omitempty"`
581594
582- // Ordinals is the ordinals used by the instances of the InstanceTemplate.
583- // +optional
584- Ordinals []int32 `json:"ordinals,omitempty"`
585-
586595 // ReadyReplicas is the number of Pods that have a Ready Condition.
587596 // +optional
588597 ReadyReplicas int32 `json:"readyReplicas,omitempty"`
0 commit comments