Skip to content

Commit 6455c7f

Browse files
authored
AppLifecycle: Add basic vs advanced pull model documentation (#536)
Document both argocd (basic) and argocd-agent (advanced) pull model options with comparison table and installation instructions for each. Signed-off-by: Mike Ng <ming@redhat.com>
1 parent 923b1f1 commit 6455c7f

File tree

1 file changed

+140
-12
lines changed

1 file changed

+140
-12
lines changed

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

Lines changed: 140 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@ where resources are deployed from a centralized Argo CD instance to remote or ma
1818
<img src="https://github.com/open-cluster-management-io/ocm/raw/main/solutions/deploy-argocd-apps-pull/assets/push.png" alt="Argo CD Push Model" style="margin: 0 auto; width: 80%">
1919
</div>
2020

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.
21+
With the OCM Argo CD add-ons, users can leverage a pull based resource delivery model,
22+
where managed clusters pull and apply application configurations. OCM provides two pull model options:
2323

24-
<div style="text-align: center; padding: 20px;">
25-
<img src="https://github.com/open-cluster-management-io/ocm/raw/main/solutions/deploy-argocd-apps-pull/assets/pull.png" alt="Argo CD Pull Model" style="margin: 0 auto; width: 80%">
26-
</div>
24+
| Feature | Basic Pull Model (`argocd`) | Advanced Pull Model (`argocd-agent`) |
25+
|---------|----------------------------|--------------------------------------|
26+
| **How it works** | Wraps Applications in ManifestWork, distributed via OCM agent | Direct gRPC communication between hub principal and managed agents |
27+
| **Argo CD on hub** | Full Argo CD instance required | Argo CD + Agent Principal |
28+
| **Argo CD on managed** | Local Argo CD controller | Argo CD Agent + controller/repo-server |
29+
| **Status feedback** | Basic status via ManifestWork | Full status sync via gRPC |
30+
| **Load Balancer** | Not required | Required on hub cluster |
31+
| **Use Case** | Simpler setup, moderate scale | Large fleets, full Argo CD UI integration |
2732

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

3135
## Prerequisites
3236

@@ -40,9 +44,11 @@ You must meet the following prerequisites to install the application lifecycle m
4044

4145
- 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).
4246

43-
## Installation
47+
## Basic Pull Model Installation
4448

45-
Install Argo CD on the Hub cluster:
49+
The basic pull model uses the standard Argo CD with a lightweight integration controller.
50+
51+
### Install Argo CD on the Hub cluster
4652

4753
```shell
4854
kubectl create namespace argocd
@@ -51,7 +57,7 @@ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/st
5157

5258
See [Argo CD website](https://argo-cd.readthedocs.io/en/stable/getting_started/) for more details.
5359

54-
Install the OCM Argo CD add-on on the Hub cluster:
60+
### Install the OCM Argo CD add-on
5561

5662
```shell
5763
clusteradm install hub-addon --names argocd
@@ -65,7 +71,7 @@ NAME READY UP-TO-DATE AVAILABLE AGE
6571
argocd-pull-integration 1/1 1 1 55s
6672
```
6773

68-
Enable the add-on for your choice of Managed clusters:
74+
### Enable the add-on for Managed clusters
6975

7076
```shell
7177
clusteradm addon enable --names argocd --clusters cluster1,cluster2
@@ -81,6 +87,8 @@ NAME AVAILABLE DEGRADED PROGRESSING
8187
argocd True False
8288
```
8389

90+
### Deploy Applications
91+
8492
On the Hub cluster, apply the example `guestbook-app-set` manifest:
8593

8694
```shell
@@ -89,7 +97,7 @@ kubectl apply -f https://raw.githubusercontent.com/open-cluster-management-io/oc
8997

9098
**Note:** The Application template inside the ApplicationSet must contain the following content:
9199

