Add gitops
This commit is contained in:
parent
7acdc5e970
commit
d204047979
20
gitops/root-app.yaml
Normal file
20
gitops/root-app.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: root
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: https://git.bouvais.lu/adrien/ctie-exercice
|
||||
targetRevision: main
|
||||
path: gitops
|
||||
directory:
|
||||
recurse: true
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: argocd
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
37
gitops/tenants-appset.yaml
Normal file
37
gitops/tenants-appset.yaml
Normal file
@ -0,0 +1,37 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
name: tenants
|
||||
namespace: argocd
|
||||
spec:
|
||||
goTemplate: true
|
||||
generators:
|
||||
- git:
|
||||
repoURL: https://git.bouvais.lu/adrien/ctie-exercice
|
||||
revision: main
|
||||
files:
|
||||
- path: "tenants/*/config.yaml"
|
||||
template:
|
||||
metadata:
|
||||
name: 'tenant-{{.name}}'
|
||||
spec:
|
||||
project: tenants
|
||||
sources:
|
||||
- repoURL: https://git.bouvais.lu/adrien/ctie-exercice
|
||||
targetRevision: main
|
||||
path: charts/tenant
|
||||
helm:
|
||||
valueFiles:
|
||||
- '$values/tenants/{{.name}}/config.yaml'
|
||||
- repoURL: https://git.bouvais.lu/adrien/ctie-exercice
|
||||
targetRevision: main
|
||||
ref: values
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: 'tenant-{{.name}}'
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
15
gitops/tenants-project.yaml
Normal file
15
gitops/tenants-project.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: AppProject
|
||||
metadata:
|
||||
name: tenants
|
||||
namespace: argocd
|
||||
spec:
|
||||
sourceRepos:
|
||||
- https://git.bouvais.lu/adrien/ctie-exercice
|
||||
destinations:
|
||||
- server: https://kubernetes.default.svc
|
||||
namespace: 'tenant-*'
|
||||
clusterResourceWhitelist: [] # tenants can't touch cluster-scoped resources
|
||||
namespaceResourceWhitelist:
|
||||
- group: '*'
|
||||
kind: '*'
|
||||
Loading…
x
Reference in New Issue
Block a user