Skip to content

Commit 0146ddf

Browse files
authored
addon consume common rollout api (#260)
Signed-off-by: haoqing0110 <[email protected]>
1 parent d0a4952 commit 0146ddf

4 files changed

+121
-260
lines changed

addon/v1alpha1/0000_00_addon.open-cluster-management.io_clustermanagementaddons.crd.yaml

Lines changed: 118 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -139,108 +139,139 @@ spec:
139139
type: string
140140
rolloutStrategy:
141141
default:
142-
type: UpdateAll
142+
type: All
143143
description: The rollout strategy to apply addon configurations
144144
change. The rollout strategy only watches the addon configurations
145145
defined in ClusterManagementAddOn.
146146
properties:
147-
rollingUpdate:
148-
description: Rolling update with placement config params.
149-
Present only if the type is RollingUpdate.
147+
all:
148+
description: All define required fields for RolloutStrategy
149+
type All
150150
properties:
151-
maxConcurrency:
152-
anyOf:
153-
- type: integer
154-
- type: string
155-
default: 25%
156-
description: 'The maximum concurrently updating
157-
number of clusters. Value can be an absolute number
158-
(ex: 5) or a percentage of desired addons (ex:
159-
10%). Absolute number is calculated from percentage
160-
by rounding up. Defaults to 25%. Example: when
161-
this is set to 30%, once the addon configs change,
162-
the addon on 30% of the selected clusters will
163-
adopt the new configs. When the addons with new
164-
configs are healthy, the addon on the remaining
165-
clusters will be further updated.'
166-
x-kubernetes-int-or-string: true
151+
timeout:
152+
default: None
153+
description: Timeout define how long workload applier
154+
controller will wait till workload reach successful
155+
state in the cluster. Timeout default value is
156+
None meaning the workload applier will not proceed
157+
apply workload to other clusters if did not reach
158+
the successful state. Timeout must be defined
159+
in [0-9h]|[0-9m]|[0-9s] format examples; 2h ,
160+
90m , 360s
161+
pattern: ^(([0-9])+[h|m|s])|None$
162+
type: string
167163
type: object
168-
rollingUpdateWithCanary:
169-
description: Rolling update with placement config params.
170-
Present only if the type is RollingUpdateWithCanary.
164+
progressive:
165+
description: Progressive define required fields for
166+
RolloutStrategy type Progressive
171167
properties:
168+
mandatoryDecisionGroups:
169+
description: List of the decision groups names or
170+
indexes to apply the workload first and fail if
171+
workload did not reach successful state. GroupName
172+
or GroupIndex must match with the decisionGroups
173+
defined in the placement's decisionStrategy
174+
items:
175+
description: MandatoryDecisionGroup set the decision
176+
group name or group index. GroupName is considered
177+
first to select the decisionGroups then GroupIndex.
178+
properties:
179+
groupIndex:
180+
description: GroupIndex of the decision group
181+
should match the placementDecisions label
182+
value with label key cluster.open-cluster-management.io/decision-group-index
183+
format: int32
184+
type: integer
185+
groupName:
186+
description: GroupName of the decision group
187+
should match the placementDecisions label
188+
value with label key cluster.open-cluster-management.io/decision-group-name
189+
type: string
190+
type: object
191+
type: array
172192
maxConcurrency:
173193
anyOf:
174194
- type: integer
175195
- type: string
176-
default: 25%
177-
description: 'The maximum concurrently updating
178-
number of clusters. Value can be an absolute number
179-
(ex: 5) or a percentage of desired addons (ex:
180-
10%). Absolute number is calculated from percentage
181-
by rounding up. Defaults to 25%. Example: when
182-
this is set to 30%, once the addon configs change,
183-
the addon on 30% of the selected clusters will
184-
adopt the new configs. When the addons with new
185-
configs are healthy, the addon on the remaining
186-
clusters will be further updated.'
196+
description: MaxConcurrency is the max number of
197+
clusters to deploy workload concurrently. The
198+
default value for MaxConcurrency is determined
199+
from the clustersPerDecisionGroup defined in the
200+
placement->DecisionStrategy.
201+
pattern: ^((100|[0-9]{1,2})%|[0-9]+)$
187202
x-kubernetes-int-or-string: true
188-
placement:
189-
description: Canary placement reference.
190-
properties:
191-
name:
192-
description: Name is the name of the placement
193-
minLength: 1
194-
type: string
195-
namespace:
196-
description: Namespace is the namespace of the
197-
placement
198-
minLength: 1
199-
type: string
200-
required:
201-
- name
202-
- namespace
203-
type: object
204-
required:
205-
- placement
203+
timeout:
204+
default: None
205+
description: Timeout define how long workload applier
206+
controller will wait till workload reach successful
207+
state in the cluster. Timeout default value is
208+
None meaning the workload applier will not proceed
209+
apply workload to other clusters if did not reach
210+
the successful state. Timeout must be defined
211+
in [0-9h]|[0-9m]|[0-9s] format examples; 2h ,
212+
90m , 360s
213+
pattern: ^(([0-9])+[h|m|s])|None$
214+
type: string
215+
type: object
216+
progressivePerGroup:
217+
description: ProgressivePerGroup define required fields
218+
for RolloutStrategy type ProgressivePerGroup
219+
properties:
220+
mandatoryDecisionGroups:
221+
description: List of the decision groups names or
222+
indexes to apply the workload first and fail if
223+
workload did not reach successful state. GroupName
224+
or GroupIndex must match with the decisionGroups
225+
defined in the placement's decisionStrategy
226+
items:
227+
description: MandatoryDecisionGroup set the decision
228+
group name or group index. GroupName is considered
229+
first to select the decisionGroups then GroupIndex.
230+
properties:
231+
groupIndex:
232+
description: GroupIndex of the decision group
233+
should match the placementDecisions label
234+
value with label key cluster.open-cluster-management.io/decision-group-index
235+
format: int32
236+
type: integer
237+
groupName:
238+
description: GroupName of the decision group
239+
should match the placementDecisions label
240+
value with label key cluster.open-cluster-management.io/decision-group-name
241+
type: string
242+
type: object
243+
type: array
244+
timeout:
245+
default: None
246+
description: Timeout define how long workload applier
247+
controller will wait till workload reach successful
248+
state in the cluster. Timeout default value is
249+
None meaning the workload applier will not proceed
250+
apply workload to other clusters if did not reach
251+
the successful state. Timeout must be defined
252+
in [0-9h]|[0-9m]|[0-9s] format examples; 2h ,
253+
90m , 360s
254+
pattern: ^(([0-9])+[h|m|s])|None$
255+
type: string
206256
type: object
207257
type:
208-
default: UpdateAll
209-
description: "Type is the type of the rollout strategy,
210-
it supports UpdateAll, RollingUpdate and RollingUpdateWithCanary:
211-
- UpdateAll: when configs change, apply the new configs
212-
to all the selected clusters at once. This is the
213-
default strategy. - RollingUpdate: when configs change,
214-
apply the new configs to all the selected clusters
215-
with the concurrence rate defined in MaxConcurrency.
216-
- RollingUpdateWithCanary: when configs change, wait
217-
and check if add-ons on the canary placement selected
218-
clusters have applied the new configs and are healthy,
219-
then apply the new configs to all the selected clusters
220-
with the concurrence rate defined in MaxConcurrency.
221-
\n The field lastKnownGoodConfig in the status record
222-
the last successfully applied spec hash of canary
223-
placement. If the config spec hash changes after the
224-
canary is passed and before the rollout is done, the
225-
current rollout will continue, then roll out to the
226-
latest change. \n For example, the addon configs have
227-
spec hash A. The canary is passed and the lastKnownGoodConfig
228-
would be A, and all the selected clusters are rolling
229-
out to A. Then the config spec hash changes to B.
230-
At this time, the clusters will continue rolling out
231-
to A. When the rollout is done and canary passed B,
232-
the lastKnownGoodConfig would be B and all the clusters
233-
will start rolling out to B. \n The canary placement
234-
does not have to be a subset of the install placement,
235-
and it is more like a reference for finding and checking
236-
canary clusters before upgrading all. To trigger the
237-
rollout on the canary clusters, you can define another
238-
rollout strategy with the type RollingUpdate, or even
239-
manually upgrade the addons on those clusters."
258+
default: All
259+
description: Rollout strategy Types are All, Progressive
260+
and ProgressivePerGroup 1) All means apply the workload
261+
to all clusters in the decision groups at once. 2)
262+
Progressive means apply the workload to the selected
263+
clusters progressively per cluster. The workload will
264+
not be applied to the next cluster unless one of the
265+
current applied clusters reach the successful state
266+
or timeout. 3) ProgressivePerGroup means apply the
267+
workload to decisionGroup clusters progressively per
268+
group. The workload will not be applied to the next
269+
decisionGroup unless all clusters in the current group
270+
reach the successful state or timeout.
240271
enum:
241-
- UpdateAll
242-
- RollingUpdate
243-
- RollingUpdateWithCanary
272+
- All
273+
- Progressive
274+
- ProgressivePerGroup
244275
type: string
245276
type: object
246277
required:

0 commit comments

Comments
 (0)