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

Commit

Permalink
[metricbeat] add missing rolebinding and cluster role rules (#1603) (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
jmlrt committed Mar 8, 2022
1 parent 39f8423 commit 40bd1ef
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
19 changes: 19 additions & 0 deletions metricbeat/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.managedServiceAccount }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "metricbeat.serviceAccount" . }}-role-binding
labels:
app: "{{ template "metricbeat.fullname" . }}"
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
roleRef:
kind: ClusterRole
name: {{ template "metricbeat.serviceAccount" . }}-role
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ template "metricbeat.serviceAccount" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
13 changes: 10 additions & 3 deletions metricbeat/values.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ clusterRoleRules:
- namespaces
- events
- pods
- services
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions"]
resources:
Expand All @@ -235,10 +236,16 @@ clusterRoleRules:
resources:
- nodes/stats
verbs: ["get"]
- apiGroups: ["coordination.k8s.io"]
- apiGroups:
- ""
resources:
- leases
verbs: ["create", "get", "list", "update"]
- nodes/stats
verbs:
- get
- nonResourceURLs:
- "/metrics"
verbs:
- get

podAnnotations:
{}
Expand Down

0 comments on commit 40bd1ef

Please sign in to comment.