Skip to content

Commit 145d71d

Browse files
authored
[Feature] Namespaced mode (#615)
1 parent e979b0c commit 145d71d

File tree

25 files changed

+176
-91
lines changed

25 files changed

+176
-91
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
4+
- Add Operator Namespaced mode (Alpha)
45

56
## [1.0.5](https://github.com/arangodb/kube-arangodb/tree/1.0.5) (2020-08-05)
67
- Add Labels and Annotations to ServiceMonitor

chart/kube-arangodb/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Default: `legacy`
7575

7676
Supported modes:
7777
- `legacy` - mode with limited cluster scope access
78+
- `namespaced` - mode with namespace access only
7879

7980
### `operator.service.type`
8081

chart/kube-arangodb/templates/backup-operator/cluster-role-binding.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
23
{{ if .Values.operator.features.backup -}}
34

45
apiVersion: rbac.authorization.k8s.io/v1
@@ -20,6 +21,6 @@ subjects:
2021
name: {{ template "kube-arangodb.operatorName" . }}
2122
namespace: {{ .Release.Namespace }}
2223

23-
24+
{{- end }}
2425
{{- end }}
2526
{{- end }}

chart/kube-arangodb/templates/backup-operator/cluster-role.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
23
{{ if .Values.operator.features.backup -}}
34

45
apiVersion: rbac.authorization.k8s.io/v1
@@ -15,5 +16,7 @@ rules:
1516
- apiGroups: ["apiextensions.k8s.io"]
1617
resources: ["customresourcedefinitions"]
1718
verbs: ["get", "list", "watch"]
19+
20+
{{- end }}
1821
{{- end }}
1922
{{- end }}

chart/kube-arangodb/templates/deployment-operator/cluster-role-binding.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
23
{{ if .Values.operator.features.deployment -}}
34

45
apiVersion: rbac.authorization.k8s.io/v1
@@ -20,6 +21,6 @@ subjects:
2021
name: {{ template "kube-arangodb.operatorName" . }}
2122
namespace: {{ .Release.Namespace }}
2223

23-
24+
{{- end }}
2425
{{- end }}
2526
{{- end }}

chart/kube-arangodb/templates/deployment-operator/cluster-role.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
23
{{ if .Values.operator.features.deployment -}}
34

45
apiVersion: rbac.authorization.k8s.io/v1
@@ -18,9 +19,7 @@ rules:
1819
- apiGroups: [""]
1920
resources: ["namespaces", "nodes", "persistentvolumes"]
2021
verbs: ["get", "list"]
21-
- apiGroups: ["storage.k8s.io"]
22-
resources: ["storageclasses"]
23-
verbs: ["get", "list"]
2422

23+
{{- end }}
2524
{{- end }}
2625
{{- end }}

chart/kube-arangodb/templates/deployment-replications-operator/cluster-role-binding.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
23
{{ if .Values.operator.features.deploymentReplications -}}
34

45
apiVersion: rbac.authorization.k8s.io/v1
@@ -20,6 +21,6 @@ subjects:
2021
name: {{ template "kube-arangodb.operatorName" . }}
2122
namespace: {{ .Release.Namespace }}
2223

23-
24+
{{- end }}
2425
{{- end }}
2526
{{- end }}

chart/kube-arangodb/templates/deployment-replications-operator/cluster-role.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ if .Values.rbac.enabled -}}
2+
{{ if not (eq .Values.operator.scope "namespaced") -}}
23
{{ if .Values.operator.features.deploymentReplications -}}
34

45
apiVersion: rbac.authorization.k8s.io/v1
@@ -14,10 +15,11 @@ metadata:
1415
rules:
1516
- apiGroups: ["apiextensions.k8s.io"]
1617
resources: ["customresourcedefinitions"]
17-
verbs: ["get"]
18+
verbs: ["get", "list", "watch"]
1819
- apiGroups: [""]
1920
resources: ["namespaces", "nodes"]
2021
verbs: ["get", "list"]
2122

23+
{{- end }}
2224
{{- end }}
2325
{{- end }}

chart/kube-arangodb/templates/deployment.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
{{- if eq .Values.operator.scope "legacy" -}}
1+
{{ if eq .Values.operator.scope "legacy" -}}
22
# Scope "legacy" selected
3+
{{ else if eq .Values.operator.scope "namespaced" -}}
4+
# Scope "namespaced" selected
5+
{{ if .Values.operator.features.storage -}}
6+
{{ fail (printf "Storage Operator not supported in %s scope!" .Values.operator.scope) -}}
7+
{{ end -}}
38
{{ else -}}
4-
{{ fail (printf "Operator Scope %s is not supported!" .Values.operator.scope) }}
5-
{{- end -}}
9+
{{ fail (printf "Operator Scope %s is not supported!" .Values.operator.scope) -}}
10+
{{ end -}}
611
apiVersion: apps/v1
712
kind: Deployment
813
metadata:

chart/kube-arangodb/templates/storage-operator/cluster-role-binding.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ subjects:
2020
name: {{ template "kube-arangodb.operatorName" . }}
2121
namespace: {{ .Release.Namespace }}
2222

23-
2423
{{- end }}
2524
{{- end }}

0 commit comments

Comments
 (0)