Skip to content

Commit

Permalink
Replace Timeout with RolloutConfig
Browse files Browse the repository at this point in the history
Uses `MinSuccessTime`, `ProgressDeadline`, and `MaxFailures` for a more
fine-tuned configuration.

Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek committed Sep 27, 2023
1 parent 5103a29 commit 4d738a1
Show file tree
Hide file tree
Showing 7 changed files with 363 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,47 @@ spec:
defined in ClusterManagementAddOn.
properties:
all:
description: All define required fields for RolloutStrategy
description: All defines required fields for RolloutStrategy
type All
properties:
timeout:
maxFailures:
default: 0
description: MaxFailures is a percentage of or number
of clusters in the current rollout that can fail
before proceeding to the next rollout. Default
is that no failures are tolerated.
pattern: ^((100|[0-9]{1,2})%|[0-9]+)$
type: string
minSuccessTime:
default: 0
description: MinSuccessTime is a "soak" time. In
other words, the minimum amount of time the workload
applier controller will wait from the start of
each rollout before proceeding (assuming a successful
state has been reached and MaxFailures wasn't
breached). MinSuccessTime is only considered for
rollout types Progressive and ProgressivePerGroup.
The default value is 0 meaning the workload applier
proceed immediately after a successful state is
reached. MinSuccessTime must be defined in [0-9h]|[0-9m]|[0-9s]
format examples; 2h , 90m , 360s
format: date-time
type: string
progressDeadline:
default: None
description: Timeout define how long workload applier
controller will wait till workload reach successful
state in the cluster. Timeout default value is
None meaning the workload applier will not proceed
apply workload to other clusters if did not reach
the successful state. Timeout must be defined
in [0-9h]|[0-9m]|[0-9s] format examples; 2h ,
90m , 360s
description: ProgressDeadline defines how long the
workload applier controller will wait until workload
reaches a successful state in the cluster, marking
it as failed after the deadline. The default value
is None meaning the workload applier will continue
to wait for a status if did not reach the successful
state. ProgressDeadline must be defined in [0-9h]|[0-9m]|[0-9s]
format examples; 2h , 90m , 360s
pattern: ^(([0-9])+[h|m|s])|None$
type: string
type: object
progressive:
description: Progressive define required fields for
description: Progressive defines required fields for
RolloutStrategy type Progressive
properties:
mandatoryDecisionGroups:
Expand Down Expand Up @@ -200,21 +223,44 @@ spec:
placement->DecisionStrategy.
pattern: ^((100|[0-9]{1,2})%|[0-9]+)$
x-kubernetes-int-or-string: true
timeout:
maxFailures:
default: 0
description: MaxFailures is a percentage of or number
of clusters in the current rollout that can fail
before proceeding to the next rollout. Default
is that no failures are tolerated.
pattern: ^((100|[0-9]{1,2})%|[0-9]+)$
type: string
minSuccessTime:
default: 0
description: MinSuccessTime is a "soak" time. In
other words, the minimum amount of time the workload
applier controller will wait from the start of
each rollout before proceeding (assuming a successful
state has been reached and MaxFailures wasn't
breached). MinSuccessTime is only considered for
rollout types Progressive and ProgressivePerGroup.
The default value is 0 meaning the workload applier
proceed immediately after a successful state is
reached. MinSuccessTime must be defined in [0-9h]|[0-9m]|[0-9s]
format examples; 2h , 90m , 360s
format: date-time
type: string
progressDeadline:
default: None
description: Timeout define how long workload applier
controller will wait till workload reach successful
state in the cluster. Timeout default value is
None meaning the workload applier will not proceed
apply workload to other clusters if did not reach
the successful state. Timeout must be defined
in [0-9h]|[0-9m]|[0-9s] format examples; 2h ,
90m , 360s
description: ProgressDeadline defines how long the
workload applier controller will wait until workload
reaches a successful state in the cluster, marking
it as failed after the deadline. The default value
is None meaning the workload applier will continue
to wait for a status if did not reach the successful
state. ProgressDeadline must be defined in [0-9h]|[0-9m]|[0-9s]
format examples; 2h , 90m , 360s
pattern: ^(([0-9])+[h|m|s])|None$
type: string
type: object
progressivePerGroup:
description: ProgressivePerGroup define required fields
description: ProgressivePerGroup defines required fields
for RolloutStrategy type ProgressivePerGroup
properties:
mandatoryDecisionGroups:
Expand All @@ -241,16 +287,39 @@ spec:
type: string
type: object
type: array
timeout:
maxFailures:
default: 0
description: MaxFailures is a percentage of or number
of clusters in the current rollout that can fail
before proceeding to the next rollout. Default
is that no failures are tolerated.
pattern: ^((100|[0-9]{1,2})%|[0-9]+)$
type: string
minSuccessTime:
default: 0
description: MinSuccessTime is a "soak" time. In
other words, the minimum amount of time the workload
applier controller will wait from the start of
each rollout before proceeding (assuming a successful
state has been reached and MaxFailures wasn't
breached). MinSuccessTime is only considered for
rollout types Progressive and ProgressivePerGroup.
The default value is 0 meaning the workload applier
proceed immediately after a successful state is
reached. MinSuccessTime must be defined in [0-9h]|[0-9m]|[0-9s]
format examples; 2h , 90m , 360s
format: date-time
type: string
progressDeadline:
default: None
description: Timeout define how long workload applier
controller will wait till workload reach successful
state in the cluster. Timeout default value is
None meaning the workload applier will not proceed
apply workload to other clusters if did not reach
the successful state. Timeout must be defined
in [0-9h]|[0-9m]|[0-9s] format examples; 2h ,
90m , 360s
description: ProgressDeadline defines how long the
workload applier controller will wait until workload
reaches a successful state in the cluster, marking
it as failed after the deadline. The default value
is None meaning the workload applier will continue
to wait for a status if did not reach the successful
state. ProgressDeadline must be defined in [0-9h]|[0-9m]|[0-9s]
format examples; 2h , 90m , 360s
pattern: ^(([0-9])+[h|m|s])|None$
type: string
type: object
Expand All @@ -263,11 +332,13 @@ spec:
clusters progressively per cluster. The workload will
not be applied to the next cluster unless one of the
current applied clusters reach the successful state
or timeout. 3) ProgressivePerGroup means apply the
workload to decisionGroup clusters progressively per
group. The workload will not be applied to the next
decisionGroup unless all clusters in the current group
reach the successful state or timeout.
and haven't breached the MaxFailures configuration.
3) ProgressivePerGroup means apply the workload to
decisionGroup clusters progressively per group. The
workload will not be applied to the next decisionGroup
unless all clusters in the current group reach the
successful state and haven't breached the MaxFailures
configuration.
enum:
- All
- Progressive
Expand Down
6 changes: 3 additions & 3 deletions cluster/v1alpha1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (r *RolloutHandler[T]) getRolloutAllClusters(rolloutStrategy RolloutStrateg
}

