|
9 | 9 | repoURL: https://github.com/mitchross/k3s-argocd-proxmox.git |
10 | 10 | revision: HEAD |
11 | 11 | directories: |
12 | | - # Discover every component directory in the main folders |
13 | | - - path: infrastructure/* |
| 12 | + # Discover each individual component/app directory |
| 13 | + - path: infrastructure/controllers/* |
| 14 | + - path: infrastructure/crds |
| 15 | + - path: infrastructure/database/* |
| 16 | + - path: infrastructure/networking/* |
| 17 | + - path: infrastructure/storage/* |
14 | 18 | - path: monitoring/* |
15 | | - - path: my-apps/* |
| 19 | + - path: my-apps/*/* |
16 | 20 | template: |
17 | 21 | metadata: |
18 | | - # Create a unique name for each application |
19 | | - name: '{{path.basename}}' |
| 22 | + # Create a unique name for each application, e.g., "controllers-argocd" |
| 23 | + name: '{{path.path | replace "/" "-" | lower}}' |
20 | 24 | namespace: argocd |
21 | 25 | annotations: |
22 | 26 | # Keep notifications for degraded or failed syncs |
23 | 27 | notifications.argoproj.io/subscribe.on-health-degraded.slack: app-alerts |
24 | 28 | notifications.argoproj.io/subscribe.on-sync-failed.slack: app-alerts |
25 | 29 | spec: |
26 | | - # Set project based on the top-level folder |
27 | | - project: '{{path[0]}}' |
| 30 | + # Set project based on the top-level folder (infrastructure, monitoring, or my-apps) |
| 31 | + project: '{{path.path | split "/" | first}}' |
28 | 32 | source: |
29 | 33 | repoURL: https://github.com/mitchross/k3s-argocd-proxmox.git |
30 | 34 | targetRevision: HEAD |
|
34 | 38 | name: kustomize-build-with-helm |
35 | 39 | destination: |
36 | 40 | server: https://kubernetes.default.svc |
37 | | - # Deploy the app to a namespace matching its name |
| 41 | + # Deploy the app to a namespace matching its directory name, e.g., "argocd", "plex" |
38 | 42 | namespace: '{{path.basename}}' |
39 | 43 | syncPolicy: |
40 | 44 | automated: |
|
66 | 70 | jsonPointers: |
67 | 71 | - /spec/parentRefs/0/group |
68 | 72 | - /spec/parentRefs/0/kind |
69 | | - - /spec/rules/0/backendRefs/0/group |
70 | | - - /spec/rules/0/backendRefs/0/kind |
71 | | - - /spec/rules/0/backendRefs/0/weight |
72 | | - - group: gateway.networking.k8s.io |
73 | | - kind: TCPRoute |
74 | | - jsonPointers: |
75 | | - - /spec/parentRefs/0/group |
76 | | - - /spec/parentRefs/0/kind |
77 | | - - /spec/rules/0/backendRefs/0/group |
78 | | - - /spec/rules/0/backendRefs/0/kind |
79 | | - - /spec/rules/0/backendRefs/0/weight |
80 | 73 | - group: apiextensions.k8s.io |
81 | 74 | kind: CustomResourceDefinition |
82 | 75 | jsonPointers: |
|
0 commit comments