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

Commit 093d055

Browse files
authored
[metricbeat] add missing rolebinding and cluster role rules (#1603)
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 ae6c5cc commit 093d055

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
@@ -244,6 +244,7 @@ clusterRoleRules:
244244
- namespaces
245245
- events
246246
- pods
247+
- services
247248
verbs: ["get", "list", "watch"]
248249
- apiGroups: ["extensions"]
249250
resources:
@@ -259,10 +260,16 @@ clusterRoleRules:
259260
resources:
260261
- nodes/stats
261262
verbs: ["get"]
262-
- apiGroups: ["coordination.k8s.io"]
263+
- apiGroups:
264+
- ""
263265
resources:
264-
- leases
265-
verbs: ["create", "get", "list", "update"]
266+
- nodes/stats
267+
verbs:
268+
- get
269+
- nonResourceURLs:
270+
- "/metrics"
271+
verbs:
272+
- get
266273

267274
podAnnotations: {}
268275
# iam.amazonaws.com/role: es-cluster

0 commit comments

Comments
 (0)