File tree Expand file tree Collapse file tree 10 files changed +44
-16
lines changed Expand file tree Collapse file tree 10 files changed +44
-16
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ dependencies:
32
32
- name : sealed-secrets
33
33
repository : https://bitnami-labs.github.io/sealed-secrets/
34
34
version : 2.17.2
35
+ condition : sealed-secrets.enabled
35
36
- name : codefresh-tunnel-client
36
37
repository : oci://quay.io/codefresh/charts
37
38
version : 0.1.21
Original file line number Diff line number Diff line change 11
11
{{/* Workaround to NOT change label selectors from previous runtime release when event-reporter was part of cf-argocd-extras Subchart */}}
12
12
{{- $_ := set $context.Values "nameOverride" "cf-argocd-extras" }}
13
13
14
+ {{/* Remove nonResourceURLs when RBAC is namespaced */}}
15
+ {{- $rules := $context.Values.rbac.rules }}
16
+ {{- if $context.Values.rbac.namespaced }}
17
+ {{- $rules = list }}
18
+ {{- range $context.Values.rbac.rules }}
19
+ {{- if not .nonResourceURLs }}
20
+ {{- $rules = append $rules . }}
21
+ {{- end }}
22
+ {{- end }}
23
+ {{- end }}
24
+ {{- $_ := set $context.Values.rbac "rules" $rules }}
25
+
14
26
{{- $templateName := printf "cf-common-%s.rbac" (index .Subcharts "cf-common").Chart.Version }}
15
27
{{- include $templateName $context }}
16
28
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ global:
14
14
15
15
replicaCount: 1
16
16
17
+ # -- Restrict the gitops operator to a single namespace (by the namespace of Helm release)
18
+ singleNamespace: false
19
+
17
20
# -- Codefresh gitops operator crds
18
21
crds:
19
22
# -- Whether or not to install CRDs
Original file line number Diff line number Diff line change 1
1
2
2
{{- define "gitops-operator.resources.promotion-template-rbac" }}
3
3
apiVersion : rbac.authorization.k8s.io/v1
4
- kind : ClusterRole
4
+ kind : {{ .Values.singleNamespace | ternary "Role" " ClusterRole" }}
5
5
metadata :
6
6
labels :
7
7
{{- include "gitops-operator.selectorLabels" . | nindent 4 }}
@@ -45,14 +45,14 @@ rules:
45
45
46
46
---
47
47
apiVersion : rbac.authorization.k8s.io/v1
48
- kind : ClusterRoleBinding
48
+ kind : {{ .Values.singleNamespace | ternary "RoleBinding" " ClusterRoleBinding" }}
49
49
metadata :
50
50
labels :
51
51
{{- include "gitops-operator.selectorLabels" . | nindent 4 }}
52
52
name : promotion-template
53
53
roleRef :
54
54
apiGroup : rbac.authorization.k8s.io
55
- kind : ClusterRole
55
+ kind : {{ .Values.singleNamespace | ternary "Role" " ClusterRole" }}
56
56
name : promotion-template
57
57
subjects :
58
58
- kind : ServiceAccount
Original file line number Diff line number Diff line change 1
1
2
2
{{- define "gitops-operator.resources.auth-proxy-rbac" }}
3
3
apiVersion : rbac.authorization.k8s.io/v1
4
- kind : ClusterRole
4
+ kind : {{ .Values.singleNamespace | ternary "Role" " ClusterRole" }}
5
5
metadata :
6
6
labels :
7
7
{{- include "gitops-operator.selectorLabels" . | nindent 4 }}
@@ -22,14 +22,14 @@ rules:
22
22
23
23
---
24
24
apiVersion : rbac.authorization.k8s.io/v1
25
- kind : ClusterRoleBinding
25
+ kind : {{ .Values.singleNamespace | ternary "RoleBinding" " ClusterRoleBinding" }}
26
26
metadata :
27
27
labels :
28
28
{{- include "gitops-operator.selectorLabels" . | nindent 4 }}
29
29
name : codefresh-gitops-operator-proxy
30
30
roleRef :
31
31
apiGroup : rbac.authorization.k8s.io
32
- kind : ClusterRole
32
+ kind : {{ .Values.singleNamespace | ternary "Role" " ClusterRole" }}
33
33
name : codefresh-gitops-operator-proxy
34
34
subjects :
35
35
- kind : ServiceAccount
Original file line number Diff line number Diff line change 1
1
2
2
{{- define "gitops-operator.resources.rbac-operator" }}
3
3
apiVersion : rbac.authorization.k8s.io/v1
4
- kind : ClusterRole
4
+ kind : {{ .Values.singleNamespace | ternary "Role" " ClusterRole" }}
5
5
metadata :
6
6
labels :
7
7
{{- include "gitops-operator.selectorLabels" . | nindent 4 }}
26
26
- patch
27
27
- update
28
28
- watch
29
+ {{- if not .Values.singleNamespace }}
29
30
- apiGroups :
30
31
- codefresh.io
31
32
resources :
52
53
- get
53
54
- patch
54
55
- update
56
+ {{- end }}
55
57
- apiGroups :
56
58
- " "
57
59
resources :
@@ -72,29 +74,29 @@ rules:
72
74
73
75
---
74
76
apiVersion : rbac.authorization.k8s.io/v1
75
- kind : ClusterRoleBinding
77
+ kind : {{ .Values.singleNamespace | ternary "RoleBinding" " ClusterRoleBinding" }}
76
78
metadata :
77
79
labels :
78
80
{{- include "gitops-operator.selectorLabels" . | nindent 4 }}
79
81
name : codefresh-gitops-operator
80
82
roleRef :
81
83
apiGroup : rbac.authorization.k8s.io
82
- kind : ClusterRole
84
+ kind : {{ .Values.singleNamespace | ternary "Role" " ClusterRole" }}
83
85
name : codefresh-gitops-operator
84
86
subjects :
85
87
- kind : ServiceAccount
86
88
name : {{ include "gitops-operator.serviceAccountName" . }}
87
89
namespace : {{ .Release.Namespace }}
88
90
---
89
91
apiVersion : rbac.authorization.k8s.io/v1
90
- kind : ClusterRoleBinding
92
+ kind : {{ .Values.singleNamespace | ternary "RoleBinding" " ClusterRoleBinding" }}
91
93
metadata :
92
94
labels :
93
95
{{- include "gitops-operator.selectorLabels" . | nindent 4 }}
94
96
name : codefresh-gitops-operator-workflows
95
97
roleRef :
96
98
apiGroup : rbac.authorization.k8s.io
97
- kind : ClusterRole
99
+ kind : {{ .Values.singleNamespace | ternary "Role" " ClusterRole" }}
98
100
name : argo-edit
99
101
subjects :
100
102
- kind : ServiceAccount
Original file line number Diff line number Diff line change 1
1
2
2
{{- define "gitops-operator.resources.restricted-git-source-rbac" }}
3
+ {{- if not .Values.singleNamespace }}
3
4
apiVersion : rbac.authorization.k8s.io/v1
4
5
kind : ClusterRole
5
6
metadata :
@@ -80,4 +81,5 @@ subjects:
80
81
- kind : ServiceAccount
81
82
name : {{ include "gitops-operator.serviceAccountName" . }}
82
83
namespace : {{ .Release.Namespace }}
84
+ {{- end }}
83
85
{{- end }}
Original file line number Diff line number Diff line change @@ -431,11 +431,14 @@ Output comma separated list of installed runtime components
431
431
*/} }
432
432
{ {- define " codefresh-gitops-runtime.component-list" } }
433
433
{ {- $argoEvents := dict " name" " argo-events" " version" (get .Subcharts " argo-events" ).Chart.AppVersion } }
434
- { {- $sealedSecrets := dict " name" " sealed-secrets" " version" (get .Subcharts " sealed-secrets" ).Chart.AppVersion } }
435
434
{ {- $internalRouter := dict " name" " internal-router" " version" .Chart.AppVersion } }
436
435
{ {- $appProxy := dict " name" " app-proxy" " version" (index (get .Values " app-proxy" ) " image" " tag" ) } }
437
436
{ {- $sourcesServer := dict " name" " sources-server" " version" (get .Values " cf-argocd-extras" ).sourcesServer.container.image.tag } }
438
- { {- $comptList := list $argoEvents $appProxy $sealedSecrets $internalRouter $sourcesServer } }
437
+ { {- $comptList := list $argoEvents $appProxy $internalRouter $sourcesServer } }
438
+ { {- if and (index .Values " sealed-secrets" " enabled" ) } }
439
+ { {- $sealedSecrets := dict " name" " sealed-secrets" " version" (get .Subcharts " sealed-secrets" ).Chart.AppVersion } }
440
+ { {- $comptList = append $comptList $sealedSecrets } }
441
+ { {- end } }
439
442
{ {- if and (index .Values " argo-cd" " enabled" ) } }
440
443
{ {- $argoCD := dict " name" " argocd" " version" (get .Subcharts " argo-cd" ).Chart.AppVersion } }
441
444
{ {- $comptList = append $comptList $argoCD } }
Original file line number Diff line number Diff line change 4
4
{{- $_ := set $appProxyContext "Values" (deepCopy (get .Values "app-proxy")) }}
5
5
{{- $_ := set $appProxyContext.Values "global" (deepCopy (get .Values "global")) }}
6
6
apiVersion : rbac.authorization.k8s.io/v1
7
- kind : ClusterRoleBinding
7
+ kind : {{ $appProxyContext.Values.singleNamespace | ternary "RoleBinding" " ClusterRoleBinding" }}
8
8
metadata :
9
9
name : cap-app-proxy-argo-workflows
10
10
roleRef :
11
11
apiGroup : rbac.authorization.k8s.io
12
- kind : ClusterRole
12
+ kind : {{ $appProxyContext.Values.singleNamespace | ternary "Role" " ClusterRole" }}
13
13
name : {{ include "codefresh-gitops-runtime.argo-workflows.server.name" . }}
14
14
subjects :
15
15
- kind : ServiceAccount
Original file line number Diff line number Diff line change @@ -519,6 +519,8 @@ tunnel-client:
519
519
# -----------------------------------------------------------------------------------------------------------------------
520
520
app-proxy :
521
521
replicaCount : 1
522
+ # -- Restrict the app-proxy to a single namespace (by the namespace of Helm release)
523
+ singleNamespace : false
522
524
# -- Image enrichment process configuration
523
525
image-enrichment :
524
526
# -- Enable or disable enrichment process. Please note that for enrichemnt, argo-workflows has to be enabled as well.
@@ -685,6 +687,9 @@ gitops-operator:
685
687
annotations : {}
686
688
# -- Additional labels for gitops operator CRDs
687
689
additionalLabels : {}
690
+ # -- Restrict the gitops operator to a single namespace (by the namespace of Helm release)
691
+ singleNamespace : false
692
+ # -- GitOps operator configuration
688
693
config :
689
694
# -- Task polling interval
690
695
taskPollingInterval : 10s
@@ -696,8 +701,8 @@ gitops-operator:
696
701
maxConcurrentReleases : 100
697
702
# -- An optional template for the promotion wrapper (empty default will use the embedded one)
698
703
promotionWrapperTemplate : ' '
704
+ # -- GitOps operator image
699
705
image :
700
- # -- defaults
701
706
registry : quay.io
702
707
repository : codefresh/codefresh-gitops-operator
703
708
tag : v0.8.7
You can’t perform that action at this time.
0 commit comments