KubeZero/charts/kubezero/templates/_app.tpl

40 lines
1.0 KiB
Smarty
Raw Normal View History

2020-08-21 19:39:55 +00:00
{{- define "kubezero-app.app" }}
{{- $name := regexReplaceAll "kubezero/templates/([a-z-]*)..*" .Template.Name "${1}" }}
2021-11-11 13:53:23 +00:00
{{- if index .Values $name "enabled" }}
2020-08-21 19:39:55 +00:00
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ $name }}
namespace: argocd
labels:
{{- include "kubezero-lib.labels" . | nindent 4 }}
2020-08-21 19:39:55 +00:00
{{- if not ( index .Values $name "retain" ) }}
finalizers:
- resources-finalizer.argocd.argoproj.io
{{- end }}
spec:
project: kubezero
source:
chart: kubezero-{{ $name }}
repoURL: {{ .Values.kubezero.repoURL }}
targetRevision: {{ default .Values.kubezero.targetRevision ( index .Values $name "targetRevision" ) | quote }}
2020-08-21 19:39:55 +00:00
helm:
values: |
2020-11-26 13:21:10 +00:00
{{- include (print $name "-values") $ | nindent 8 }}
2020-08-21 19:39:55 +00:00
destination:
server: {{ .Values.kubezero.server }}
2020-08-21 19:39:55 +00:00
namespace: {{ default "kube-system" ( index .Values $name "namespace" ) }}
syncPolicy:
syncOptions:
- CreateNamespace=true
{{- toYaml .Values.kubezero.syncPolicy | nindent 4 }}
2020-11-26 13:21:10 +00:00
{{- include (print $name "-argo") $ }}
{{- end }}
2020-08-21 19:39:55 +00:00
{{- end }}