Skip to content

Commit dd37270

Browse files
fix(gitops): split ApplicationSet for dev Image Updater support
- Split tenant-apps into tenant-apps-dev (with Image Updater) and tenant-apps (tst/stg/prd) - Enable goTemplate for proper variable interpolation - Image Updater writes to tenants/.../overlays/dev/values.yaml - Remove legacy base/application.yaml (now managed by ApplicationSet) - Remove legacy clusters/dev/chat-values.yaml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a9942da commit dd37270

File tree

4 files changed

+71
-69
lines changed

4 files changed

+71
-69
lines changed

clusters/dev/chat-values.yaml

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

platform/gitops/appsets/tenant-apps.yaml

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
apiVersion: argoproj.io/v1alpha1
22
kind: ApplicationSet
33
metadata:
4-
name: tenant-apps
4+
name: tenant-apps-dev
55
namespace: argocd
66
spec:
7+
goTemplate: true
8+
goTemplateOptions: ["missingkey=error"]
79
generators:
810
- matrix:
911
generators:
@@ -15,6 +17,64 @@ spec:
1517
elements:
1618
- cluster: in-cluster
1719
env: dev
20+
template:
21+
metadata:
22+
name: '{{ .team }}-{{ .app }}-{{ .env }}'
23+
namespace: argocd
24+
labels:
25+
team: '{{ .team }}'
26+
app: '{{ .app }}'
27+
env: '{{ .env }}'
28+
annotations:
29+
argocd-image-updater.argoproj.io/image-list: chat=ghcr.io/justgithubaccount/chat-api:~1
30+
argocd-image-updater.argoproj.io/chat.update-strategy: semver
31+
argocd-image-updater.argoproj.io/chat.helm.image-tag: image.tag
32+
argocd-image-updater.argoproj.io/write-back-method: git
33+
argocd-image-updater.argoproj.io/write-back-target: 'kustomization:tenants/{{ .team }}/apps/{{ .app }}/overlays/{{ .env }}/values.yaml'
34+
argocd-image-updater.argoproj.io/git-branch: main
35+
finalizers:
36+
- resources-finalizer.argocd.argoproj.io
37+
spec:
38+
project: tenants
39+
destination:
40+
name: '{{ .cluster }}'
41+
namespace: '{{ .team }}'
42+
sources:
43+
- repoURL: https://github.com/justgithubaccount/app-poly-gitops-helm
44+
targetRevision: main
45+
path: chat
46+
helm:
47+
valueFiles:
48+
- values.yaml
49+
- $values/values.yaml
50+
- repoURL: https://github.com/justgithubaccount/app-poly-gitops-k8s
51+
targetRevision: main
52+
path: 'tenants/{{ .team }}/apps/{{ .app }}/overlays/{{ .env }}'
53+
ref: values
54+
syncPolicy:
55+
automated:
56+
prune: true
57+
selfHeal: true
58+
syncOptions:
59+
- CreateNamespace=true
60+
---
61+
apiVersion: argoproj.io/v1alpha1
62+
kind: ApplicationSet
63+
metadata:
64+
name: tenant-apps
65+
namespace: argocd
66+
spec:
67+
goTemplate: true
68+
goTemplateOptions: ["missingkey=error"]
69+
generators:
70+
- matrix:
71+
generators:
72+
- list:
73+
elements:
74+
- app: chat
75+
team: product-team
76+
- list:
77+
elements:
1878
- cluster: tst-cluster
1979
env: tst
2080
- cluster: stg-cluster
@@ -23,19 +83,19 @@ spec:
2383
env: prd
2484
template:
2585
metadata:
26-
name: '{{team}}-{{app}}-{{env}}'
86+
name: '{{ .team }}-{{ .app }}-{{ .env }}'
2787
namespace: argocd
2888
labels:
29-
team: '{{team}}'
30-
app: '{{app}}'
31-
env: '{{env}}'
89+
team: '{{ .team }}'
90+
app: '{{ .app }}'
91+
env: '{{ .env }}'
3292
finalizers:
3393
- resources-finalizer.argocd.argoproj.io
3494
spec:
3595
project: tenants
3696
destination:
37-
name: '{{cluster}}'
38-
namespace: '{{team}}'
97+
name: '{{ .cluster }}'
98+
namespace: '{{ .team }}'
3999
sources:
40100
- repoURL: https://github.com/justgithubaccount/app-poly-gitops-helm
41101
targetRevision: main
@@ -46,7 +106,7 @@ spec:
46106
- $values/values.yaml
47107
- repoURL: https://github.com/justgithubaccount/app-poly-gitops-k8s
48108
targetRevision: main
49-
path: tenants/{{team}}/apps/{{app}}/overlays/{{env}}
109+
path: 'tenants/{{ .team }}/apps/{{ .app }}/overlays/{{ .env }}'
50110
ref: values
51111
syncPolicy:
52112
automated:

tenants/product-team/apps/chat/base/application.yaml

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

4-
resources:
5-
- application.yaml
4+
# Application managed by ApplicationSet in platform/gitops/appsets/tenant-apps.yaml
5+
# This directory contains shared resources for the chat application
6+
resources: []

0 commit comments

Comments
 (0)