Skip to content

Commit 71fa749

Browse files
committed
sdfgsdfgsdfgsfdgsdfgsfdg
1 parent dd8ea7c commit 71fa749

7 files changed

Lines changed: 175 additions & 155 deletions

File tree

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,31 @@ kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/downloa
144144
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/experimental-install.yaml
145145
```
146146

147-
### 6. Bootstrap ArgoCD (One Command)
148-
Deploy the self-managing ArgoCD bootstrap application. This will:
149-
1. **Install ArgoCD itself** using Helm
150-
2. **Create all three ApplicationSets** (infrastructure, monitoring, applications)
151-
3. **Automatically discover and deploy** all components and applications
147+
### 6. Bootstrap ArgoCD (Following k3s-argocd-starter Pattern)
148+
149+
Deploy ArgoCD and ApplicationSets in the correct order:
152150

153151
```bash
154-
# Single command to deploy everything - ArgoCD will manage itself from here
152+
# Step 1: Deploy ArgoCD itself
155153
kubectl apply -f infrastructure/argocd-app.yaml
154+
155+
# Wait for ArgoCD to be ready (2-5 minutes)
156+
kubectl wait --for=condition=Available deployment/argocd-server -n argocd --timeout=300s
157+
158+
# Step 2: Deploy Infrastructure ApplicationSet
159+
kubectl apply -f infrastructure/infrastructure-components-appset.yaml
160+
161+
# Step 3: Deploy Monitoring ApplicationSet
162+
kubectl apply -f monitoring/monitoring-components-appset.yaml
163+
164+
# Step 4: Deploy Applications ApplicationSet
165+
kubectl apply -f my-apps/myapplications-appset.yaml
156166
```
157167

158168
**That's it!** ArgoCD will now:
159169
- Manage its own installation and upgrades
160170
- Deploy all infrastructure components (Cilium, storage, etc.)
161-
- Deploy monitoring stack (Prometheus, Grafana, Loki)
171+
- Deploy monitoring stack (Prometheus, Grafana, Loki)
162172
- Deploy all applications (media, AI, home automation, etc.)
163173

164174
### 7. Configure Secret Management

docs/argocd.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ This guide details the setup and configuration of ArgoCD, which serves as the Gi
44

55
## 📋 Overview & Deployment Flow
66

7-
The cluster uses a **clean, enterprise-grade GitOps approach** with ArgoCD managing itself and three separate ApplicationSets for different workload types. This pattern is commonly used in production environments for clear separation of concerns and simplified management.
7+
The cluster follows the **k3s-argocd-starter pattern** - a simple, proven GitOps approach where ArgoCD manages itself and ApplicationSets are deployed separately. This eliminates circular dependencies and follows production best practices.
88

9-
The deployment flow follows this simple pattern:
9+
The deployment flow follows this clean pattern:
1010

1111
```mermaid
1212
graph TD;
1313
subgraph "Git Repository"
1414
Bootstrap["argocd-app.yaml<br/>(Bootstrap Application)"]
1515
16-
InfraAppSet["infrastructure/root-appset.yaml<br/>(Infrastructure ApplicationSet)"]
16+
InfraAppSet["infrastructure/infrastructure-components-appset.yaml<br/>(Infrastructure ApplicationSet)"]
1717
MonAppSet["monitoring/monitoring-components-appset.yaml<br/>(Monitoring ApplicationSet)"]
1818
AppsAppSet["my-apps/myapplications-appset.yaml<br/>(Applications ApplicationSet)"]
1919
@@ -75,20 +75,29 @@ kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/downloa
7575
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/experimental-install.yaml
7676
```
7777

78-
### 2. Bootstrap ArgoCD (One Command Deployment)
79-
Deploy the self-managing ArgoCD `Application`. This bootstrap application will:
80-
1. Install ArgoCD itself using Helm
81-
2. Create all three ApplicationSets automatically
82-
3. Discover and deploy all infrastructure, monitoring, and applications
78+
### 2. Bootstrap ArgoCD (k3s-argocd-starter Pattern)
79+
Deploy ArgoCD and ApplicationSets in the correct order to avoid circular dependencies:
8380

8481
```bash
85-
# Apply the ArgoCD bootstrap application - this is the ONLY manual command needed
82+
# Step 1: Deploy ArgoCD itself
8683
kubectl apply -f infrastructure/argocd-app.yaml
84+
85+
# Wait for ArgoCD to be ready (2-5 minutes)
86+
kubectl wait --for=condition=Available deployment/argocd-server -n argocd --timeout=300s
87+
88+
# Step 2: Deploy Infrastructure ApplicationSet
89+
kubectl apply -f infrastructure/infrastructure-components-appset.yaml
90+
91+
# Step 3: Deploy Monitoring ApplicationSet
92+
kubectl apply -f monitoring/monitoring-components-appset.yaml
93+
94+
# Step 4: Deploy Applications ApplicationSet
95+
kubectl apply -f my-apps/myapplications-appset.yaml
8796
```
8897

8998
**That's it!** ArgoCD will now manage itself and deploy everything else automatically.
9099

91-
The bootstrap application references the three ApplicationSets via the ArgoCD kustomization, ensuring they're deployed as part of ArgoCD's self-management.
100+
This pattern separates ArgoCD's self-management from ApplicationSet deployment, eliminating SharedResourceWarning issues and following proven GitOps practices.
92101

93102
## 🔧 Project Setup
94103

@@ -104,7 +113,7 @@ These `AppProject` resources are defined in `infrastructure/projects.yaml` and a
104113

105114
We use **three simple ApplicationSets** following enterprise patterns:
106115

107-
### 1. Infrastructure ApplicationSet (`infrastructure/root-appset.yaml`)
116+
### 1. Infrastructure ApplicationSet (`infrastructure/infrastructure-components-appset.yaml`)
108117
Manages all core infrastructure components:
109118
```yaml
110119
apiVersion: argoproj.io/v1alpha1
@@ -119,6 +128,8 @@ spec:
119128
revision: HEAD
120129
directories:
121130
- path: infrastructure/*/*
131+
- path: infrastructure/controllers/argocd
132+
exclude: true
122133
template:
123134
metadata:
124135
name: 'infra-{{path.basename}}'
@@ -233,7 +244,7 @@ The repository follows a clean three-tier structure that maps directly to the Ap
233244
│ ├── storage/ # Longhorn, CSI drivers, etc.
234245
│ ├── database/ # PostgreSQL, Redis operators
235246
│ ├── projects.yaml # ArgoCD projects
236-
│ └── root-appset.yaml # Infrastructure ApplicationSet
247+
│ └── infrastructure-components-appset.yaml # Infrastructure ApplicationSet
237248
├── monitoring/ # Monitoring ApplicationSet
238249
│ ├── prometheus-stack/ # Prometheus, Grafana, AlertManager
239250
│ ├── loki-stack/ # Loki, Promtail
@@ -252,8 +263,8 @@ The repository follows a clean three-tier structure that maps directly to the Ap
252263

253264
1. **Self-Managing ArgoCD**:
254265
- ArgoCD manages its own installation and upgrades
255-
- ApplicationSets are deployed as part of ArgoCD's kustomization
256-
- Zero manual intervention after bootstrap
266+
- ApplicationSets are deployed separately to avoid circular dependencies
267+
- Follows k3s-argocd-starter proven pattern
257268

258269
2. **Enterprise Pattern**:
259270
- Clear separation of concerns with three ApplicationSets
@@ -283,8 +294,13 @@ kubectl apply -k infrastructure/
283294

284295
### Production Deployment
285296
```bash
286-
# Single command deployment - ArgoCD manages everything from here
297+
# Step-by-step deployment following k3s-argocd-starter pattern
287298
kubectl apply -f infrastructure/argocd-app.yaml
299+
kubectl wait --for=condition=Available deployment/argocd-server -n argocd --timeout=300s
300+
301+
kubectl apply -f infrastructure/infrastructure-components-appset.yaml
302+
kubectl apply -f monitoring/monitoring-components-appset.yaml
303+
kubectl apply -f my-apps/myapplications-appset.yaml
288304
289305
# Monitor deployment progress
290306
kubectl get applications -n argocd -w

infrastructure/bootstrap-applicationsets.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

infrastructure/controllers/argocd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resources:
77
helmCharts:
88
- name: argo-cd
99
repo: https://argoproj.github.io/argo-helm
10-
version: 8.1.1 # Consider updating to latest stable
10+
version: 8.1.1
1111
releaseName: "argocd"
1212
namespace: argocd
1313
valuesFile: values.yaml

infrastructure/controllers/argocd/projects.yaml

Lines changed: 0 additions & 96 deletions
This file was deleted.

infrastructure/root-appset.yaml renamed to infrastructure/infrastructure-components-appset.yaml

File renamed without changes.

0 commit comments

Comments
 (0)