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
1. **ArgoCD Syncs Itself**: The `root` Application tells ArgoCD to sync the contents of `infrastructure/controllers/argocd/apps/`.
177
177
2. **Projects & AppSets Created**: ArgoCD creates the `AppProject`s and the three `ApplicationSet`s (`infrastructure`, `monitoring`, `my-apps`).
178
-
3. **Applications Discovered**: The `ApplicationSet`s scan the repository for any directory containing an `argo-app.yaml` file and create the corresponding ArgoCD `Application` resources.
178
+
3. **Applications Discovered**: The `ApplicationSet`s scan the repository for any directories matching their defined paths (e.g., `my-apps/*/*`) and create the corresponding ArgoCD `Application` resources.
179
179
4. **Cluster Reconciliation**: ArgoCD syncs all discovered applications, building the entire cluster state declaratively from Git.
@@ -65,18 +65,14 @@ These `AppProject` resources are defined in `infrastructure/controllers/argocd/a
65
65
66
66
## 📱 ApplicationSet Management
67
67
68
-
We use **three simple ApplicationSets** that discover applications based on a metadata file.
68
+
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.
69
69
70
-
### 1. The "Application as Metadata" Pattern
71
-
Instead of relying on directory paths, our `ApplicationSet`s discover applications by looking for a marker file named `argo-app.yaml`.
70
+
### 1. The "Directory as Application" Pattern
71
+
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.
72
72
73
-
An example `argo-app.yaml` for `my-apps/development/nginx`:
74
-
```yaml
75
-
# This file provides the metadata for the ApplicationSet generator.
76
-
# It tells ArgoCD how to create the Application for this component.
77
-
name: my-app-nginx
78
-
namespace: nginx
79
-
```
73
+
For an application at `my-apps/development/nginx`, the `ApplicationSet` will automatically:
74
+
- Create an ArgoCD Application named `my-apps-development-nginx`.
75
+
- Deploy the application into the `nginx` namespace.
80
76
81
77
### 2. ApplicationSet Configuration
82
78
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:
The `ApplicationSet`s use the `name` field from each `argo-app.yaml` to name the application in ArgoCD, giving you full control.
196
+
The `ApplicationSet`s use the directory `path` to automatically generate the application name and target namespace. This creates a consistent and predictable naming scheme.
197
+
198
+
-**Application Name**: Combines the project (`my-apps`, `infrastructure`, `monitoring`) with the directory path.
|**ApplicationSet not generating apps**| Verify the `argo-app.yaml` file exists, is valid YAML, and is in a path the `ApplicationSet` is scanning. Check the `ApplicationSet` logs. |
227
+
|**ApplicationSet not generating apps**| Verify the directory structure matches the `path` pattern in the `ApplicationSet`. Check the `ApplicationSet`controller logs in the `argocd` namespace. |
227
228
|**Applications stuck in sync**| Review application logs (`argocd app logs <app-name>`) and check for sync errors in the UI. |
228
229
|**ArgoCD UI not accessible**| Check the `http-route.yaml` and the status of the `istio-ingressgateway` service. |
229
230
@@ -241,7 +242,7 @@ kubectl get applicationsets -n argocd
241
242
This setup follows **enterprise GitOps patterns**:
242
243
243
244
1.**Infrastructure as Code**: Everything defined in Git.
244
-
2.**Self-Service**: Developers can add applications by creating a directory and an `argo-app.yaml` file.
245
+
2.**Self-Service**: Developers can add new applications simply by creating a new directory in the correct path.
245
246
3.**Separation of Concerns**: Clear project boundaries for security and organization.
246
247
4.**Automated Operations**: Zero-touch deployments after the initial bootstrap.
247
248
5.**Observability**: Ready for a full monitoring and alerting stack.
0 commit comments