92-
```shell
100+
```yaml
93101
labels:
94102
apps.open-cluster-management.io/pull-to-ocm-managed-cluster: 'true'
95103
annotations:
@@ -142,3 +150,123 @@ NAME SYNC STATUS HEALTH STATUS
142150
cluster1-guestbook-app Synced Healthy
143151
cluster2-guestbook-app Synced Healthy
144152
```
153+
154+
## Advanced Pull Model Installation (Argo CD Agent)
155+
156+
The advanced pull model uses [Argo CD Agent](https://github.com/argoproj-labs/argocd-agent/) to offload compute-intensive parts of Argo CD (application controller, repository server) to managed clusters while maintaining centralized control and observability on the hub.
157+
158+
### Prerequisites for Advanced Pull Model
159+
160+
- **The Hub cluster must have a load balancer.** For KinD clusters, you can use MetalLB. See the [OCM solutions guide](https://github.com/open-cluster-management-io/ocm/tree/main/solutions/argocd-agent#additional-resources) for setup instructions.
161+
162+
### Install the OCM Argo CD Agent add-on
163+
164+
```shell
165+
clusteradm install hub-addon --names argocd-agent --create-namespace
166+
```
167+
168+
This will install all necessary components including:
169+
- Argo CD Operator
170+
- Argo CD Agent principal
171+
- OCM integration controller
172+
173+
If your hub controller starts successfully, you should see:
174+
175+
```shell
176+
$ kubectl -n argocd get pods
177+
NAME READY STATUS RESTARTS AGE
178+
argocd-agent-principal-xxx 1/1 Running 0 2m
179+
argocd-pull-integration-controller-xxx 1/1 Running 0 2m
180+
argocd-applicationset-controller-xxx 1/1 Running 0 2m
181+
...
182+
```
183+
184+
### Verify the add-on is enabled on Managed clusters
185+
186+
The Argo CD Agent add-on is automatically enabled for all managed clusters via the GitOpsCluster Placement.
187+
188+
```shell
189+
$ kubectl get managedclusteraddon --all-namespaces
190+
NAMESPACE NAME AVAILABLE DEGRADED PROGRESSING
191+
cluster1 argocd-agent-addon True False
192+
```
193+
194+
On the managed cluster, verify the agent is running:
195+
196+
```shell
197+
$ kubectl -n argocd get pods
198+
NAME READY STATUS RESTARTS AGE
199+
argocd-agent-agent-xxx 1/1 Running 0 2m
200+
argocd-application-controller-0 1/1 Running 0 2m
201+
...
202+
```
203+
204+
### Deploy Applications
205+
206+
Create an AppProject on the hub cluster:
207+
208+
```shell
209+
kubectl apply -f - <<EOF
210+
apiVersion: argoproj.io/v1alpha1
211+
kind: AppProject
212+
metadata:
213+
name: default
214+
namespace: argocd
215+
spec:
216+
clusterResourceWhitelist:
217+
- group: '*'
218+
kind: '*'
219+
destinations:
220+
- namespace: '*'
221+
server: '*'
222+
sourceNamespaces:
223+
- '*'
224+
sourceRepos:
225+
- '*'
226+
EOF
227+
```
228+
229+
First, create the target namespace on the managed cluster:
230+
231+
```shell
232+
# kubectl config use-context <managed-cluster>
233+
kubectl create namespace guestbook
234+
```
235+
236+
Then create an Application on the hub cluster:
237+
238+
```shell
239+
kubectl apply -f - <<EOF
240+
apiVersion: argoproj.io/v1alpha1
241+
kind: Application
242+
metadata:
243+
name: guestbook
244+
namespace: cluster1 # replace with managed cluster name
245+
spec:
246+
project: default
247+
source:
248+
repoURL: https://github.com/argoproj/argocd-example-apps
249+
targetRevision: HEAD
250+
path: guestbook
251+
destination:
252+
server: https://<principal-external-ip>:443?agentName=cluster1 # Replace with actual IP and cluster name
253+
namespace: guestbook
254+
syncPolicy:
255+
automated:
256+
prune: true
257+
EOF
258+
```
259+
260+
Note: Replace `<principal-external-ip>` with the external IP of the `argocd-agent-principal` LoadBalancer service:
261+
262+
```shell
263+
kubectl -n argocd get svc argocd-agent-principal
264+
```
265+
266+
Verify the application is deployed on the managed cluster:
267+
268+
```shell
269+
$ kubectl -n argocd get app
270+
NAME SYNC STATUS HEALTH STATUS
271+
guestbook Synced Healthy
272+
```

0 commit comments

Comments
 (0)