This commit is contained in:
David Landry 2023-11-12 14:19:06 -05:00
parent aedf31d10b
commit d07f159c53
2 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
apiVersion: v2
name: app-of-apps
type: application
version: 1.0.2

View file

@ -0,0 +1,49 @@
---
{{ range $k, $v := $.Values.apps }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ $v.name }}
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ $.Values.project }}
source:
repoURL: {{ $.Values.source.repoURL }}
targetRevision: main
path: {{ print $.Values.source.path "/" $v.path }}
{{- with $v.helm }}
helm:
{{- with .valueFiles }}
valueFiles:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with $v.plugin }}
plugin:
{{- toYaml . | nindent 6 }}
{{- end }}
destination:
server: {{ $.Values.destination.server }}
namespace: {{ $v.namespace }}
syncPolicy:
{{- if hasKey $v "selfHeal" | ternary $v.selfHeal false }}
automated:
selfHeal: {{ hasKey $v "selfHeal" | ternary $v.selfHeal false }}
{{- end }}
{{- with $v.managedNamespaceMetadata }}
managedNamespaceMetadata:
{{- toYaml . | nindent 6 }}
{{- end }}
syncOptions:
- CreateNamespace=true
{{- with $v.extraSyncOptions }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with $v.ignoreDifferences }}
ignoreDifferences:
{{- toYaml . | nindent 4 }}
{{- end }}
---
{{ end }}