Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8db7ae5
chore: replace the member status of ITS with instance status
leon-inf Sep 8, 2025
a942abd
chore: maintain the status of volume expansion in ITS
leon-inf Sep 8, 2025
f510c8b
chore: move horizontal scale into ITS
leon-inf Sep 8, 2025
cc9b155
Merge branch 'main' into support/hscale-in-its
leon-inf Sep 9, 2025
c0e0a66
update
leon-inf Sep 10, 2025
2cb78a8
Merge branch 'main' into support/hscale-in-its
leon-inf Sep 11, 2025
45db574
update
leon-inf Sep 12, 2025
eaeb14f
Merge branch 'main' into support/hscale-in-its
leon-inf Sep 16, 2025
dc4be76
Merge branch 'main' into support/hscale-in-its
leon-inf Sep 22, 2025
7859617
Merge branch 'main' into support/hscale-in-its
leon-inf Sep 23, 2025
1846fa3
update
leon-inf Sep 23, 2025
1454230
remove replica status
leon-inf Sep 24, 2025
1025e7f
remove pods when calling action
leon-inf Sep 25, 2025
6e28fbf
fix and pass h-scale
leon-inf Sep 26, 2025
b46bfeb
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 9, 2025
526c39c
tidyup
leon-inf Oct 10, 2025
3b59f2f
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 10, 2025
15a0255
fix test
leon-inf Oct 10, 2025
bf4d842
tidyup
leon-inf Oct 13, 2025
8673656
member join/leave for its2
leon-inf Oct 13, 2025
aba793f
update
leon-inf Oct 13, 2025
0444fb0
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 13, 2025
e231e56
update
leon-inf Oct 14, 2025
d45474f
fix data action test
leon-inf Oct 14, 2025
1a1aed2
debug CI failed
leon-inf Oct 14, 2025
d7d8ffc
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 15, 2025
051f781
more test
leon-inf Oct 17, 2025
85f5b99
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 20, 2025
e735e47
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 22, 2025
a60ae89
tidyup
leon-inf Oct 22, 2025
459c01d
fix
leon-inf Oct 23, 2025
349af23
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 23, 2025
8edc320
move list pods to ops
leon-inf Oct 28, 2025
a5c9d31
cmp no longer depends on multicluster
leon-inf Oct 28, 2025
bbfb481
bugfix and handle service
leon-inf Oct 28, 2025
92bc01c
headless service
leon-inf Oct 28, 2025
8f2a542
fix lint
leon-inf Oct 28, 2025
464ab57
take the headless service as an assistant object
leon-inf Oct 28, 2025
2cdd2e0
Merge branch 'main' into support/hscale-in-its
leon-inf Oct 28, 2025
fab308f
Merge branch 'main' into support/hscale-in-its
leon-inf Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apis/workloads/v1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ var (
AddToScheme = SchemeBuilder.AddToScheme
)

const InstanceSetKind = "InstanceSet"
const (
InstanceSetKind = "InstanceSet"
InstanceKind = "Instance"
)
17 changes: 16 additions & 1 deletion apis/workloads/v1/instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,25 @@ type InstanceStatus2 struct {
// +optional
Role string `json:"role,omitempty"`

// Represents whether the instance is provisioned.
//
// +optional
Provisioned bool `json:"provisioned,omitempty"`

// Represents whether the instance data is loaded.
//
// +optional
DataLoaded *bool `json:"dataLoaded,omitempty"`

// Represents whether the instance is joined the cluster.
//
// +optional
MemberJoined *bool `json:"memberJoined,omitempty"`

// Represents whether the instance is in volume expansion.
//
// +optional
VolumeExpansion bool `json:"volumeExpansion,omitempty"`
InVolumeExpansion bool `json:"inVolumeExpansion,omitempty"`
}

