Skip to content

Commit a9942da

Browse files
refactor(gitops): implement matrix generator for tenant apps
Replace simple list generator with matrix generator for multi-env support. Matrix generates 4 Applications automatically: - product-team-chat-dev → in-cluster - product-team-chat-tst → tst-cluster - product-team-chat-stg → stg-cluster - product-team-chat-prd → prd-cluster Features: - Multi-source: Helm chart + GitOps values - Dynamic path: tenants/{{team}}/apps/{{app}}/overlays/{{env}} - Environment-specific values from overlays - Labels for filtering (team, app, env) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent ba7cd0d commit a9942da

File tree

1 file changed

+40
-13
lines changed

1 file changed

+40
-13
lines changed

platform/gitops/appsets/tenant-apps.yaml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,52 @@ metadata:
55
namespace: argocd
66
spec:
77
generators:
8-
- list:
9-
elements:
10-
- name: chat-api
11-
path: tenants/product-team/apps/chat/base
12-
namespace: chat-api
8+
- matrix:
9+
generators:
10+
- list:
11+
elements:
12+
- app: chat
13+
team: product-team
14+
- list:
15+
elements:
16+
- cluster: in-cluster
17+
env: dev
18+
- cluster: tst-cluster
19+
env: tst
20+
- cluster: stg-cluster
21+
env: stg
22+
- cluster: prd-cluster
23+
env: prd
1324
template:
1425
metadata:
15-
name: '{{name}}'
26+
name: '{{team}}-{{app}}-{{env}}'
1627
namespace: argocd
28+
labels:
29+
team: '{{team}}'
30+
app: '{{app}}'
31+
env: '{{env}}'
32+
finalizers:
33+
- resources-finalizer.argocd.argoproj.io
1734
spec:
1835
project: tenants
19-
source:
20-
repoURL: https://github.com/justgithubaccount/app-poly-gitops-k8s.git
21-
targetRevision: main
22-
path: '{{path}}'
2336
destination:
24-
server: https://kubernetes.default.svc
25-
namespace: '{{namespace}}'
37+
name: '{{cluster}}'
38+
namespace: '{{team}}'
39+
sources:
40+
- repoURL: https://github.com/justgithubaccount/app-poly-gitops-helm
41+
targetRevision: main
42+
path: chat
43+
helm:
44+
valueFiles:
45+
- values.yaml
46+
- $values/values.yaml
47+
- repoURL: https://github.com/justgithubaccount/app-poly-gitops-k8s
48+
targetRevision: main
49+
path: tenants/{{team}}/apps/{{app}}/overlays/{{env}}
50+
ref: values
2651
syncPolicy:
2752
automated:
28-
selfHeal: true
2953
prune: true
54+
selfHeal: true
55+
syncOptions:
56+
- CreateNamespace=true

0 commit comments

Comments
 (0)