2020-05-05 14:21:09 +00:00
|
|
|
{{- define "kubezero.app" }}
|
|
|
|
apiVersion: argoproj.io/v1alpha1
|
|
|
|
kind: Application
|
|
|
|
metadata:
|
2020-05-06 15:21:57 +00:00
|
|
|
name: {{ .name | lower }}
|
2020-05-05 14:21:09 +00:00
|
|
|
namespace: argocd
|
|
|
|
labels:
|
|
|
|
app.kubernetes.io/name: {{ .name }}
|
|
|
|
helm.sh/chart: {{ .root.Chart.Name }}-{{ .root.Chart.Version | replace "+" "_" }}
|
|
|
|
app.kubernetes.io/managed-by: {{ .root.Release.Service }}
|
|
|
|
app.kubernetes.io/part-of: kubezero
|
2020-05-14 17:24:51 +00:00
|
|
|
{{- if not .retain }}
|
|
|
|
finalizers:
|
|
|
|
- resources-finalizer.argocd.argoproj.io
|
|
|
|
{{ end }}
|
2020-05-05 14:21:09 +00:00
|
|
|
spec:
|
|
|
|
project: kubezero
|
|
|
|
|
|
|
|
source:
|
|
|
|
repoURL: {{ default .root.Values.defaultSource.repoURL }}
|
|
|
|
targetRevision: {{ default .root.Values.defaultSource.targetRevision }}
|
|
|
|
{{- if eq .type "helm" }}
|
2020-05-14 17:24:51 +00:00
|
|
|
{{ $my_values := index .root.Values .name "values" }}
|
2020-05-06 17:20:53 +00:00
|
|
|
path: {{ default .root.Values.defaultSource.pathPrefix }}charts/kubezero-{{ .name }}
|
2020-05-14 17:24:51 +00:00
|
|
|
{{- if $my_values }}
|
2020-05-06 14:47:51 +00:00
|
|
|
helm:
|
2020-05-06 15:24:33 +00:00
|
|
|
values: |
|
2020-05-14 17:24:51 +00:00
|
|
|
{{- toYaml $my_values | nindent 8 }}
|
2020-05-06 14:47:51 +00:00
|
|
|
{{- end }}
|
2020-05-05 14:21:09 +00:00
|
|
|
{{- else }}
|
2020-05-06 17:20:53 +00:00
|
|
|
path: {{ default .root.Values.defaultSource.pathPrefix }}artifacts/kubezero-{{ .name }}
|
2020-05-05 14:21:09 +00:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
destination:
|
|
|
|
server: {{ default .root.Values.defaultDestination.server }}
|
2020-05-07 11:26:43 +00:00
|
|
|
namespace: {{ default "kube-system" .namespace }}
|
2020-05-11 11:27:13 +00:00
|
|
|
|
|
|
|
syncPolicy:
|
|
|
|
automated:
|
|
|
|
prune: true
|
|
|
|
selfHeal: false
|
2020-05-05 14:21:09 +00:00
|
|
|
{{- end }}
|