Repository navigation
Expand file tree
/
Copy pathappset.yaml
More file actions
121 lines (121 loc) · 5.21 KB
/
Copy pathappset.yaml
File metadata and controls
121 lines (121 loc) · 5.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Layering ApplicationSet — the "chart-app" engine.
#
# ONE instance, hosted in oci-lab's Argo CD (embedded via OCI's Talos inline
# manifests). It covers BOTH clusters: unraid-lab is reconciled remotely through
# the registered external cluster. Application destinations differ per element:
# registered cluster name `unraid-lab` for Unraid and in-cluster server for OCI.
#
# Selection (which apps run): three git generators —
# apps/*/app.yaml shared (every cluster)
# types/<clusterType>/apps/*/app.yaml per cluster-TYPE
# clusters/<clusterName>/apps/*/app.yaml per CLUSTER
# Values (override anything the chart exposes): deep-merge valueFiles —
# values/base/<app>.yaml -> values/types/<type>/<app>.yaml -> values/clusters/<name>/<app>.yaml
# Custom ApplicationSets (e.g. arc-runners) are NOT chart-apps and run on the raw
# directory-sync lane (clusters/<name>/apps/*/application.yaml), not here.
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: apps
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- matrix: # shared apps
generators:
- list:
elements:
- clusterName: unraid-lab
clusterType: homelab-kvm
destinationName: unraid-lab
destinationServer: ""
- clusterName: oci-lab
clusterType: cloud
destinationName: ""
destinationServer: https://kubernetes.default.svc
- git:
repoURL: https://github.com/syscode-labs/syscode-homelab-gitops-apps
revision: HEAD
files:
- path: apps/*/app.yaml
- matrix: # per cluster-TYPE apps
generators:
- list:
elements:
- clusterName: unraid-lab
clusterType: homelab-kvm
destinationName: unraid-lab
destinationServer: ""
- clusterName: oci-lab
clusterType: cloud
destinationName: ""
destinationServer: https://kubernetes.default.svc
- git:
repoURL: https://github.com/syscode-labs/syscode-homelab-gitops-apps
revision: HEAD
files:
- path: types/{{.clusterType}}/apps/*/app.yaml
- matrix: # per CLUSTER apps
generators:
- list:
elements:
- clusterName: unraid-lab
clusterType: homelab-kvm
destinationName: unraid-lab
destinationServer: ""
- clusterName: oci-lab
clusterType: cloud
destinationName: ""
destinationServer: https://kubernetes.default.svc
- git:
repoURL: https://github.com/syscode-labs/syscode-homelab-gitops-apps
revision: HEAD
files:
- path: clusters/{{.clusterName}}/apps/*/app.yaml
template:
metadata:
# Every chart-app Application is cluster-prefixed (e.g. unraid-lab-cilium,
# oci-lab-cilium) so the Applications list is scannable without inferring
# from Destination or label. Rule: never use unprefixed {{.path.basename}}.
name: '{{ .clusterName }}-{{ .path.basename }}'
labels:
syscode.io/cluster: '{{ .clusterName }}'
annotations:
# Kubernetes 1.36 exposes Deployment status fields that older ArgoCD
# schemas do not understand. Use Kubernetes server-side diffing.
argocd.argoproj.io/compare-options: ServerSideDiff=true
spec:
project: default
sources:
- repoURL: "{{.repoURL}}"
chart: "{{.chart}}"
targetRevision: "{{.version}}"
helm:
ignoreMissingValueFiles: true # type/cluster value files are optional
valueFiles:
- $v/values/base/{{.path.basename}}.yaml
- $v/values/types/{{.clusterType}}/{{.path.basename}}.yaml
- $v/values/clusters/{{.clusterName}}/{{.path.basename}}.yaml
- repoURL: https://github.com/syscode-labs/syscode-homelab-gitops-apps
targetRevision: HEAD
ref: v
destination:
# unraid-lab is remote and identified by the Secret in OCI's argocd
# namespace. OCI uses its in-cluster API server. Exactly one of
# name/server is set per element — Argo resolves by name when server is
# empty, by server when name is empty. The fields stay pure YAML:
# ApplicationSet templates render AFTER YAML parsing, so conditional
# KEYS are not possible here; per-element params keep it parseable.
name: "{{ .destinationName }}"
server: "{{ .destinationServer }}"
namespace: "{{.namespace}}"
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
# Allow a CRD-owning chart to establish its custom resource type when
# API discovery lags a cold-cluster bootstrap.
- SkipDryRunOnMissingResource=true