Skip to content

Commit 2599e82

Browse files
committed
cleanup
1 parent ea68f23 commit 2599e82

8 files changed

Lines changed: 105 additions & 247 deletions

infrastructure/infrastructure-components-appset.yaml

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

infrastructure/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
3-
43
resources:
54
- namespace.yaml
6-
- infrastructure-components-appset.yaml
5+
- projects.yaml

infrastructure/projects.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: AppProject
3+
metadata:
4+
name: infrastructure
5+
namespace: argocd
6+
spec:
7+
description: "Infrastructure components"
8+
sourceRepos:
9+
- '*'
10+
destinations:
11+
- namespace: '*'
12+
server: '*'
13+
clusterResourceWhitelist:
14+
- group: '*'
15+
kind: '*'
16+
---
17+
apiVersion: argoproj.io/v1alpha1
18+
kind: AppProject
19+
metadata:
20+
name: monitoring
21+
namespace: argocd
22+
spec:
23+
description: "Monitoring components"
24+
sourceRepos:
25+
- '*'
26+
destinations:
27+
- namespace: '*'
28+
server: '*'
29+
clusterResourceWhitelist:
30+
- group: '*'
31+
kind: '*'
32+
---
33+
apiVersion: argoproj.io/v1alpha1
34+
kind: AppProject
35+
metadata:
36+
name: my-apps
37+
namespace: argocd
38+
spec:
39+
description: "My applications"
40+
sourceRepos:
41+
- '*'
42+
destinations:
43+
- namespace: '*'
44+
server: '*'
45+
clusterResourceWhitelist:
46+
- group: '*'
47+
kind: '*'

infrastructure/root-appset.yaml

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,75 @@ spec:
99
repoURL: https://github.com/mitchross/k3s-argocd-proxmox.git
1010
revision: HEAD
1111
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/*
1516
template:
1617
metadata:
17-
name: '{{path.basename}}-app'
18+
# Create a unique name for each application
19+
name: '{{path.basename}}'
1820
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
1925
spec:
20-
project: default
26+
# Set project based on the top-level folder
27+
project: '{{path[0]}}'
2128
source:
2229
repoURL: https://github.com/mitchross/k3s-argocd-proxmox.git
2330
targetRevision: HEAD
2431
path: '{{path}}'
32+
# IMPORTANT: Apply the kustomize-helm plugin to all apps
33+
plugin:
34+
name: kustomize-build-with-helm
2535
destination:
2636
server: https://kubernetes.default.svc
27-
namespace: argocd
37+
# Deploy the app to a namespace matching its name
38+
namespace: '{{path.basename}}'
2839
syncPolicy:
2940
automated:
3041
prune: true
3142
selfHeal: true
43+
retry:
44+
limit: 5
45+
backoff:
46+
duration: 10s
47+
factor: 2
48+
maxDuration: 5m
3249
syncOptions:
3350
- 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

monitoring/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
3-
resources:
4-
- monitoring-components-appset.yaml
3+
resources: []

monitoring/monitoring-components-appset.yaml

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

my-apps/kustomization.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ namespace: argocd
44
commonLabels:
55
vanillax.me: app-management
66
app.kubernetes.io/managed-by: argocd
7-
87
resources:
9-

my-apps/myapplications-appset.yaml

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

0 commit comments

Comments
 (0)