KubeZero/charts/kubezero/templates/_app.tpl

40 lines
1.1 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}" }}
2020-11-26 13:21:10 +00:00
{{- if and .Values.argo ( 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" . | indent 4 }}
{{- if not ( index .Values $name "retain" ) }}
finalizers:
- resources-finalizer.argocd.argoproj.io
{{- end }}
spec:
project: kubezero
source:
2020-11-26 13:21:10 +00:00
repoURL: {{ .Values.global.kubezero.repoURL }}
targetRevision: {{ .Values.global.kubezero.targetRevision }}
path: {{ .Values.global.kubezero.pathPrefix}}charts/kubezero-{{ $name }}
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:
2020-11-26 13:21:10 +00:00
server: {{ .Values.global.kubezero.server }}
2020-08-21 19:39:55 +00:00
namespace: {{ default "kube-system" ( index .Values $name "namespace" ) }}
2020-11-26 13:21:10 +00:00
{{- with .Values.global.kubezero.syncPolicy }}
2020-08-21 19:39:55 +00:00
syncPolicy:
2020-11-26 13:21:10 +00:00
{{- toYaml . | nindent 4 }}
2020-08-21 19:39:55 +00:00
{{- end }}
2020-11-26 13:21:10 +00:00
{{- include (print $name "-argo") $ }}
{{- end }}
2020-08-21 19:39:55 +00:00
{{- end }}