Skip to content

Commit 0533996

Browse files
authored
Merge pull request #295 from cloudogu/feature/central-argo-namespace-merged
Feature/central argo namespace merged
2 parents 0141363 + a53953d commit 0533996

File tree

20 files changed

+162
-69
lines changed

20 files changed

+162
-69
lines changed

argocd/argocd/multiTenant/central/applications/argocd.ftl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1
22
kind: Application
33
metadata:
44
name: ${namePrefix}argocd
5-
namespace: argocd
5+
namespace: ${config.multiTenant.centralArgocdNamespace}
66
annotations:
77
# Only app with the sync-status-unknown alert, so that we only get one alert when SCM is not reachable.
88
# Otherwise, there would be a spam wave by every application everytime the SCM is not reachable.

argocd/argocd/multiTenant/central/applications/bootstrap.ftl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: argoproj.io/v1alpha1
33
kind: Application
44
metadata:
55
name: ${namePrefix}bootstrap
6-
namespace: argocd
6+
namespace: ${config.multiTenant.centralArgocdNamespace}
77
# finalizer disabled, because otherwise everything under this Application would be deleted as well, if this Application is deleted by accident
88
# finalizers:
99
# - resources-finalizer.argocd.argoproj.io

argocd/argocd/multiTenant/central/applications/cluster-resources.ftl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1
22
kind: Application
33
metadata:
44
name: ${namePrefix}cluster-resources
5-
namespace: argocd
5+
namespace: ${config.multiTenant.centralArgocdNamespace}
66
# finalizer disabled, because otherwise everything under this Application would be deleted as well, if this Application is deleted by accident
77
# finalizers:
88
# - resources-finalizer.argocd.argoproj.io

argocd/argocd/multiTenant/central/applications/projects.ftl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1
22
kind: Application
33
metadata:
44
name: ${namePrefix}projects
5-
namespace: argocd
5+
namespace: ${config.multiTenant.centralArgocdNamespace}
66
# finalizer disabled, because otherwise everything under this Application would be deleted as well, if this Application is deleted by accident
77
# finalizers:
88
# - resources-finalizer.argocd.argoproj.io

argocd/argocd/multiTenant/central/projects/tenant.ftl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: argoproj.io/v1alpha1
22
kind: AppProject
33
metadata:
44
name: ${tenantName}
5-
namespace: argocd
5+
namespace: ${config.multiTenant.centralArgocdNamespace}
66
spec:
77
description: Contains Cluster Ressources for MultiTentant Mode
88
destinations:

argocd/argocd/multiTenant/tenant/applications/bootstrap.ftl.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
destination:
1212
server: https://kubernetes.default.svc
1313
namespace: ${namePrefix}argocd
14-
project: default
14+
project: argocd
1515
source:
1616
path: applications/
1717
repoURL: ${scmm.repoUrl}argocd/argocd
@@ -36,7 +36,7 @@ spec:
3636
destination:
3737
server: https://kubernetes.default.svc
3838
namespace: ${namePrefix}argocd
39-
project: default
39+
project: argocd
4040
source:
4141
path: projects/
4242
repoURL: ${scmm.repoUrl}argocd/argocd
@@ -49,7 +49,7 @@ spec:
4949
selfHeal: true
5050
---
5151
#duplicate from argocd/projects/
52-
<#if config.multiTenant.useDedicatedInstance>
52+
<#if config.multiTenant.useDedicatedInstance && config.content.examples>
5353
apiVersion: argoproj.io/v1alpha1
5454
kind: AppProject
5555
metadata:

argocd/argocd/multiTenant/tenant/projects/.gitkeep

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: AppProject
3+
metadata:
4+
name: argocd
5+
namespace: ${namePrefix}argocd
6+
annotations:
7+
<#if mail.active?? && mail.active>
8+
notifications.argoproj.io/subscribe.email: ${argocd.emailToAdmin}
9+
</#if>
10+
spec:
11+
description: AppProject for ArgoCD-specific applications.
12+
destinations:
13+
- namespace: '*'
14+
server: https://kubernetes.default.svc
15+
clusterResourceWhitelist:
16+
- group: '*'
17+
kind: '*'
18+
# must be able to get all git repos because of the Applications pointing to other repos
19+
sourceRepos:
20+
- '*'
21+
# Allow applications from all namespaces to use this project for now.
22+
sourceNamespaces:
23+
- '*'
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: AppProject
3+
metadata:
4+
name: default
5+
namespace: ${namePrefix}argocd
6+
annotations:
7+
<#if mail.active?? && mail.active>
8+
notifications.argoproj.io/subscribe.email: ${argocd.emailToAdmin}
9+
</#if>
10+
spec:
11+
description: Default fallback AppProject if none other is specified. Is not allowed to do anything.
12+
clusterResourceWhitelist:
13+
destinations:
14+
sourceRepos:
15+
sourceNamespaces:

docs/configuration.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@
262262
}
263263
}
264264
},
265+
"namespace" : {
266+
"type" : [ "string", "null" ],
267+
"description" : "Defines the kubernetes namespace for ArgoCD"
268+
},
265269
"operator" : {
266270
"type" : [ "boolean", "null" ],
267271
"description" : "Install ArgoCD via an already running ArgoCD Operator"
@@ -709,6 +713,14 @@
709713
"multiTenant" : {
710714
"type" : [ "object", "null" ],
711715
"properties" : {
716+
"centralArgocdNamespace" : {
717+
"type" : [ "string", "null" ],
718+
"description" : "CENTRAL Argocd Repo Namespace"
719+
},
720+
"centralSCMamespace" : {
721+
"type" : [ "string", "null" ],
722+
"description" : "CENTRAL Argocd Repo Namespace"
723+
},
712724
"centralScmUrl" : {
713725
"type" : [ "string", "null" ],
714726
"description" : "URL for the centralized Management Repo"

0 commit comments

Comments
 (0)