-
Notifications
You must be signed in to change notification settings - Fork 0
/
argo-application.yaml
115 lines (115 loc) · 3.22 KB
/
argo-application.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{{- if .Values.argoApplications }}
{{- if .Values.applications }}
{{- $secrets := .Values.secretsEnabled }}
{{- $release := .Values.release }}
{{- $source := .Values.source }}
{{- $team := .Values.team }}
{{- $participant := .Values.participant }}
{{- $host := .Values.host }}
{{- $tlsSecret := .Values.tlsSecret }}
{{- $argoNamespace := .Values.argoNamespace -}}
{{- range $app := .Values.applications }}
{{- if $app.source }}
{{- $source = $app.source }}
{{- end }}
{{- if $app.enabled }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
finalizers:
- resources-finalizer.argocd.argoproj.io
{{- if or (eq $release "ci-cd") (eq $release "cluster-ops") (eq $release "pm") }}
name: {{ .name }}
{{- else }}
name: {{ $release }}-{{ .name }}
{{- end }}
{{- if $argoNamespace }}
namespace: {{ $argoNamespace }}
{{- end }}
labels:
destination-namespace: {{ .destination }}
purpose: {{ .purpose }}
participant: {{ $participant }}
{{- if .values }}
{{- if .values.fullnameOverride }}
{{- if contains .values.fullnameOverride .name }}
app.kubernetes.io/instance: {{ .values.fullnameOverride }}
{{- end }}
{{- else }}
app.kubernetes.io/instance: {{ .name }}
{{- end }}
{{- end }}
spec:
destination:
namespace: {{ .destination | default (printf "%s-%s" $team $release) }}
server: {{ .cluster_api | default "https://kubernetes.default.svc" }}
project: {{ .project | default "default" }}
source:
{{- if or .helm_values .values }}
helm:
{{- if .helm_values }}
valueFiles:
{{- toYaml .helm_values | nindent 8 }}
{{- if $app.secretsReady }}
{{- if $secrets }}
- values-secured.yaml
{{- else }}
- values-unsecured.yaml
{{- end }}
{{- end }}
{{- end }}
{{- if or (.values) ($host) ($tlsSecret) (.overwriteHost) (.overwriteSecret) }}
values: |
{{- if or ($host) ($tlsSecret) (.overwriteHost) (.overwriteSecret) }}
route:
{{- if .overwriteSecret }}
annotations:
cert-utils-operator.redhat-cop.io/certs-from-secret: {{ .overwriteSecret }}
{{- else if ($tlsSecret) }}
annotations:
cert-utils-operator.redhat-cop.io/certs-from-secret: {{ $tlsSecret }}
{{- end }}
{{- if .overwriteHost }}
host: {{ .overwriteHost }}
{{- else if ($host) }}
host: {{ .name }}.{{ $host }}
{{- end }}
{{- end }}
{{- if (.values) }}
{{- toYaml .values | nindent 8 }}
{{- end }}
{{- end }}
{{- if or .releaseName .name }}
releaseName: {{ .releaseName | default .name }}
{{- end }}
{{- end }}
{{- if .source_path }}
path: {{ .source_path | default "." }}
{{- end }}
repoURL: {{ $source }}
targetRevision: {{ .source_ref | default "main" | quote }}
{{- if not .source_path }}
chart: {{ .chart_name | default .name }}
{{- end }}
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- Validate=true
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas
- /spec/template/spec/containers/0/image
- /spec/template/spec/containers/1/image
- group: integreatly.org
kind: GrafanaDataSource
jsonPointers:
- /spec/datasources/0/secureJsonData/httpHeaderValue1
{{- end }}
{{- end }}
{{- end }}
{{- end }}