KubeZero/charts/kubezero-app/templates/_app.yaml

42 lines
1.1 KiB
YAML

{{- define "kubezero-app.app" }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ .name | lower }}
namespace: argocd
labels:
{{ include "kubezero-lib.labels" .root | indent 4 }}
{{- if not .retain }}
finalizers:
- resources-finalizer.argocd.argoproj.io
{{ end }}
spec:
project: kubezero
source:
repoURL: {{ .root.Values.global.defaultSource.repoURL }}
targetRevision: {{ .root.Values.global.defaultSource.targetRevision }}
{{- if eq .type "helm" }}
{{- $my_values := index .root.Values .name "values" }}
path: {{ .root.Values.global.defaultSource.pathPrefix}}charts/kubezero-{{ .name }}
{{- if $my_values }}
helm:
values: |
{{- toYaml $my_values | nindent 8 }}
{{- end }}
{{- else }}
path: {{ .root.Values.global.defaultSource.pathPrefix }}artifacts/kubezero-{{ .name }}
{{- end }}
destination:
server: {{ .root.Values.global.defaultDestination.server }}
namespace: {{ default "kube-system" .namespace }}
syncPolicy:
automated:
prune: true
{{- if .selfheal }}
selfHeal: true
{{- end }}
{{- end }}