Skip to content

Commit

Permalink
feat: add startupporlicy api
Browse files Browse the repository at this point in the history
  • Loading branch information
nayihz committed Jun 2, 2024
1 parent 02039b4 commit 82f02fc
Show file tree
Hide file tree
Showing 6 changed files with 15,426 additions and 14,613 deletions.
16 changes: 16 additions & 0 deletions api/leaderworkerset/v1/leaderworkerset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ type LeaderWorkerSetSpec struct {
// when a revision is made to the leaderWorkerTemplate.
// +optional
RolloutStrategy RolloutStrategy `json:"rolloutStrategy,omitempty"`

// StartupPolicy defines the startup policy for the leader/worker statefulset.
// +kubebuilder:default=Default
// +kubebuilder:validation:Enum={Default,WaitForLeaderReady}
StartupPolicy StartupPolicyType `json:"startupPolicy"`
}

// Template of the leader/worker pods, the group will include at least one leader pod.
Expand Down Expand Up @@ -227,6 +232,17 @@ const (
DefaultRestartPolicy RestartPolicyType = "Default"
)

type StartupPolicyType string

const (
// WaitForLeaderReady will create worker statefulset after the leader is ready.
WaitForLeaderReady StartupPolicyType = "WaitForLeaderReady"

// Default will create worker statefulset immediately when pod controller receives
// the leader pod created event.
DefaultStartupPolicy StartupPolicyType = "Default"
)

// LeaderWorkerSetStatus defines the observed state of LeaderWorkerSet
type LeaderWorkerSetStatus struct {
// Conditions track the condition of the leaderworkerset.
Expand Down
Loading

0 comments on commit 82f02fc

Please sign in to comment.