You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/appprojects.md
+70-4Lines changed: 70 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ spec:
43
43
- agent-*
44
44
destinations:
45
45
- name: agent-*
46
-
namespace: "*"
46
+
namespace: "guestbook"
47
47
server: "*"
48
48
sourceRepos:
49
49
- "*"
@@ -55,13 +55,13 @@ When this AppProject is created on the principal, it will be automatically distr
55
55
56
56
When an AppProject is sent to an agent, it undergoes transformation to make it agent-specific:
57
57
58
-
1. **Destinations**: Only destinations matching the agent are kept, and they're transformed to point to the local cluster:
58
+
1. **Destinations**: Only destinations matching the agent are kept (using glob pattern matching), and they're transformed to point to the local cluster:
59
59
60
60
```yaml
61
61
destinations:
62
62
- name: "in-cluster"
63
63
server: "https://kubernetes.default.svc"
64
-
namespace: "*"
64
+
namespace: "guestbook" # Preserves original namespace restrictions
65
65
```
66
66
67
67
2. **Source Namespaces**: Limited to only the agent's namespace:
@@ -99,24 +99,90 @@ spec:
99
99
- name: "in-cluster"
100
100
namespace: "*"
101
101
server: "https://kubernetes.default.svc"
102
+
# Can also have multiple destinations - all will be transformed
103
+
- name: "another-destination"
104
+
namespace: "specific-ns"
105
+
server: "https://kubernetes.default.svc"
102
106
sourceNamespaces:
103
107
- argocd
104
108
sourceRepos:
105
109
- "*"
106
110
```
107
111
112
+
When this AppProject is created on an autonomous agent named `agent-production`, it will be transformed and appear on the principal as:
113
+
114
+
```yaml
115
+
apiVersion: argoproj.io/v1alpha1
116
+
kind: AppProject
117
+
metadata:
118
+
name: agent-production-my-project # Prefixed with agent name
119
+
namespace: argocd # Placed in Argo CD namespace on principal
120
+
spec:
121
+
destinations:
122
+
- name: agent-production # All destinations point to agent
123
+
namespace: "*"
124
+
server: "*"
125
+
- name: agent-production
126
+
namespace: "specific-ns" # Original namespace restrictions preserved
127
+
server: "*"
128
+
sourceNamespaces:
129
+
- agent-production # Agent's namespace on principal
130
+
sourceRepos:
131
+
- "*"
132
+
```
133
+
108
134
### Principal-Side Transformation
109
135
110
136
When an AppProject is received from an autonomous agent, the principal applies transformations:
111
137
138
+
!!! note
139
+
AppProjects from autonomous agents on the control plane are not used for reconciliation (there is no app controller running on the principal for these projects). Instead, they allow the Argo CD API (and UI, CLI) to determine which operations are valid to be performed on Applications that reference these AppProjects.
140
+
141
+
!!! warning "Important"
142
+
AppProjects that are synced from autonomous agents should not be used by other Applications outside of that agent, as they may change unpredictably when the autonomous agent modifies its local AppProject configuration.
143
+
112
144
1. **Name Prefixing**: The project name is prefixed with the agent name to avoid conflicts:
113
145
114
146
```
115
147
Original: my-project
116
148
On Principal: agent-production-my-project
117
149
```
118
150
119
-
2. **Namespace Mapping**: The project is placed in the agent's corresponding namespace on the principal
151
+
2. **Source Namespaces**: Transformed to allow Applications from the agent's namespace on the principal:
152
+
153
+
```yaml
154
+
sourceNamespaces:
155
+
- agent-production # The agent's namespace on the principal
156
+
```
157
+
158
+
3. **Destinations**: All destinations are transformed to point to the agent cluster:
159
+
160
+
```yaml
161
+
destinations:
162
+
- name: agent-production # The agent name
163
+
server: "*"
164
+
namespace: "*" # Preserves original namespace restrictions
165
+
```
166
+
167
+
4. **Namespace Mapping**: The project is placed in the Argo CD namespace on the principal (same as where other AppProjects reside)
168
+
169
+
## Key Transformation Differences
170
+
171
+
The transformation logic differs significantly between managed and autonomous agents:
172
+
173
+
### Managed Agents (Principal → Agent)
174
+
- **Direction**: AppProject flows from principal to agent
175
+
- **Selection**: Uses glob pattern matching on `sourceNamespaces` and `destinations` to determine which agents receive the project
176
+
- **Destinations**: Filtered to only include destinations matching the agent, then transformed to `in-cluster`
177
+
- **Source Namespaces**: Replaced with the single agent namespace
178
+
- **Name**: Remains unchanged
179
+
180
+
### Autonomous Agents (Agent → Principal)
181
+
- **Direction**: AppProject flows from agent to principal
182
+
- **Selection**: All AppProjects created on autonomous agents are synchronized
183
+
- **Destinations**: All destinations are transformed to point to the agent cluster (name = agent name, server = "*")
184
+
- **Source Namespaces**: Replaced with the agent's namespace on the principal
185
+
- **Name**: Prefixed with agent name to avoid conflicts
0 commit comments