khuedoan-homelab/bootstrap/root/templates/stack.yaml
Khue Doan bcb17a8f58 perf(argocd): turning on selective sync
https://argo-cd.readthedocs.io/en/stable/user-guide/sync-options/#selective-sync

Currently when syncing using auto sync ArgoCD applies every object in the application.
For applications containing thousands of objects this takes quite a long time and puts undue pressure on the api server.
Turning on selective sync option which will sync only out-of-sync resources.
2022-07-20 23:15:15 +07:00

41 lines
1.0 KiB
YAML

{{- range $index, $stack := .Values.stacks }}
---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: {{ $stack.name }}
namespace: {{ $.Release.Namespace }}
spec:
generators:
- git:
repoURL: {{ $.Values.gitops.repo }}
revision: {{ $.Values.gitops.revision }}
directories:
- path: {{ $stack.name }}/*
template:
metadata:
name: '{{ `{{path.basename}}` }}'
spec:
destination:
name: in-cluster
namespace: '{{ default `{{path.basename}}` $stack.namespace }}'
project: default # TODO
source:
repoURL: {{ $.Values.gitops.repo }}
path: '{{ `{{path}}` }}'
targetRevision: {{ $.Values.gitops.revision }}
syncPolicy:
automated:
prune: true
selfHeal: true
retry:
limit: 10
backoff:
duration: 1m
factor: 2
maxDuration: 16m
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
{{- end }}