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
**That's it!** You have successfully and reliably bootstrapped the cluster.
173
173
174
174
### What Happens Next Automatically?
175
175
176
-
1. **ArgoCD Syncs Itself**: The `root` Application tells ArgoCD to sync the contents of `infrastructure/controllers/argocd/apps/`.
176
+
1. **ArgoCD Syncs Itself**: The `root` Application tells ArgoCD to sync the contents of `infrastructure/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 directories matching their defined paths (e.g., `my-apps/*/*`) 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., `infrastructure/*`, `monitoring/*`, `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.
-**my-apps**: All user workloads (media, AI, dev, privacy, etc.)
77
77
78
-
These `AppProject` resources are defined in `infrastructure/controllers/argocd/apps/projects.yaml` and are managed automatically by the `root` ArgoCD application.
78
+
These `AppProject` resources are defined in `infrastructure/argocd/apps/projects.yaml` and are managed automatically by the `root` ArgoCD application.
79
79
80
80
## 📱 ApplicationSet Management
81
81
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.
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, and follows **2025 homelab best practices** with a flattened structure.
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. Each `ApplicationSet` is pointed to a specific path to discover its apps:
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 co-located with its applications:
86
+
-**Infrastructure:**`infrastructure/*` (defined in `infrastructure/infrastructure-appset.yaml`)
87
+
-**Monitoring:**`monitoring/*` (defined in `monitoring/monitoring-appset.yaml`)
88
+
-**My Apps:**`my-apps/*/*` (defined in `my-apps/my-apps-appset.yaml`)
89
89
90
90
### 2. ApplicationSet Configuration
91
-
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:
91
+
Each`ApplicationSet` is **co-located** with its applications, following peer-level organization. Here is the `my-apps-appset.yaml` as an example:
92
92
93
93
```yaml
94
94
apiVersion: argoproj.io/v1alpha1
@@ -134,43 +134,48 @@ spec:
134
134
135
135
## 📂 Repository Structure
136
136
137
-
The repository structure is designed for clarity and to prevent recursive management loops.
137
+
The repository structure follows **2025 homelab best practices** with a flattened, peer-level organization designed for clarity and to prevent recursive management loops.
138
138
139
139
```
140
140
├── infrastructure/
141
-
│ └── controllers/
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
-
│ └── ...
141
+
│ ├── argocd/ # <-- Manually bootstrapped, NOT in AppSet
142
+
│ │ ├── apps/ # <-- ArgoCD's OWN config (Projects/AppSets)
143
+
│ │ │ └── ...
144
+
│ │ └── ...
145
+
│ ├── infrastructure-appset.yaml# <-- ApplicationSet co-located with apps
146
+
│ ├── cert-manager/# <-- Scanned by infrastructure-appset
147
+
│ ├── longhorn/# <-- Scanned by infrastructure-appset
148
+
│ └── ...
149
149
├── monitoring/
150
-
│ └── prometheus-stack/ # <-- Scanned by monitoring-appset
151
-
│ └── ...
150
+
│ ├── monitoring-appset.yaml # <-- ApplicationSet co-located with apps
151
+
│ ├── prometheus-stack/ # <-- Scanned by monitoring-appset
152
+
│ ├── loki-stack/ # <-- Scanned by monitoring-appset
153
+
│ └── ...
152
154
└── my-apps/
155
+
├── my-apps-appset.yaml # <-- ApplicationSet co-located with apps
153
156
└── development/
154
157
└── nginx/ # <-- Scanned by my-apps-appset
155
158
└── ...
156
159
```
157
160
158
161
## ✅ Key Features
159
162
160
-
1.**Co-located & Self-Managing ArgoCD**:
161
-
- ArgoCD's entire configuration lives logically within `infrastructure/controllers/argocd`.
163
+
1.**Flattened & Self-Managing ArgoCD**:
164
+
- ArgoCD's entire configuration lives within `infrastructure/argocd`.
162
165
- 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.**
166
+
-**ApplicationSets are co-located with their applications**, following 2025 homelab best practices.
167
+
-**ArgoCD's configuration is structurally isolated from other infrastructure apps, preventing recursive management loops.**
164
168
165
-
2.**Enterprise Pattern**:
166
-
- Clear separation of concerns with three `ApplicationSet`s.
167
-
- Follows GitOps best practices used in production.
The `ApplicationSet`s use the directory `path` to automatically generate the application name and target namespace. This creates a consistent and predictable naming scheme.
205
210
206
-
-**Application Name**: Combines the project (`my-apps`, `infrastructure`, `monitoring`) with the directory path.
|**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. |
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. |
237
-
|**Applications stuck in sync**| Review application logs (`argocd app logs <app-name>`) and check for sync errors in the UI. |
238
-
|**ArgoCD UI not accessible**| Check the `http-route.yaml` and the status of the `istio-ingressgateway` service. |
244
+
|**ApplicationSet not generating apps**| Verify the directory structure matches the `path` pattern in the `ApplicationSet`. Check the `ApplicationSet` controller logs in the `argocd` namespace. Ensure directories have valid `kustomization.yaml` files. |
245
+
|**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/argocd` directory. The ApplicationSet excludes `infrastructure/argocd` to prevent this issue. Verify the exclude patterns in `infrastructure/infrastructure-appset.yaml`. |
246
+
|**Applications stuck in sync**| Review application logs (`argocd app logs <app-name>`) and check for sync errors in the UI. Check if Helm charts require `--enable-helm` flag. |
247
+
|**ArgoCD UI not accessible**| Check the `http-route.yaml` and the status of the Gateway API or ingress controller. |
248
+
|**Nested kustomization Helm issues**| The 2025 structure flattens nested kustomizations to avoid `--enable-helm` inheritance issues. If you see Helm chart errors, ensure the chart is defined at the ApplicationSet target level, not nested. |
0 commit comments