Skip to content

Commit 606eacd

Browse files
committed
Added config to make operator watch in arbitrary namespaces
Signed-off-by: David Losert <[email protected]>
1 parent d4042b2 commit 606eacd

File tree

6 files changed

+29
-3
lines changed

6 files changed

+29
-3
lines changed

charts/jaeger-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
description: jaeger-operator Helm chart for Kubernetes
33
name: jaeger-operator
4-
version: 2.14.2
4+
version: 2.15.0
55
appVersion: 1.17.1
66
home: https://www.jaegertracing.io/
77
icon: https://www.jaegertracing.io/img/jaeger-icon-reverse-color.svg

charts/jaeger-operator/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ The following table lists the configurable parameters of the jaeger-operator cha
5959
| `rbac.create` | All required roles and rolebindings will be created | `true` |
6060
| `serviceAccount.create` | Service account to use | `true` |
6161
| `rbac.pspEnabled` | Pod security policy for pod will be created and included in rbac role | `false` |
62-
| `rbac.clusterRole` | ClusterRole will be used by operator ServiceAccount | `false` |
62+
| `rbac.clusterRole` | ClusterRole will be used with ClusterRoleBinding by operator ServiceAccount to watch all namespaces | `false` |
63+
| `rbac.watchNamespaces` | ClusterRole will be used with RoleBindings in all specified namespaces by operator ServiceAccount | `[]` |
6364
| `serviceAccount.name` | Service account name to use. If not set and create is true, a name is generated using the fullname template | `nil` |
6465
| `resources` | K8s pod resources | `None` |
6566
| `nodeSelector` | Node labels for pod assignment | `{}` |

charts/jaeger-operator/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ spec:
4040
- name: WATCH_NAMESPACE
4141
{{- if .Values.rbac.clusterRole }}
4242
value: ""
43+
{{- else if .Values.rbac.watchNamespaces }}
44+
value: {{ join "," .Values.rbac.watchNamespaces | quote }}
4345
{{- else }}
4446
valueFrom:
4547
fieldRef:

charts/jaeger-operator/templates/role-binding.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- if .Values.rbac.create }}
2+
{{- if not .Values.rbac.watchNamespaces }}
23
kind: {{ if .Values.rbac.clusterRole }}Cluster{{ end }}RoleBinding
34
apiVersion: rbac.authorization.k8s.io/v1
45
metadata:
@@ -14,4 +15,24 @@ roleRef:
1415
kind: {{ if .Values.rbac.clusterRole }}Cluster{{ end }}Role
1516
name: {{ include "jaeger-operator.fullname" . }}
1617
apiGroup: rbac.authorization.k8s.io
18+
{{- else }}
19+
{{- range .Values.rbac.watchNamespaces }}
20+
kind: RoleBinding
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
metadata:
23+
name: {{ include "jaeger-operator.fullname" $ }}
24+
namespace: {{ $.Release.Namespace }}
25+
labels:
26+
{{ include "jaeger-operator.labels" $ | indent 4 }}
27+
subjects:
28+
- kind: ServiceAccount
29+
namespace: {{ . }}
30+
name: {{ include "jaeger-operator.serviceAccountName" $ }}
31+
roleRef:
32+
kind: ClusterRole
33+
name: {{ include "jaeger-operator.fullname" $ }}
34+
apiGroup: rbac.authorization.k8s.io
35+
---
36+
{{- end -}}
37+
{{- end -}}
1738
{{- end }}

charts/jaeger-operator/templates/role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if .Values.rbac.create }}
2-
kind: {{ if .Values.rbac.clusterRole }}Cluster{{ end }}Role
2+
kind: {{ if or .Values.rbac.clusterRole .Values.rbac.watchNamespaces }}Cluster{{ end }}Role
33
apiVersion: rbac.authorization.k8s.io/v1
44
metadata:
55
name: {{ include "jaeger-operator.fullname" . }}

charts/jaeger-operator/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ rbac:
2020
create: true
2121
pspEnabled: false
2222
clusterRole: false
23+
# Specifies arbitrary namespaces to be watched
24+
watchNamespaces: []
2325

2426
serviceAccount:
2527
# Specifies whether a ServiceAccount should be created

0 commit comments

Comments
 (0)