Skip to content

Commit 836dfe4

Browse files
committed
docs: Use mtls instead of userpass in getting started guide
Signed-off-by: jannfis <[email protected]>
1 parent d1cd1dc commit 836dfe4

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

docs/getting-started/kubernetes/index.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Getting Started with Kubernetes
22

3-
This comprehensive guide will walk you through setting up argocd-agent on Kubernetes, including installing Argo CD on both the control plane and workload clusters, deploying the principal and agent components, and connecting your first agent.
3+
This comprehensive guide will walk you through setting up argocd-agent on Kubernetes, including installing Argo CD on both the control plane and workload clusters, deploying the principal and agent components, and connecting your first agent using mutual TLS (mTLS) authentication.
44

55
## Prerequisites
66

@@ -160,6 +160,15 @@ kubectl apply -n argocd \
160160
--context <control-plane-context>
161161
```
162162

163+
The principal is pre-configured to use mTLS authentication by default. You can verify this configuration:
164+
165+
```bash
166+
# Check the principal authentication configuration
167+
kubectl get configmap argocd-agent-params -n argocd --context <control-plane-context> \
168+
-o jsonpath='{.data.principal\.auth}'
169+
# Should output: mtls:CN=([^,]+)
170+
```
171+
163172
### 3.2 Expose Principal Service
164173

165174
The principal's gRPC service needs to be accessible from workload clusters:
@@ -259,39 +268,37 @@ For managed agents, create a namespace on the principal where the agent's Applic
259268
kubectl create namespace my-first-agent --context <control-plane-context>
260269
```
261270

262-
### 5.4 Create Agent Authentication Secret
271+
### 5.3 Verify Certificate Installation
272+
273+
The agent client certificate should already be installed from step 5.2. Verify it exists:
263274

264275
```bash
265-
# Get the password from the agent configuration (or use the one you set)
266-
AGENT_PASSWORD=$(kubectl get secret cluster-my-first-agent -n argocd --context <control-plane-context> \
267-
-o jsonpath='{.data.config}' | base64 -d | jq -r '.password')
268-
269-
# Create userpass credentials file
270-
kubectl create secret generic argocd-agent-agent-userpass \
271-
--from-literal=credentials="userpass:my-first-agent:${AGENT_PASSWORD}" \
272-
--namespace argocd \
273-
--context <workload-cluster-context>
276+
# Verify the client certificate secret exists
277+
kubectl get secret argocd-agent-client-tls -n argocd --context <workload-cluster-context>
278+
279+
# Verify the CA certificate secret exists
280+
kubectl get secret argocd-agent-ca -n argocd --context <workload-cluster-context>
274281
```
275282

276-
### 5.5 Deploy Agent
283+
### 5.4 Deploy Agent
277284

278285
```bash
279286
kubectl apply -n argocd \
280287
-k 'https://github.com/argoproj-labs/argocd-agent/install/kubernetes/agent?ref=main' \
281288
--context <workload-cluster-context>
282289
```
283290

284-
### 5.6 Configure Agent Connection
291+
### 5.5 Configure Agent Connection
285292

286-
Update the agent configuration to connect to your principal:
293+
Update the agent configuration to connect to your principal using mTLS authentication:
287294

288295
```bash
289296
kubectl patch configmap argocd-agent-params -n argocd --context <workload-cluster-context> \
290297
--patch "{\"data\":{
291298
\"agent.server.address\":\"<principal-external-ip>\",
292299
\"agent.server.port\":\"8443\",
293300
\"agent.mode\":\"managed\",
294-
\"agent.creds\":\"userpass:/app/config/creds/userpass.creds\"
301+
\"agent.creds\":\"mtls:any\"
295302
}}"
296303

297304
# Restart the agent to apply changes
@@ -307,7 +314,7 @@ kubectl rollout restart deployment argocd-agent-agent -n argocd --context <workl
307314
kubectl logs -n argocd deployment/argocd-agent-agent --context <workload-cluster-context>
308315

309316
# Expected output:
310-
# INFO[0001] Starting argocd-agent (agent) v0.1.0 (ns=argocd, mode=managed, auth=userpass)
317+
# INFO[0001] Starting argocd-agent (agent) v0.1.0 (ns=argocd, mode=managed, auth=mtls)
311318
# INFO[0002] Authentication successful
312319
# INFO[0003] Connected to argocd-agent-principal v0.1.0
313320
```
@@ -402,8 +409,8 @@ kubectl run debug --rm -it --image=busybox --context <workload-cluster-context>
402409
# Verify certificates
403410
kubectl get secrets -n argocd --context <workload-cluster-context> | grep tls
404411

405-
# Check authentication
406-
kubectl get secret argocd-agent-agent-userpass -n argocd --context <workload-cluster-context> -o yaml
412+
# Check client certificate
413+
kubectl get secret argocd-agent-client-tls -n argocd --context <workload-cluster-context> -o yaml
407414
```
408415

409416
**Principal Service Not Accessible**:

0 commit comments

Comments
 (0)