Skip to content

Commit

Permalink
addon consume common rollout api (#260)
Browse files Browse the repository at this point in the history
Signed-off-by: haoqing0110 <qhao@redhat.com>
  • Loading branch information
haoqing0110 authored Sep 19, 2023
1 parent d0a4952 commit 0146ddf
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 260 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,108 +139,139 @@ spec:
type: string
rolloutStrategy:
default:
type: UpdateAll
type: All
description: The rollout strategy to apply addon configurations
change. The rollout strategy only watches the addon configurations
defined in ClusterManagementAddOn.
properties:
rollingUpdate:
description: Rolling update with placement config params.
Present only if the type is RollingUpdate.
all:
description: All define required fields for RolloutStrategy
type All
properties:
maxConcurrency:
anyOf:
- type: integer
- type: string
default: 25%
description: 'The maximum concurrently updating
number of clusters. Value can be an absolute number
(ex: 5) or a percentage of desired addons (ex:
10%). Absolute number is calculated from percentage
by rounding up. Defaults to 25%. Example: when
this is set to 30%, once the addon configs change,
the addon on 30% of the selected clusters will
adopt the new configs. When the addons with new
configs are healthy, the addon on the remaining
clusters will be further updated.'
x-kubernetes-int-or-string: true
timeout:
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
pattern: ^(([0-9])+[h|m|s])|None$
type: string
type: object
rollingUpdateWithCanary:
description: Rolling update with placement config params.
Present only if the type is RollingUpdateWithCanary.
progressive:
description: Progressive define required fields for
RolloutStrategy type Progressive
properties:
mandatoryDecisionGroups:
description: List of the decision groups names or
indexes to apply the workload first and fail if
workload did not reach successful state. GroupName
or GroupIndex must match with the decisionGroups
defined in the placement's decisionStrategy
items:
description: MandatoryDecisionGroup set the decision
group name or group index. GroupName is considered
first to select the decisionGroups then GroupIndex.
properties:
groupIndex:
description: GroupIndex of the decision group
should match the placementDecisions label
value with label key cluster.open-cluster-management.io/decision-group-index
format: int32
type: integer
groupName:
description: GroupName of the decision group
should match the placementDecisions label
value with label key cluster.open-cluster-management.io/decision-group-name
type: string
type: object
type: array
maxConcurrency:
anyOf:
- type: integer
- type: string
default: 25%
description: 'The maximum concurrently updating
number of clusters. Value can be an absolute number
(ex: 5) or a percentage of desired addons (ex:
10%). Absolute number is calculated from percentage
by rounding up. Defaults to 25%. Example: when
this is set to 30%, once the addon configs change,
the addon on 30% of the selected clusters will
adopt the new configs. When the addons with new
configs are healthy, the addon on the remaining
clusters will be further updated.'
description: MaxConcurrency is the max number of
clusters to deploy workload concurrently. The
default value for MaxConcurrency is determined
from the clustersPerDecisionGroup defined in the
placement->DecisionStrategy.
pattern: ^((100|[0-9]{1,2})%|[0-9]+)$
x-kubernetes-int-or-string: true
placement:
description: Canary placement reference.
properties:
name:
description: Name is the name of the placement
minLength: 1
type: string
namespace:
description: Namespace is the namespace of the
placement
minLength: 1
type: string
required:
- name
- namespace
type: object
required:
- placement
timeout:
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
pattern: ^(([0-9])+[h|m|s])|None$
type: string
type: object
progressivePerGroup:
description: ProgressivePerGroup define required fields
for RolloutStrategy type ProgressivePerGroup
properties:
mandatoryDecisionGroups:
description: List of the decision groups names or
indexes to apply the workload first and fail if
workload did not reach successful state. GroupName
or GroupIndex must match with the decisionGroups
defined in the placement's decisionStrategy
items:
description: MandatoryDecisionGroup set the decision
group name or group index. GroupName is considered
first to select the decisionGroups then GroupIndex.
properties:
groupIndex:
description: GroupIndex of the decision group
should match the placementDecisions label
value with label key cluster.open-cluster-management.io/decision-group-index
format: int32
type: integer
groupName:
description: GroupName of the decision group
should match the placementDecisions label
value with label key cluster.open-cluster-management.io/decision-group-name
type: string
type: object
type: array
timeout:
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
pattern: ^(([0-9])+[h|m|s])|None$
type: string
type: object
type:
default: UpdateAll
description: "Type is the type of the rollout strategy,
it supports UpdateAll, RollingUpdate and RollingUpdateWithCanary:
- UpdateAll: when configs change, apply the new configs
to all the selected clusters at once. This is the
default strategy. - RollingUpdate: when configs change,
apply the new configs to all the selected clusters
with the concurrence rate defined in MaxConcurrency.
- RollingUpdateWithCanary: when configs change, wait
and check if add-ons on the canary placement selected
clusters have applied the new configs and are healthy,
then apply the new configs to all the selected clusters
with the concurrence rate defined in MaxConcurrency.
\n The field lastKnownGoodConfig in the status record
the last successfully applied spec hash of canary
placement. If the config spec hash changes after the
canary is passed and before the rollout is done, the
current rollout will continue, then roll out to the
latest change. \n For example, the addon configs have
spec hash A. The canary is passed and the lastKnownGoodConfig
would be A, and all the selected clusters are rolling
out to A. Then the config spec hash changes to B.
At this time, the clusters will continue rolling out
to A. When the rollout is done and canary passed B,
the lastKnownGoodConfig would be B and all the clusters
will start rolling out to B. \n The canary placement
does not have to be a subset of the install placement,
and it is more like a reference for finding and checking
canary clusters before upgrading all. To trigger the
rollout on the canary clusters, you can define another
rollout strategy with the type RollingUpdate, or even
manually upgrade the addons on those clusters."
default: All
description: Rollout strategy Types are All, Progressive
and ProgressivePerGroup 1) All means apply the workload
to all clusters in the decision groups at once. 2)
Progressive means apply the workload to the selected
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.
enum:
- UpdateAll
- RollingUpdate
- RollingUpdateWithCanary
- All
- Progressive
- ProgressivePerGroup
type: string
type: object
required:
Expand Down
Loading

0 comments on commit 0146ddf

Please sign in to comment.