Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update addon rollout api #396

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions content/en/concepts/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: Add-ons
weight: 4
---

<!-- spellchecker-disable -->

{{< toc >}}

<!-- spellchecker-enable -->

## 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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
23 changes: 14 additions & 9 deletions content/en/developer-guides/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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)
Expand All @@ -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
Expand Down
21 changes: 16 additions & 5 deletions content/zh/concepts/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: 自定义插件
weight: 4
---

<!-- spellchecker-disable -->

{{< toc >}}

<!-- spellchecker-enable -->

## 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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
23 changes: 14 additions & 9 deletions content/zh/developer-guides/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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)
Expand All @@ -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
Expand Down
Loading