-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgithub-appset.yaml
81 lines (80 loc) · 2.53 KB
/
github-appset.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
# ApplicationSet template used for preview app in CI/CD
#
# You need to replace all values following the `<variable_name>` pattern
# and adapt some values from the current template.
# see. https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Pull-Request/#github
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
labels:
argocd.argoproj.io/secret-type: repo-creds
name: <github_repository>-preview-creds
namespace: <argocd_namespace>
stringData:
githubAppID: '<github_app_id>'
githubAppInstallationID: '<github_app_installation_id>'
githubAppPrivateKey: |-
<github_app_private_key>
---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: <github_repository>-preview
namespace: <argocd_namespace>
spec:
generators:
- pullRequest:
github:
owner: <github_username>
repo: <github_repository>
labels:
- preview
- built
appSecretName: <github_repository>-preview-creds # Secret containing Github App infos (see. https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#github-app-repositories)
template:
metadata:
name: <github_repository>-preview-pr-{{number}}
spec:
destination:
namespace: <github_repository>-pr-{{number}}
server: https://kubernetes.default.svc
project: <argocd_project>
source:
repoURL: https://github.com/<github_username>/<github_repository>.git
path: ./helm
targetRevision: main # 1.*.*
helm:
values: |
api:
image:
tag: pr-{{number}}
ingress:
annotations:
cert-manager.io/cluster-issuer: <cluster_issuer>
hosts:
- host: api.pr-{{number}}.domain.com
tls:
- secretName: api.pr-{{number}}.domain.com-tls
hosts:
- api.pr-{{number}}.domain.com
docs:
image:
tag: pr-{{number}}
ingress:
annotations:
cert-manager.io/cluster-issuer: <cluster_issuer>
hosts:
- host: docs.pr-{{number}}.domain.com
tls:
- secretName: docs.pr-{{number}}.domain.com-tls
hosts:
- docs.pr-{{number}}.domain.com
...
syncPolicy:
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
automated:
selfHeal: true