// Parse timeout for the rollout
failureTimeout, err := parseTimeout(strategy.All.Timeout.Timeout)
failureTimeout, err := parseTimeout(strategy.All.ProgressDeadline)
if err != nil {
return &strategy, RolloutResult{}, err
}
Expand All @@ -137,7 +137,7 @@ func (r *RolloutHandler[T]) getProgressiveClusters(rolloutStrategy RolloutStrate
}

// Parse timeout for non-mandatory decision groups
failureTimeout, err := parseTimeout(strategy.Progressive.Timeout.Timeout)
failureTimeout, err := parseTimeout(strategy.Progressive.ProgressDeadline)
if err != nil {
return &strategy, RolloutResult{}, err
}
Expand Down Expand Up @@ -183,7 +183,7 @@ func (r *RolloutHandler[T]) getProgressivePerGroupClusters(rolloutStrategy Rollo
}

// Parse timeout for non-mandatory decision groups
failureTimeout, err := parseTimeout(strategy.ProgressivePerGroup.Timeout.Timeout)
failureTimeout, err := parseTimeout(strategy.ProgressivePerGroup.ProgressDeadline)
if err != nil {
return &strategy, RolloutResult{}, err
}
Expand Down
Loading

0 comments on commit 4d738a1

Please sign in to comment.