type InstanceAssistantObject struct {
Expand Down
55 changes: 49 additions & 6 deletions apis/workloads/v1/instanceset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/utils/ptr"

kbappsv1 "github.com/apecloud/kubeblocks/apis/apps/v1"
)
Expand Down Expand Up @@ -328,13 +329,13 @@ type InstanceSetStatus struct {
// This value is set to spec.Replicas at the time of object creation and remains constant thereafter.
//
// +optional
InitReplicas int32 `json:"initReplicas"`
InitReplicas *int32 `json:"initReplicas"`

// Represents the number of instances that have already reached the InstanceStatus during the cluster initialization stage.
// This value remains constant once it equals InitReplicas.
//
// +optional
ReadyInitReplicas int32 `json:"readyInitReplicas,omitempty"`
ReadyInitReplicas *int32 `json:"readyInitReplicas,omitempty"`

// Provides the status of each instance in the ITS.
//
Expand Down Expand Up @@ -504,6 +505,21 @@ type LifecycleActions struct {
// +optional
Switchover *Action `json:"switchover,omitempty"`

// Defines the procedure to add a new replica.
//
// +optional
MemberJoin *Action `json:"memberJoin,omitempty"`

// Defines the procedure to remove a replica.
//
// +optional
MemberLeave *Action `json:"memberLeave,omitempty"`

// Defines the procedure for importing data into a replica.
//
// +optional
DataLoad *Action `json:"dataLoad,omitempty"`

// Defines the procedure that update a replica with new configuration.
//
// +optional
Expand Down Expand Up @@ -552,10 +568,25 @@ type InstanceStatus struct {
// +optional
Configs []InstanceConfigStatus `json:"configs,omitempty"`

// Represents whether the instance is provisioned.
//
// +optional
Provisioned bool `json:"provisioned,omitempty"`

// Represents whether the instance data is loaded.
//
// +optional
DataLoaded *bool `json:"dataLoaded,omitempty"`

// Represents whether the instance is joined the cluster.
//
// +optional
MemberJoined *bool `json:"memberJoined,omitempty"`

// Represents whether the instance is in volume expansion.
//
// +optional
VolumeExpansion bool `json:"volumeExpansion,omitempty"`
InVolumeExpansion bool `json:"inVolumeExpansion,omitempty"`
}

type InstanceConfigStatus struct {
Expand Down Expand Up @@ -647,7 +678,7 @@ func (r *InstanceSet) IsInstancesReady() bool {
return false
}
// check whether the cluster has been initialized
if r.Status.ReadyInitReplicas != r.Status.InitReplicas {
if ptr.Deref(r.Status.InitReplicas, 0) == 0 || ptr.Deref(r.Status.InitReplicas, 0) != ptr.Deref(r.Status.ReadyInitReplicas, 0) {
return false
}
// check whether latest spec has been sent to the underlying workload
Expand All @@ -669,12 +700,20 @@ func (r *InstanceSet) IsInstancesReady() bool {
return false
}

// check whether all instances are joined the cluster
for _, inst := range r.Status.InstanceStatus {
if !ptr.Deref(inst.MemberJoined, true) {
return false
}
}

return true
}

// IsInstanceSetReady gives InstanceSet level 'ready' state:
// 1. all instances are available
// 2. and all instances have role set (if they are role-ful)
// 1. all instances are ready and available
// 2. all instances are joined the cluster
// 3. all instances have role set (if they are role-ful)
func (r *InstanceSet) IsInstanceSetReady() bool {
instancesReady := r.IsInstancesReady()
if !instancesReady {
Expand All @@ -696,3 +735,7 @@ func (r *InstanceSet) IsRoleProbeDone() bool {
}
return cnt == replicas
}

func (r *InstanceSet) IsInInitializing() bool {
return r.Status.InitReplicas == nil || *r.Status.InitReplicas != ptr.Deref(r.Status.ReadyInitReplicas, 0)
}
45 changes: 45 additions & 0 deletions apis/workloads/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func main() {
}

if err = (&component.ComponentReconciler{
Client: client,
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Recorder: mgr.GetEventRecorderFor("component-controller"),
}).SetupWithManager(mgr); err != nil {
Expand Down
Loading
Loading