Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit 40bd1ef

Browse files
authored
[metricbeat] add missing rolebinding and cluster role rules (#1603) (#1607)
This commits add a rolebinding and cluster role rules to match https://github.com/elastic/beats/blob/main/deploy/kubernetes/metricbeat-kubernetes.yaml Follow-up of #1422
1 parent 39f8423 commit 40bd1ef

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.managedServiceAccount }}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: RoleBinding
4+
metadata:
5+
name: {{ template "metricbeat.serviceAccount" . }}-role-binding
6+
labels:
7+
app: "{{ template "metricbeat.fullname" . }}"
8+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9+
heritage: {{ .Release.Service | quote }}
10+
release: {{ .Release.Name | quote }}
11+
roleRef:
12+
kind: ClusterRole
13+
name: {{ template "metricbeat.serviceAccount" . }}-role
14+
apiGroup: rbac.authorization.k8s.io
15+
subjects:
16+
- kind: ServiceAccount
17+
name: {{ template "metricbeat.serviceAccount" . }}
18+
namespace: {{ .Release.Namespace }}
19+
{{- end -}}

metricbeat/values.yaml

100755100644
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ clusterRoleRules:
220220
- namespaces
221221
- events
222222
- pods
223+
- services
223224
verbs: ["get", "list", "watch"]
224225
- apiGroups: ["extensions"]
225226
resources:
@@ -235,10 +236,16 @@ clusterRoleRules:
235236
resources:
236237
- nodes/stats
237238
verbs: ["get"]
238-
- apiGroups: ["coordination.k8s.io"]
239+
- apiGroups:
240+
- ""
239241
resources:
240-
- leases
241-
verbs: ["create", "get", "list", "update"]
242+
- nodes/stats
243+
verbs:
244+
- get
245+
- nonResourceURLs:
246+
- "/metrics"
247+
verbs:
248+
- get
242249

243250
podAnnotations:
244251
{}

0 commit comments

Comments
 (0)