-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy path01-bootstrap.yaml
41 lines (41 loc) · 1.26 KB
/
01-bootstrap.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
{{- $httpCredentialsProvided := and (not (empty .Variables.gitRepositoryHttpUsername)) (not (empty .Variables.gitRepositoryHttpPassword)) -}}
---
apiVersion: v1
kind: Secret
metadata:
name: cluster-bootstrap-repository
namespace: argocd
labels:
argocd.argoproj.io/secret-type: repository
data:
url: {{ .Variables.gitRepositoryUrl | b64enc | quote }}
{{- if $httpCredentialsProvided }}
password: {{ .Variables.gitRepositoryHttpPassword | b64enc | quote }}
username: {{ .Variables.gitRepositoryHttpUsername | b64enc | quote }}
{{- end }}
{{- if .Variables.gitRepositorySshPrivateKey }}
sshPrivateKey: |
{{ .Variables.gitRepositorySshPrivateKey | b64enc }}
{{- end }}
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cluster-bootstrap
namespace: argocd
spec:
destination:
server: https://kubernetes.default.svc
namespace: argocd
project: default
source:
directory:
recurse: true
path: {{ default (printf "./clusters/%s/bootstrap" .Cluster.Name) .Variables.manifestsPath | quote }}
repoURL: {{ .Variables.gitRepositoryUrl | quote }}
targetRevision: {{ default "main" .Variables.gitRepositoryBranch | quote}}
syncPolicy:
automated:
allowEmpty: true
prune: true
selfHeal: true