@@ -65,7 +65,8 @@ argocd-agentctl jwt create-key \
65
65
--upsert
66
66
```
67
67
68
- ** Important** : Replace ` <control-plane-context> ` , ` <principal-ip-addresses> ` , and ` <principal-dns-names> ` with your actual values.
68
+ !!! important
69
+ Replace ` <control-plane-context> ` , ` <principal-ip-addresses> ` , and ` <principal-dns-names> ` with your actual values.
69
70
70
71
## Step 2: Create Agent Configuration
71
72
@@ -75,35 +76,20 @@ Create the agent configuration on the principal cluster:
75
76
argocd-agentctl agent create < agent-name> \
76
77
--principal-context < control-plane-context> \
77
78
--principal-namespace argocd \
78
- --resource-proxy-server < principal-ip> :9090 \
79
- --resource-proxy-username < agent-name> \
80
- --resource-proxy-password < secure-password>
79
+ --resource-proxy-server < resource-proxy-service-name> :9090
81
80
```
82
81
83
- ### Interactive vs Non-Interactive Mode
82
+ The resource proxy service's name is usually ` argocd-agent-resource-proxy ` .
84
83
85
- ** Interactive Mode** (recommended for development):
86
-
87
- ``` bash
88
- argocd-agentctl agent create production-cluster
89
- # CLI will prompt for username and password
90
- ```
91
-
92
- ** Non-Interactive Mode** (for automation):
93
-
94
- ``` bash
95
- argocd-agentctl agent create production-cluster \
96
- --resource-proxy-username production-cluster \
97
- --resource-proxy-password " $( openssl rand -base64 32) "
98
- ```
84
+ !!! important
85
+ The value given as ` resource-proxy-service-name ` must match a SAN entry in your resource proxy's TLS certificate
99
86
100
87
### What This Command Does
101
88
102
89
1 . ** Creates Cluster Secret** : Stores agent configuration as an Argo CD cluster secret
103
- 2 . ** Generates Client Certificate** : Creates mTLS certificate for agent authentication
104
- 3 . ** Configures Resource Proxy** : Sets up credentials for live resource viewing
105
- 4 . ** Validates Agent Name** : Ensures the agent name meets requirements
106
- 5 . ** Prevents Duplicates** : Checks that the agent doesn't already exist
90
+ 2 . ** Generates Client Certificate** : Creates mTLS certificate for Argo CD to authenticate to the resource proxy
91
+ 3 . ** Validates Agent Name** : Ensures the agent name meets requirements
92
+ 4 . ** Prevents Duplicates** : Checks that the agent doesn't already exist
107
93
108
94
## Step 3: Issue Agent Client Certificate
109
95
@@ -118,6 +104,7 @@ argocd-agentctl pki issue agent <agent-name> \
118
104
```
119
105
120
106
This command:
107
+
121
108
- Generates a client certificate signed by the principal's CA
122
109
- Stores the certificate in the agent's cluster as a Kubernetes secret
123
110
- Configures the certificate with the agent's name as the subject
@@ -139,6 +126,7 @@ kubectl create namespace <agent-name> --context <control-plane-context>
139
126
### Option A: Using Kubernetes Manifests
140
127
141
128
1 . ** Create Authentication Secret** :
129
+
142
130
``` bash
143
131
kubectl create secret generic argocd-agent-agent-userpass \
144
132
--from-literal=credentials=" userpass:<agent-name>:<password>" \
@@ -147,13 +135,15 @@ kubectl create secret generic argocd-agent-agent-userpass \
147
135
```
148
136
149
137
2 . ** Deploy Agent Components** :
138
+
150
139
``` bash
151
140
kubectl apply -n argocd \
152
141
-k ' https://github.com/argoproj-labs/argocd-agent/install/kubernetes/agent?ref=main' \
153
142
--context < workload-cluster-context>
154
143
```
155
144
156
145
3 . ** Configure Agent Parameters** :
146
+
157
147
``` bash
158
148
kubectl patch configmap argocd-agent-params \
159
149
--namespace argocd \
@@ -193,7 +183,7 @@ data:
193
183
agent.server.port : " 8443"
194
184
195
185
# Authentication method
196
- agent.creds : " userpass:/app/config/creds/userpass.creds "
186
+ agent.creds : " mtls:^CN=(.+)$ "
197
187
198
188
# TLS settings
199
189
agent.tls.client.insecure : " false"
@@ -206,14 +196,15 @@ data:
206
196
207
197
### Authentication Methods
208
198
209
- **UserPass Authentication** (default) :
199
+ **mTLS Authentication**:
210
200
` ` ` yaml
211
- agent.creds : " userpass:/app/config/creds/userpass.creds "
201
+ agent.creds : " mtls:^CN=(.+)$ " # Regex to extract agent ID from cert subject
212
202
` ` `
213
203
214
- **mTLS Authentication**:
204
+ **UserPass Authentication** (deprecated):
205
+
215
206
` ` ` yaml
216
- agent.creds : " mtls:^CN=(.+)$ " # Regex to extract agent ID from cert subject
207
+ agent.creds : " userpass:/app/config/creds/userpass.creds "
217
208
` ` `
218
209
219
210
## Step 7: Verification
@@ -309,9 +300,8 @@ for agent in "${AGENTS[@]}"; do
309
300
310
301
# Create agent configuration
311
302
argocd-agentctl agent create " $agent " \
312
- --resource-proxy-username " $agent " \
313
- --resource-proxy-password " $( openssl rand -base64 32) "
314
-
303
+ --resource-proxy-server < resource-proxy-service-name> :9090
304
+
315
305
# Issue client certificate
316
306
argocd-agentctl pki issue agent " $agent " \
317
307
--agent-context " cluster-$agent " \
@@ -336,8 +326,6 @@ argocd-agentctl agent inspect <agent-name>
336
326
``` bash
337
327
argocd-agentctl agent reconfigure < agent-name> \
338
328
--resource-proxy-server < new-server-address> \
339
- --resource-proxy-username < new-username> \
340
- --resource-proxy-password < new-password> \
341
329
--reissue-client-cert
342
330
```
343
331
0 commit comments