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/argocd.md
+17-24Lines changed: 17 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,11 +82,10 @@ These `AppProject` resources are defined in `infrastructure/controllers/argocd/a
82
82
We use **three simple ApplicationSets** that discover applications based on their directory structure. This follows a "convention over configuration" approach, eliminating the need for metadata files.
83
83
84
84
### 1. The "Directory as Application" Pattern
85
-
Instead of relying on marker files, our `ApplicationSet`s discover applications by looking for directories that match a predefined path pattern. The application's name and target namespace are derived directly from this path.
86
-
87
-
For an application at `my-apps/development/nginx`, the `ApplicationSet` will automatically:
88
-
- Create an ArgoCD Application named `my-apps-development-nginx`.
89
-
- Deploy the application into the `nginx` namespace.
85
+
Instead of relying on marker files, our `ApplicationSet`s discover applications by looking for directories that match a predefined path pattern. The application's name and target namespace are derived directly from this path. Each `ApplicationSet` is pointed to a specific path to discover its apps:
All `ApplicationSet`s live in `infrastructure/controllers/argocd/apps/appsets/` and follow the same pattern. Here is the `my-apps-appset.yaml` as an example:
@@ -135,39 +134,33 @@ spec:
135
134
136
135
## 📂 Repository Structure
137
136
138
-
The repository structure is designed for clarity and co-location of configuration.
137
+
The repository structure is designed for clarity and to prevent recursive management loops.
139
138
140
139
```
141
140
├── infrastructure/
142
141
│ └── controllers/
143
-
│ └── argocd/ # <-- Manually bootstrapped, NOT in AppSet
144
-
│ ├── apps/
145
-
│ │ ├── appsets/
146
-
│ │ │ ├── infrastructure-appset.yaml #<-- Ignores its own parent
147
-
│ │ │ ├── monitoring-appset.yaml
148
-
│ │ │ └── my-apps-appset.yaml
149
-
│ │ ├── projects.yaml
150
-
│ │ └── kustomization.yaml
151
-
│ ├── http-route.yaml
152
-
│ ├── ns.yaml
153
-
│ ├── root.yaml # <-- The "root" app (App of Apps)
154
-
│ ├── values.yaml
155
-
│ └── kustomization.yaml # <-- The BOOTSTRAP kustomization
142
+
│ ├── argocd/ # <-- Manually bootstrapped, NOT in AppSet
143
+
│ │ ├── apps/ # <-- ArgoCD's OWN config (Projects/AppSets)
144
+
│ │ │ └── ...
145
+
│ │ └── ...
146
+
│ └── apps/ # <-- Scanned by infrastructure-appset
147
+
│ ├── cert-manager/
148
+
│ └── ...
156
149
├── monitoring/
157
-
│ └── prometheus-stack/ # <-- Example discovered application
150
+
│ └── prometheus-stack/ # <-- Scanned by monitoring-appset
158
151
│ └── ...
159
152
└── my-apps/
160
153
└── development/
161
-
└── nginx/ # <-- Example discovered application
154
+
└── nginx/ # <-- Scanned by my-apps-appset
162
155
└── ...
163
156
```
164
157
165
158
## ✅ Key Features
166
159
167
160
1.**Co-located & Self-Managing ArgoCD**:
168
161
- ArgoCD's entire configuration lives logically within `infrastructure/controllers/argocd`.
169
-
- The `root` application manages the projects and `ApplicationSet`s from the`apps/` subdirectory.
170
-
-**Crucially, the `infrastructure-appset` explicitly excludes its own directory (`.../argocd`) to prevent a recursive management loop.**
162
+
- The `root` application manages the projects and `ApplicationSet`s from its own`apps/` subdirectory.
163
+
-**Crucially, ArgoCD's configuration is structurally isolated from other infrastructure apps, preventing recursive management loops.**
171
164
172
165
2.**Enterprise Pattern**:
173
166
- Clear separation of concerns with three `ApplicationSet`s.
|**ApplicationSet not generating apps**| Verify the directory structure matches the `path` pattern in the `ApplicationSet`. Check the `ApplicationSet` controller logs in the `argocd` namespace. Also ensure you are not accidentally excluding the path you want to deploy. |
243
-
|**Recursive loop or Helm error on `infra-argocd`**| This happens if the `infrastructure-appset`discovers the `infrastructure/controllers/argocd` directory. The ApplicationSet must have a generator that explicitly excludes this path to prevent ArgoCD from trying to manage itself. |
236
+
|**Recursive loop or Helm error on `infra-argocd`**| This error occurs if the `infrastructure-appset`is configured to scan a path that includes the `infrastructure/controllers/argocd` directory. The solution is to isolate discoverable applications into a dedicated subdirectory (e.g., `infrastructure/controllers/apps`) and point the ApplicationSet generator to that specific path, ensuring ArgoCD's own configuration is never discovered. |
244
237
|**Applications stuck in sync**| Review application logs (`argocd app logs <app-name>`) and check for sync errors in the UI. |
245
238
|**ArgoCD UI not accessible**| Check the `http-route.yaml` and the status of the `istio-ingressgateway` service. |
0 commit comments