Skip to content

Commit 3722a00

Browse files
authored
docs: fix argocd-agent docs (#1231)
Signed-off-by: Mike Ng <[email protected]>
1 parent b5c6587 commit 3722a00

File tree

1 file changed

+65
-11
lines changed

1 file changed

+65
-11
lines changed

solutions/argocd-agent/README.md

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,22 @@ enabling efficient templating for deployment modifications.
7070

7171
## Prerequisites
7272

73+
- [Helm CLI](https://helm.sh/).
74+
7375
- Setup an OCM environment with at least two clusters (one hub and at least one managed).
7476
Refer to the [Quick Start guide](https://open-cluster-management.io/docs/getting-started/quick-start/) for more details.
7577

76-
- The Hub cluster must have a load balancer.
78+
- **The Hub cluster must have a load balancer.**
7779
Refer to the [Additional Resources](#additional-resources) for more details.
7880

79-
- [Helm CLI](https://helm.sh/).
80-
8181

8282
## Setup Guide
8383

84-
### Deploy OCM Argo CD AddOn on the Hub Cluster
84+
### Deploy OCM Argo CD AddOn Managers on the Hub Cluster
8585

8686
```shell
87+
# After OCM and load balancer setup:
88+
#
8789
# kubectl config use-context <hub-cluster>
8890
helm repo add ocm https://open-cluster-management.io/helm-charts
8991
helm repo update
@@ -101,18 +103,41 @@ NAMESPACE NAME AVAILABLE DEGRADED PROGRESSING
101103
cluster1 argocd-agent-addon True False
102104
```
103105

104-
This may take a few minutes to complete.
106+
**This may take a few minutes to complete. Check GitOpsCluster for progress:**
105107

106-
Validate that the Argo CD Agent principal pod is running:
108+
```shell
109+
# kubectl config use-context <hub-cluster>
110+
kubectl -n argocd get gitopscluster gitops-cluster -o yaml
111+
...
112+
- lastTransitionTime: "2025-10-30T03:38:38Z"
113+
message: Addon configured for 1 clusters
114+
observedGeneration: 2
115+
reason: Success
116+
status: "True"
117+
type: AddonConfigured
118+
```
119+
120+
On the hub cluster, validate that the Argo CD Agent principal pod is running successfully:
107121

108122
```shell
109123
# kubectl config use-context <hub-cluster>
110124
kubectl -n argocd get pod
111125

112126
NAME READY STATUS RESTARTS AGE
127+
...
113128
argocd-agent-principal-5c47c7c6d5-mpts4 1/1 Running 0 88s
114129
```
115130

131+
On the managed cluster, validate that the Argo CD Agent agent pod is running successfully:
132+
```shell
133+
# kubectl config use-context <managed-cluster>
134+
kubectl -n argocd get pod
135+
136+
NAME READY STATUS RESTARTS AGE
137+
...
138+
argocd-agent-agent-68bdb5dc87-7zb4h 1/1 Running 0 88s
139+
```
140+
116141
## Deploying Applications
117142

118143
### Managed Mode
@@ -121,7 +146,31 @@ Refer to the [Argo CD Agent website](https://argocd-agent.readthedocs.io/latest/
121146
for more details about the `managed` mode.
122147

123148
To deploy an Argo CD Application in `managed` mode using the Argo CD Agent,
124-
create the application on the `hub` cluster:
149+
first propagate an AppProject from `hub` cluster to the managed cluster by creating or updating a `hub` AppProject
150+
151+
```shell
152+
# kubectl config use-context <hub-cluster>
153+
kubectl apply -f - <<EOF
154+
apiVersion: argoproj.io/v1alpha1
155+
kind: AppProject
156+
metadata:
157+
name: default
158+
namespace: argocd
159+
spec:
160+
clusterResourceWhitelist:
161+
- group: '*'
162+
kind: '*'
163+
destinations:
164+
- namespace: '*'
165+
server: '*'
166+
sourceNamespaces:
167+
- '*'
168+
sourceRepos:
169+
- '*'
170+
EOF
171+
```
172+
173+
then create the application on the **hub cluster**:
125174

126175
```shell
127176
# kubectl config use-context <hub-cluster>
@@ -130,15 +179,15 @@ apiVersion: argoproj.io/v1alpha1
130179
kind: Application
131180
metadata:
132181
name: guestbook
133-
namespace: cluster1 # replace with your managed cluster name
182+
namespace: cluster1 # replace with managed cluster name
134183
spec:
135184
project: default
136185
source:
137186
repoURL: https://github.com/argoproj/argocd-example-apps
138187
targetRevision: HEAD
139188
path: guestbook
140189
destination:
141-
server: https://<principal-external-ip:port>?agentName=<managed cluster name> # For example, https://172.18.255.200:443?agentName=cluster1
190+
server: https://172.18.255.200:443?agentName=cluster1 # Replace with https://<principal-external-ip:port>?agentName=<managed-cluster-name>
142191
namespace: guestbook
143192
syncPolicy:
144193
syncOptions:
@@ -148,17 +197,22 @@ spec:
148197
EOF
149198
```
150199

151-
Validate that the Argo CD Application has been successfully propagated to the managed cluster:
200+
Validate that the Argo CD AppProject and Application has been successfully propagated to the **managed cluster**:
152201

153202
```shell
154203
# kubectl config use-context <managed-cluster>
204+
kubectl -n argocd get appproj
205+
206+
NAME AGE
207+
default 88s
208+
155209
kubectl -n argocd get app
156210

157211
NAME SYNC STATUS HEALTH STATUS
158212
guestbook Synced Healthy
159213
```
160214

161-
Validate that the application has been successfully synchronized back to the hub cluster:
215+
Validate that the application has been successfully synchronized back to the **hub cluster**:
162216

163217
```shell
164218
# kubectl config use-context <hub-cluster>

0 commit comments

Comments
 (0)