From b956a9c94f419576ca5ec3d212524e9042b3d6b4 Mon Sep 17 00:00:00 2001 From: haoqing0110 Date: Thu, 9 Nov 2023 16:35:34 +0800 Subject: [PATCH] update addon rollout api Signed-off-by: haoqing0110 --- content/en/concepts/addon.md | 21 ++++++++++++++++----- content/en/developer-guides/addon.md | 23 ++++++++++++++--------- content/zh/concepts/addon.md | 21 ++++++++++++++++----- content/zh/developer-guides/addon.md | 23 ++++++++++++++--------- 4 files changed, 60 insertions(+), 28 deletions(-) diff --git a/content/en/concepts/addon.md b/content/en/concepts/addon.md index 37229a7d..0546481f 100644 --- a/content/en/concepts/addon.md +++ b/content/en/concepts/addon.md @@ -3,6 +3,12 @@ title: Add-ons weight: 4 --- + + +{{< toc >}} + + + ## What is an add-on? Open-cluster-management has a built-in mechanism named [addon-framework](https://github.com/open-cluster-management-io/addon-framework) @@ -184,8 +190,9 @@ control the upgrade behavior of the addon when there are changes in the supporte configurations. For example, if the add-on user updates the "deploy-config" and wants to apply -the change to the add-ons at a rate of 25%. If with 100 clusters, 25 clusters will -apply the change each time. The rollout strategy can be defined as follows: +the change to the add-ons to a "canary" [decision group](https://open-cluster-management.io/concepts/placement/#decision-strategy) first. If all the add-on +upgrade successfully, then upgrade the rest of clusters progressively per cluster +at a rate of 25%. The rollout strategy can be defined as follows: ```yaml apiVersion: addon.open-cluster-management.io/v1alpha1 @@ -208,11 +215,15 @@ spec: name: deploy-config namespace: open-cluster-management rolloutStrategy: - type: RollingUpdate - rollingUpdate: - maxConcurrentlyUpdating: 25% + type: Progressive + progressive: + mandatoryDecisionGroups: + - groupName: "canary" + maxConcurrency: 25% ``` +Current add-on supports 3 types of rollout strategy, they are All, Progressive and ProgressivePerGroup, refer to the [API definition](https://github.com/open-cluster-management-io/api/blob/main/cluster/v1alpha1/types_rolloutstrategy.go) for more details. + ### Add-on healthiness The healthiness of the addon instances are visible when we list the addons via diff --git a/content/en/developer-guides/addon.md b/content/en/developer-guides/addon.md index 43ea6415..5f4b2a9f 100644 --- a/content/en/developer-guides/addon.md +++ b/content/en/developer-guides/addon.md @@ -865,9 +865,10 @@ spec: With the rollout strategy defined in the `ClusterManagementAddOn` API, users can control the upgrade behavior of the add-on when there are changes in the [supported configurations](#add-your-add-on-agent-supported-configurations). -For example, if the add-on user updates the "deploy-config" and wants to apply -the change to the add-ons at a rate of 25%. If with 100 clusters, 25 clusters will -apply the change each time. +For example, if the add-on user updates the "deploy-config" and wants to apply +the change to the add-ons to a "canary" [decision group](https://open-cluster-management.io/concepts/placement/#decision-strategy) first. +If all the add-on upgrade successfully, then upgrade the rest of clusters progressively per cluster +at a rate of 25%. The rollout strategy can be defined as follows: ```yaml apiVersion: addon.open-cluster-management.io/v1alpha1 @@ -890,9 +891,11 @@ spec: name: deploy-config namespace: open-cluster-management rolloutStrategy: - type: RollingUpdate - rollingUpdate: - maxConcurrentlyUpdating: 25% + type: Progressive + progressive: + mandatoryDecisionGroups: + - groupName: "canary" + maxConcurrency: 25% ``` The latest addon-framework already implements the installStrategy and rolloutStrategy. @@ -902,8 +905,8 @@ the `go.mod` file with a minor code change to support the scenarios mentioned ab 1. Modify the `go.mod` file to use the latest addon-framework and API versions. ``` -open-cluster-management.io/addon-framework v0.7.0 -open-cluster-management.io/api v0.11.0 +open-cluster-management.io/addon-framework v0.8.0 +open-cluster-management.io/api v0.12.0 ``` 2. Remove the `WithInstallStrategy()` function described in the [automatic installation](#automatic-installation) @@ -912,7 +915,9 @@ open-cluster-management.io/api v0.11.0 With the above changes, you can now enable the "AddonManagement" feature gates in `ClusterManager` and let the new component `addon-manager` manage the add-ons. -3. Enable the "AddonManagement" feature gates in `ClusterManager` as shown below. +3. Enable the "AddonManagement" feature gates in `ClusterManager` as shown below. + +Skip this step for OCM v0.12.0 and later version. ```yaml apiVersion: operator.open-cluster-management.io/v1 diff --git a/content/zh/concepts/addon.md b/content/zh/concepts/addon.md index b4bcc51b..a50c11cd 100644 --- a/content/zh/concepts/addon.md +++ b/content/zh/concepts/addon.md @@ -3,6 +3,12 @@ title: 自定义插件 weight: 4 --- + + +{{< toc >}} + + + ## What is an add-on? Open-cluster-management has a built-in mechanism named [addon-framework](https://github.com/open-cluster-management-io/addon-framework) @@ -184,8 +190,9 @@ control the upgrade behavior of the addon when there are changes in the supporte configurations. For example, if the add-on user updates the "deploy-config" and wants to apply -the change to the add-ons at a rate of 25%. If with 100 clusters, 25 clusters will -apply the change each time. The rollout strategy can be defined as follows: +the change to the add-ons to a "canary" [decision group](https://open-cluster-management.io/concepts/placement/#decision-strategy) first. If all the add-on +upgrade successfully, then upgrade the rest of clusters progressively per cluster +at a rate of 25%. The rollout strategy can be defined as follows: ```yaml apiVersion: addon.open-cluster-management.io/v1alpha1 @@ -208,11 +215,15 @@ spec: name: deploy-config namespace: open-cluster-management rolloutStrategy: - type: RollingUpdate - rollingUpdate: - maxConcurrentlyUpdating: 25% + type: Progressive + progressive: + mandatoryDecisionGroups: + - groupName: "canary" + maxConcurrency: 25% ``` +Current add-on supports 3 types of rollout strategy, they are All, Progressive and ProgressivePerGroup, refer to the [API definition](https://github.com/open-cluster-management-io/api/blob/main/cluster/v1alpha1/types_rolloutstrategy.go) for more details. + ### Add-on healthiness The healthiness of the addon instances are visible when we list the addons via diff --git a/content/zh/developer-guides/addon.md b/content/zh/developer-guides/addon.md index 43ea6415..5f4b2a9f 100644 --- a/content/zh/developer-guides/addon.md +++ b/content/zh/developer-guides/addon.md @@ -865,9 +865,10 @@ spec: With the rollout strategy defined in the `ClusterManagementAddOn` API, users can control the upgrade behavior of the add-on when there are changes in the [supported configurations](#add-your-add-on-agent-supported-configurations). -For example, if the add-on user updates the "deploy-config" and wants to apply -the change to the add-ons at a rate of 25%. If with 100 clusters, 25 clusters will -apply the change each time. +For example, if the add-on user updates the "deploy-config" and wants to apply +the change to the add-ons to a "canary" [decision group](https://open-cluster-management.io/concepts/placement/#decision-strategy) first. +If all the add-on upgrade successfully, then upgrade the rest of clusters progressively per cluster +at a rate of 25%. The rollout strategy can be defined as follows: ```yaml apiVersion: addon.open-cluster-management.io/v1alpha1 @@ -890,9 +891,11 @@ spec: name: deploy-config namespace: open-cluster-management rolloutStrategy: - type: RollingUpdate - rollingUpdate: - maxConcurrentlyUpdating: 25% + type: Progressive + progressive: + mandatoryDecisionGroups: + - groupName: "canary" + maxConcurrency: 25% ``` The latest addon-framework already implements the installStrategy and rolloutStrategy. @@ -902,8 +905,8 @@ the `go.mod` file with a minor code change to support the scenarios mentioned ab 1. Modify the `go.mod` file to use the latest addon-framework and API versions. ``` -open-cluster-management.io/addon-framework v0.7.0 -open-cluster-management.io/api v0.11.0 +open-cluster-management.io/addon-framework v0.8.0 +open-cluster-management.io/api v0.12.0 ``` 2. Remove the `WithInstallStrategy()` function described in the [automatic installation](#automatic-installation) @@ -912,7 +915,9 @@ open-cluster-management.io/api v0.11.0 With the above changes, you can now enable the "AddonManagement" feature gates in `ClusterManager` and let the new component `addon-manager` manage the add-ons. -3. Enable the "AddonManagement" feature gates in `ClusterManager` as shown below. +3. Enable the "AddonManagement" feature gates in `ClusterManager` as shown below. + +Skip this step for OCM v0.12.0 and later version. ```yaml apiVersion: operator.open-cluster-management.io/v1