Skip to content

Commit 17553b1

Browse files
committed
update chart to use with cluster scope
1 parent b2a6036 commit 17553b1

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

Diff for: chart/kube-arangodb/templates/deployment-operator/role-binding.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
{{ if .Values.operator.features.deployment -}}
33

44
apiVersion: rbac.authorization.k8s.io/v1
5+
{{ if not (eq .Values.operator.scope "cluster") }}
56
kind: RoleBinding
7+
{{ else }}
8+
kind: ClusterRoleBinding
9+
{{ end }}
610
metadata:
711
name: {{ template "kube-arangodb.rbac" . }}-deployment
12+
{{ if not (eq .Values.operator.scope "cluster") }}
813
namespace: {{ .Release.Namespace }}
14+
{{ end }}
915
labels:
1016
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
1117
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
@@ -14,7 +20,11 @@ metadata:
1420
release: {{ .Release.Name }}
1521
roleRef:
1622
apiGroup: rbac.authorization.k8s.io
23+
{{ if not (eq .Values.operator.scope "cluster") }}
1724
kind: Role
25+
{{ else }}
26+
kind: ClusterRole
27+
{{ end }}
1828
name: {{ template "kube-arangodb.rbac" . }}-deployment
1929
subjects:
2030
- kind: ServiceAccount

Diff for: chart/kube-arangodb/templates/deployment-operator/role.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
{{ if .Values.operator.features.deployment -}}
33

44
apiVersion: rbac.authorization.k8s.io/v1
5+
{{ if not (eq .Values.operator.scope "cluster") }}
56
kind: Role
7+
{{ else }}
8+
kind: ClusterRole
9+
{{ end }}
610
metadata:
711
name: {{ template "kube-arangodb.rbac" . }}-deployment
12+
{{ if not (eq .Values.operator.scope "cluster") }}
813
namespace: {{ .Release.Namespace }}
14+
{{ end }}
915
labels:
1016
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
1117
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}

Diff for: chart/kube-arangodb/templates/deployment-replications-operator/role-binding.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
{{ if .Values.operator.features.deploymentReplications -}}
33

44
apiVersion: rbac.authorization.k8s.io/v1
5+
{{ if not (eq .Values.operator.scope "cluster") }}
56
kind: RoleBinding
7+
{{ else }}
8+
kind: ClusterRoleBinding
9+
{{ end }}
610
metadata:
711
name: {{ template "kube-arangodb.rbac" . }}-deployment-replication
12+
{{ if not (eq .Values.operator.scope "cluster") }}
813
namespace: {{ .Release.Namespace }}
14+
{{ end }}
915
labels:
1016
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
1117
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
@@ -14,7 +20,11 @@ metadata:
1420
release: {{ .Release.Name }}
1521
roleRef:
1622
apiGroup: rbac.authorization.k8s.io
23+
{{ if not (eq .Values.operator.scope "cluster") }}
1724
kind: Role
25+
{{ else }}
26+
kind: ClusterRole
27+
{{ end }}
1828
name: {{ template "kube-arangodb.rbac" . }}-deployment-replication
1929
subjects:
2030
- kind: ServiceAccount

Diff for: chart/kube-arangodb/templates/deployment-replications-operator/role.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
{{ if .Values.operator.features.deploymentReplications -}}
33

44
apiVersion: rbac.authorization.k8s.io/v1
5+
{{ if not (eq .Values.operator.scope "cluster") }}
56
kind: Role
7+
{{ else }}
8+
kind: ClusterRole
9+
{{ end }}
610
metadata:
711
name: {{ template "kube-arangodb.rbac" . }}-deployment-replication
12+
{{ if not (eq .Values.operator.scope "cluster") }}
813
namespace: {{ .Release.Namespace }}
14+
{{ end }}
915
labels:
1016
app.kubernetes.io/name: {{ template "kube-arangodb.name" . }}
1117
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}

Diff for: chart/kube-arangodb/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ if eq .Values.operator.scope "legacy" -}}
22
# Scope "legacy" selected
3-
{{ else if eq .Values.operator.scope "namespaced" -}}
3+
{{ else if or (eq .Values.operator.scope "namespaced") (eq .Values.operator.scope "cluster") -}}
44
# Scope "namespaced" selected
55
{{ if .Values.operator.features.storage -}}
66
{{ fail (printf "Storage Operator not supported in %s scope!" .Values.operator.scope) -}}

Diff for: chart/kube-arangodb/values.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ operator:
55
imagePullPolicy: IfNotPresent
66
imagePullSecrets: []
77

8-
scope: legacy
9-
8+
scope: cluster
9+
1010
architectures:
1111
- amd64
1212

@@ -38,7 +38,7 @@ operator:
3838
allowChaos: false
3939

4040
nodeSelector: {}
41-
41+
4242
enableCRDManagement: true
4343

4444
features:

0 commit comments

Comments
 (0)