|
9 | 9 | repoURL: https://github.com/mitchross/k3s-argocd-proxmox.git |
10 | 10 | revision: HEAD |
11 | 11 | directories: |
12 | | - - path: infrastructure |
13 | | - - path: monitoring |
14 | | - - path: my-apps |
| 12 | + # Discover every component directory in the main folders |
| 13 | + - path: infrastructure/* |
| 14 | + - path: monitoring/* |
| 15 | + - path: my-apps/* |
15 | 16 | template: |
16 | 17 | metadata: |
17 | | - name: '{{path.basename}}-app' |
| 18 | + # Create a unique name for each application |
| 19 | + name: '{{path.basename}}' |
18 | 20 | namespace: argocd |
| 21 | + annotations: |
| 22 | + # Keep notifications for degraded or failed syncs |
| 23 | + notifications.argoproj.io/subscribe.on-health-degraded.slack: app-alerts |
| 24 | + notifications.argoproj.io/subscribe.on-sync-failed.slack: app-alerts |
19 | 25 | spec: |
20 | | - project: default |
| 26 | + # Set project based on the top-level folder |
| 27 | + project: '{{path[0]}}' |
21 | 28 | source: |
22 | 29 | repoURL: https://github.com/mitchross/k3s-argocd-proxmox.git |
23 | 30 | targetRevision: HEAD |
24 | 31 | path: '{{path}}' |
| 32 | + # IMPORTANT: Apply the kustomize-helm plugin to all apps |
| 33 | + plugin: |
| 34 | + name: kustomize-build-with-helm |
25 | 35 | destination: |
26 | 36 | server: https://kubernetes.default.svc |
27 | | - namespace: argocd |
| 37 | + # Deploy the app to a namespace matching its name |
| 38 | + namespace: '{{path.basename}}' |
28 | 39 | syncPolicy: |
29 | 40 | automated: |
30 | 41 | prune: true |
31 | 42 | selfHeal: true |
| 43 | + retry: |
| 44 | + limit: 5 |
| 45 | + backoff: |
| 46 | + duration: 10s |
| 47 | + factor: 2 |
| 48 | + maxDuration: 5m |
32 | 49 | syncOptions: |
33 | 50 | - CreateNamespace=true |
34 | | - - Replace=true |
| 51 | + - ServerSideApply=true |
| 52 | + - ApplyOutOfSyncOnly=true |
| 53 | + - PrunePropagationPolicy=foreground |
| 54 | + # Add robust ignore a-la the old appsets |
| 55 | + ignoreDifferences: |
| 56 | + - group: apps |
| 57 | + kind: Deployment |
| 58 | + jsonPointers: |
| 59 | + - /spec/replicas |
| 60 | + - group: "" |
| 61 | + kind: Service |
| 62 | + jsonPointers: |
| 63 | + - /spec/clusterIP |
| 64 | + - group: gateway.networking.k8s.io |
| 65 | + kind: HTTPRoute |
| 66 | + jsonPointers: |
| 67 | + - /spec/parentRefs/0/group |
| 68 | + - /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 | + - group: apiextensions.k8s.io |
| 81 | + kind: CustomResourceDefinition |
| 82 | + jsonPointers: |
| 83 | + - /spec/preserveUnknownFields |
0 commit comments