Skip to content

Commit

Permalink
update addon develop guide (#411)
Browse files Browse the repository at this point in the history
Signed-off-by: haoqing0110 <[email protected]>
Signed-off-by: Qing Hao <[email protected]>
  • Loading branch information
haoqing0110 authored Jun 28, 2024
1 parent a3b4472 commit 2e98aa1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
25 changes: 21 additions & 4 deletions content/en/developer-guides/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ This page is a developer guide about how to build an OCM add-on using addon-fram

## Supported version

The OCM v0.13.0 supports addon-framework v0.8.0 and the above versions. We suggest using the latest release v0.9.0.
The OCM v0.14.0 requires addon-framework v0.8.1 and above versions.

And notice there's breaking changes in [automatic installation](#automatic-installation) in addon-framework version v0.10.0.

## Overview

Expand Down Expand Up @@ -366,9 +368,12 @@ We support 3 kinds of health prober types to monitor the healthiness of add-on a
### Automatic installation

NOTE:
- NOTE: This is deprecated since v0.12.0 and will be removed in the future. Please use the `InstallStrategy` in
- The automatic installation is no longer supported since addon-framework v0.10.0. Please use the `InstallStrategy` in
[Managing the add-on agent lifecycle by addon-manager](#managing-the-add-on-agent-lifecycle-by-addon-manager) section
instead.
- The automatic installation is still avaliable in addon-framework version v0.8.1 and v0.9.3, which is also the
minimal supported addon-framework version in OCM v0.14.0. Using the addon-framework v0.8.0 and previous version will
have install conficts.

In the busybox add-on example, you need to create a `ManagedClusterAddOn` CR to enable the add-on manually.
The addon-framework also provides a configuration called `InstallStrategy` to support installing addon automatically.
Expand Down Expand Up @@ -936,8 +941,8 @@ to support the scenarios mentioned above.
1. Modify the `go.mod` file to use the latest addon-framework and API versions.

```
open-cluster-management.io/addon-framework v0.9.0
open-cluster-management.io/api v0.13.0
open-cluster-management.io/addon-framework v0.9.3 // // or latest
open-cluster-management.io/api v0.13.0 // or latest
```
2. Remove the `WithInstallStrategy()` function described in the [automatic installation](#automatic-installation)
Expand All @@ -947,6 +952,18 @@ open-cluster-management.io/api v0.13.0
`addon.open-cluster-management.io/lifecycle: "addon-manager"` explicitly in the
`ClusterManagementAddOn`.
Skip this step for OCM v0.14.0 and later version. The annotation is automatically added by the general addon manager.
```yaml
apiVersion: addon.open-cluster-management.io/v1alpha1
kind: ClusterManagementAddOn
metadata:
name: helloworld
annotations:
addon.open-cluster-management.io/lifecycle: "addon-manager"
...
```

4. Define the `installStrategy` and `rolloutStrategy` in the `ClusterManagementAddOn`
as shown in the example above. Note that the rollout strategy is triggered by
changes in configurations, so if the addon does not have [supported cofingurations](#add-your-add-on-agent-supported-configurations),
Expand Down
25 changes: 21 additions & 4 deletions content/zh/developer-guides/addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ This page is a developer guide about how to build an OCM add-on using addon-fram

## Supported version

The OCM v0.13.0 supports addon-framework v0.8.0 and the above versions. We suggest using the latest release v0.9.0.
The OCM v0.14.0 requires addon-framework v0.8.1 and above versions.

And notice there's breaking changes in [automatic installation](#automatic-installation) in addon-framework version v0.10.0.

## Overview

Expand Down Expand Up @@ -366,9 +368,12 @@ We support 3 kinds of health prober types to monitor the healthiness of add-on a
### Automatic installation

NOTE:
- NOTE: This is deprecated since v0.12.0 and will be removed in the future. Please use the `InstallStrategy` in
- The automatic installation is no longer supported since addon-framework v0.10.0. Please use the `InstallStrategy` in
[Managing the add-on agent lifecycle by addon-manager](#managing-the-add-on-agent-lifecycle-by-addon-manager) section
instead.
- The automatic installation is still avaliable in addon-framework version v0.8.1 and v0.9.3, which is also the
minimal supported addon-framework version in OCM v0.14.0. Using the addon-framework v0.8.0 and previous version will
have install conficts.

In the busybox add-on example, you need to create a `ManagedClusterAddOn` CR to enable the add-on manually.
The addon-framework also provides a configuration called `InstallStrategy` to support installing addon automatically.
Expand Down Expand Up @@ -936,8 +941,8 @@ to support the scenarios mentioned above.
1. Modify the `go.mod` file to use the latest addon-framework and API versions.

```
open-cluster-management.io/addon-framework v0.9.0
open-cluster-management.io/api v0.13.0
open-cluster-management.io/addon-framework v0.9.3 // // or latest
open-cluster-management.io/api v0.13.0 // or latest
```
2. Remove the `WithInstallStrategy()` function described in the [automatic installation](#automatic-installation)
Expand All @@ -947,6 +952,18 @@ open-cluster-management.io/api v0.13.0
`addon.open-cluster-management.io/lifecycle: "addon-manager"` explicitly in the
`ClusterManagementAddOn`.
Skip this step for OCM v0.14.0 and later version. The annotation is automatically added by the general addon manager.
```yaml
apiVersion: addon.open-cluster-management.io/v1alpha1
kind: ClusterManagementAddOn
metadata:
name: helloworld
annotations:
addon.open-cluster-management.io/lifecycle: "addon-manager"
...
```

4. Define the `installStrategy` and `rolloutStrategy` in the `ClusterManagementAddOn`
as shown in the example above. Note that the rollout strategy is triggered by
changes in configurations, so if the addon does not have [supported cofingurations](#add-your-add-on-agent-supported-configurations),
Expand Down

0 comments on commit 2e98aa1

Please sign in to comment.