Skip to content

Commit aab6cc7

Browse files
authored
Update Application Management Addon to use the new Argo CD Addon (#472)
Signed-off-by: Mike Ng <[email protected]>
1 parent 0e66ccf commit aab6cc7

File tree

2 files changed

+89
-88
lines changed

2 files changed

+89
-88
lines changed

content/en/docs/developer-guides/addon.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ We have some available add-ons in the OCM community:
4646

4747
* [cluster-proxy](https://github.com/open-cluster-management-io/cluster-proxy)
4848
* [managed-serviceaccount](https://github.com/open-cluster-management-io/managed-serviceaccount)
49-
* [application-manager](https://github.com/open-cluster-management-io/multicloud-operators-subscription)
49+
* [argocd-pull-integration](https://github.com/open-cluster-management-io/argocd-pull-integration)
5050
* [config-policy-controller](https://github.com/open-cluster-management-io/governance-policy-addon-controller)
5151
* [governance-policy-framework](https://github.com/open-cluster-management-io/governance-policy-addon-controller)
5252

content/en/docs/getting-started/integration/app-lifecycle.md

Lines changed: 88 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -3,141 +3,142 @@ title: Application lifecycle management
33
weight: 5
44
---
55

6-
After the cluster manager is installed, you could install the application management components to the hub cluster.
6+
After the setup of Open Cluster Management (OCM) hub and managed clusters,
7+
you could install the OCM built-in application management add-on.
8+
The OCM application management add-on leverages the
9+
[Argo CD](https://argo-cd.readthedocs.io/)
10+
to provide declarative GitOps based application lifecycle management across multiple Kubernetes clusters.
711

12+
## Architecture
813

14+
Traditional Argo CD resource delivery primarily uses a push model,
15+
where resources are deployed from a centralized Argo CD instance to remote or managed clusters.
916

10-
## Architecture
17+
<div style="text-align: center; padding: 20px;">
18+
<img src="https://github.com/open-cluster-management-io/argocd-pull-integration/raw/main/assets/push.png" alt="Argo CD Push Model" style="margin: 0 auto; width: 80%">
19+
</div>
20+
21+
With the OCM Argo CD add-on, users can leverage a pull based resource delivery model,
22+
where managed clusters pull and apply application configurations.
1123

1224
<div style="text-align: center; padding: 20px;">
13-
<img src="https://github.com/open-cluster-management-io/multicloud-operators-subscription/raw/main/images/architecture.png" alt="application lifecycle management architecture" style="margin: 0 auto; width: 80%">
25+
<img src="https://github.com/open-cluster-management-io/argocd-pull-integration/raw/main/assets/pull.png" alt="Argo CD Pull Model" style="margin: 0 auto; width: 80%">
1426
</div>
1527

16-
For more details, visit the [multicloud-operators-subscription GitHub page](https://github.com/open-cluster-management-io/multicloud-operators-subscription).
28+
For more details, visit the
29+
[Argo CD Pull Integration GitHub page](https://github.com/open-cluster-management-io/argocd-pull-integration).
1730

1831
## Prerequisite
1932

2033
You must meet the following prerequisites to install the application lifecycle management add-on:
2134

22-
- Ensure [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) and [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/) are installed.
35+
- Ensure [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl) are installed.
36+
37+
- Ensure the OCM _cluster manager_ is installed. See [Start the control plane]({{< ref "docs/getting-started/installation/start-the-control-plane" >}}) for more information.
2338

24-
- Ensure the `open-cluster-management` _cluster manager_ is installed. See [Start the control plane]({{< ref "docs/getting-started/installation/start-the-control-plane" >}}) for more information.
39+
- Ensure the OCM _klusterlet_ is installed. See [Register a cluster]({{< ref "docs/getting-started/installation/register-a-cluster" >}}) for more information.
2540

26-
- Ensure the `open-cluster-management` _klusterlet_ is installed. See [Register a cluster]({{< ref "docs/getting-started/installation/register-a-cluster" >}}) for more information.
41+
- Ensure `clusteradm` CLI tool is installed. Download and extract the [clusteradm binary](https://github.com/open-cluster-management-io/clusteradm/releases/latest). For more details see the [clusteradm GitHub page](https://github.com/open-cluster-management-io/clusteradm/blob/main/README.md#quick-start).
2742

28-
## Install via Clusteradm CLI tool
43+
## Installation
2944

30-
Ensure `clusteradm` CLI tool is installed. Download and extract the [clusteradm binary](https://github.com/open-cluster-management-io/clusteradm/releases/latest). For more details see the [clusteradm GitHub page](https://github.com/open-cluster-management-io/clusteradm/blob/main/README.md#quick-start).
45+
Install Argo CD on the Hub cluster:
3146

32-
```Shell
33-
$ clusteradm
34-
Usage:
35-
clusteradm [command]
36-
...
47+
```shell
48+
kubectl create namespace argocd
49+
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
3750
```
3851

39-
Deploy the subscription operators to the hub cluster.
52+
See [Argo CD website](https://argo-cd.readthedocs.io/en/stable/getting_started/) for more details.
4053

41-
```Shell
42-
$ kubectl config use-context ${CTX_HUB_CLUSTER}
43-
$ clusteradm install hub-addon --names application-manager
44-
Installing built-in application-manager add-on to the Hub cluster...
45-
$ kubectl -n open-cluster-management get deploy multicluster-operators-subscription --context ${CTX_HUB_CLUSTER}
46-
NAME READY UP-TO-DATE AVAILABLE AGE
47-
multicluster-operators-subscription 1/1 1 1 25s
48-
```
49-
Create the `open-cluster-management-agent-addon` namespace on the managed cluster.
54+
Install the OCM Argo CD add-on on the Hub cluster:
5055

51-
```Shell
52-
$ kubectl create ns open-cluster-management-agent-addon --context ${CTX_MANAGED_CLUSTER}
53-
namespace/open-cluster-management-agent-addon created
56+
```shell
57+
clusteradm install hub-addon --names argocd
5458
```
5559

56-
Deploy the subscription add-on in corresponding managed cluster namespace on the hub cluster.
60+
If your hub controller starts successfully, you should see:
5761

58-
```Shell
59-
$ kubectl config use-context ${CTX_HUB_CLUSTER}
60-
$ clusteradm addon enable --names application-manager --clusters ${MANAGED_CLUSTER_NAME}
61-
Deploying application-manager add-on to managed cluster: <managed_cluster_name>.
62-
$ kubectl -n ${MANAGED_CLUSTER_NAME} get managedclusteraddon # kubectl -n cluster1 get managedclusteraddon
63-
NAME AVAILABLE DEGRADED PROGRESSING
64-
application-manager True
62+
```shell
63+
$ kubectl -n argocd get deploy argocd-pull-integration
64+
NAME READY UP-TO-DATE AVAILABLE AGE
65+
argocd-pull-integration 1/1 1 1 55s
6566
```
6667

67-
Check the the subscription add-on deployment on the managed cluster.
68+
Enable the add-on for your choice of Managed clusters:
6869

69-
```Shell
70-
$ kubectl -n open-cluster-management-agent-addon get deploy --context ${CTX_MANAGED_CLUSTER}
71-
NAME READY UP-TO-DATE AVAILABLE AGE
72-
application-manager 1/1 1 1 103s
70+
```shell
71+
clusteradm addon enable --names argocd --clusters cluster1,cluster2
7372
```
7473

75-
## Install from source
74+
Replace `cluster1` and `cluster2` with your Managed cluster names.
7675

77-
Clone the `multicloud-operators-subscription` repository.
76+
If your add-on starts successfully, you should see:
7877

79-
```Shell
80-
git clone https://github.com/open-cluster-management-io/multicloud-operators-subscription
81-
cd multicloud-operators-subscription
78+
```shell
79+
$ kubectl -n cluster1 get managedclusteraddon argocd
80+
NAME AVAILABLE DEGRADED PROGRESSING
81+
argocd True False
8282
```
8383

84-
Deploy the subscription operators to the hub cluster.
84+
On the Hub cluster, apply the example `guestbook-app-set` manifest:
8585

86-
```Shell
87-
$ kubectl config use-context ${CTX_HUB_CLUSTER}
88-
$ make deploy-hub
89-
$ kubectl -n open-cluster-management get deploy multicluster-operators-subscription --context ${CTX_HUB_CLUSTER}
90-
NAME READY UP-TO-DATE AVAILABLE AGE
91-
multicluster-operators-subscription 1/1 1 1 25s
86+
```shell
87+
kubectl apply -f https://raw.githubusercontent.com/open-cluster-management-io/ocm/refs/heads/main/solutions/deploy-argocd-apps-pull/example/guestbook-app-set.yaml
9288
```
9389

94-
Create the `open-cluster-management-agent-addon` namespace on the managed cluster and it's optional if `clusteradm` is used which create the ns during `join` action.
90+
**Note:** The Application template inside the ApplicationSet must contain the following content:
9591

96-
```Shell
97-
$ kubectl create ns open-cluster-management-agent-addon --context ${CTX_MANAGED_CLUSTER}
98-
namespace/open-cluster-management-agent-addon created
92+
```shell
93+
labels:
94+
apps.open-cluster-management.io/pull-to-ocm-managed-cluster: 'true'
95+
annotations:
96+
argocd.argoproj.io/skip-reconcile: 'true'
97+
apps.open-cluster-management.io/ocm-managed-cluster: '{{name}}'
9998
```
10099

101-
Deploy the subscription add-on in corresponding managed cluster namespace on the hub cluster.
100+
The label allows the pull model controller to select the Application for processing.
102101

103-
```Shell
104-
$ kubectl config use-context ${CTX_HUB_CLUSTER}
105-
$ make deploy-addon
106-
$ kubectl -n ${MANAGED_CLUSTER_NAME} get managedclusteraddon # kubectl -n cluster1 get managedclusteraddon
107-
NAME AVAILABLE DEGRADED PROGRESSING
108-
application-manager True
109-
```
102+
The `skip-reconcile` annotation is to prevent the Application from reconciling on the Hub cluster.
110103

111-
Check the the subscription add-on deployment on the managed cluster.
104+
The `ocm-managed-cluster` annotation is for the ApplicationSet to generate multiple Application based on each cluster generator targets.
112105

113-
```Shell
114-
$ kubectl -n open-cluster-management-agent-addon get deploy --context ${CTX_MANAGED_CLUSTER}
115-
NAME READY UP-TO-DATE AVAILABLE AGE
116-
application-manager 1/1 1 1 103s
117-
```
106+
When this guestbook ApplicationSet reconciles, it will generate an Application for the registered Managed clusters. For example:
118107

119-
## What is next
108+
```shell
109+
$ kubectl -n argocd get appset
110+
NAME AGE
111+
guestbook-app 84s
112+
$ kubectl -n argocd get app
113+
NAME SYNC STATUS HEALTH STATUS
114+
cluster1-guestbook-app
115+
cluster2-guestbook-app
116+
```
120117

121-
After a successful deployment, test the subscription operator with a `helm` subscription. Run the following command where the examples/helmrepo-hub-channel locates at [here](https://github.com/open-cluster-management-io/multicloud-operators-subscription/tree/main/examples/helmrepo-hub-channel):
118+
On the Hub cluster, the pull controller will wrap the Application with a ManifestWork. For example:
122119

123-
```Shell
124-
kubectl apply -f examples/helmrepo-hub-channel --context ${CTX_HUB_CLUSTER}
120+
```shell
121+
$ kubectl -n cluster1 get manifestwork
122+
NAME AGE
123+
cluster1-guestbook-app-d0e5 2m41s
125124
```
126125

127-
After a while, you should see the subscription is propagated to the managed cluster and the Helm app is installed. By default, when a subscribed applications is deployed to the target clusters, the applications are installed in the coresponding subscription namespace. To confirm, run the following command:
126+
On a Managed cluster, you should see that the Application is pulled down successfully. For example:
128127

129-
```Shell
130-
$ kubectl get subscriptions.apps --context ${CTX_MANAGED_CLUSTER}
131-
NAME STATUS AGE LOCAL PLACEMENT TIME WINDOW
132-
nginx-sub Subscribed 107m true
133-
$ kubectl get pod --context ${CTX_MANAGED_CLUSTER}
134-
NAME READY STATUS RESTARTS AGE
135-
nginx-ingress-47f79-controller-6f495bb5f9-lpv7z 1/1 Running 0 108m
136-
nginx-ingress-47f79-default-backend-7559599b64-rhwgm 1/1 Running 0 108m
128+
```shell
129+
$ kubectl -n argocd get app
130+
NAME SYNC STATUS HEALTH STATUS
131+
cluster1-guestbook-app Synced Healthy
132+
$ kubectl -n guestbook get deploy
133+
NAME READY UP-TO-DATE AVAILABLE AGE
134+
guestbook-ui 1/1 1 1 7m36s
137135
```
138136

139-
### Try this out
140-
141-
Let [VScode Extension]({{< ref "docs/developer-guides/vscode-extension" >}}) help you out!
137+
On the Hub cluster, the status controller will sync the dormant Application with the ManifestWork status feedback. For example:
142138

143-
Create a Bootstrap Project specifically tailored to your channel type, with all the Custom Resource (CR) templates you will need already auto-generated to get you started!
139+
```shell
140+
$ kubectl -n argocd get app
141+
NAME SYNC STATUS HEALTH STATUS
142+
cluster1-guestbook-app Synced Healthy
143+
cluster2-guestbook-app Synced Healthy
144+
```

0 commit comments

Comments
 (0)