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

Metricbeat improvements #567

Merged
merged 7 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ index.yaml
*.tgz
.idea/
/venv
.vscode/
3 changes: 1 addition & 2 deletions metricbeat/examples/security/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ metricbeatConfig:
#ssl.certificate_authorities:
#- /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
processors:
- add_kubernetes_metadata:
in_cluster: true
- add_kubernetes_metadata: ~
- module: kubernetes
enabled: true
metricsets:
Expand Down
6 changes: 0 additions & 6 deletions metricbeat/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ spec:
hostPath:
path: {{ .Values.hostPathRoot }}/{{ template "metricbeat.fullname" . }}-{{ .Release.Namespace }}-data
type: DirectoryOrCreate
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: varrundockersock
hostPath:
path: /var/run/docker.sock
Expand Down Expand Up @@ -142,9 +139,6 @@ spec:
{{- end }}
- name: data
mountPath: /usr/share/metricbeat/data
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
# Necessary when using autodiscovery; avoid mounting it otherwise
# See: https://www.elastic.co/guide/en/beats/metricbeat/master/configuration-autodiscover.html
- name: varrundockersock
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/tests/metricbeat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ def test_cluster_role_rules():
config = ""
r = helm_template(config)
rules = r["clusterrole"]["release-name-metricbeat-cluster-role"]["rules"][0]
assert rules["apiGroups"][0] == "extensions"
assert rules["apiGroups"][0] == ""
assert rules["verbs"][0] == "get"
assert rules["resources"][0] == "namespaces"
assert rules["resources"][0] == "nodes"

config = """
clusterRoleRules:
Expand Down
40 changes: 22 additions & 18 deletions metricbeat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ metricbeatConfig:
#ssl.certificate_authorities:
#- /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
processors:
- add_kubernetes_metadata:
in_cluster: true
- add_kubernetes_metadata: ~
- module: kubernetes
enabled: true
metricsets:
Expand Down Expand Up @@ -141,22 +140,27 @@ labels: {}
managedServiceAccount: true

clusterRoleRules:
- apiGroups:
- "extensions"
- "apps"
- ""
resources:
- namespaces
- pods
- events
- deployments
- nodes
- nodes/stats
- replicasets
verbs:
- get
- list
- watch
- apiGroups: [""]
resources:
- nodes
- namespaces
- events
- pods
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions"]
resources:
- replicasets
verbs: ["get", "list", "watch"]
- apiGroups: ["apps"]
resources:
- statefulsets
- deployments
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need replicasets here. There was an issue with this: elastic/beats#15741

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 470fecd

- replicasets
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- nodes/stats
verbs: ["get"]

podAnnotations: {}
# iam.amazonaws.com/role: es-cluster
Expand Down