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

Commit

Permalink
Merge pull request #567 from jmlrt/metricbeat-improvements
Browse files Browse the repository at this point in the history
Metricbeat improvements
  • Loading branch information
jmlrt authored Apr 10, 2020
2 parents fe92c10 + 3e8bc8f commit 9f03b20
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 44 deletions.
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/
4 changes: 0 additions & 4 deletions metricbeat/examples/6.x/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ mount:
exists: true
/run/docker.sock:
exists: true
/var/lib/docker/containers:
exists: true
opts:
- ro
/usr/share/metricbeat/metricbeat.yml:
exists: true
opts:
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/examples/default/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ mount:
exists: true
/run/docker.sock:
exists: true
/var/lib/docker/containers:
exists: true
opts:
- ro
/usr/share/metricbeat/metricbeat.yml:
exists: true
opts:
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/examples/oss/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ mount:
exists: true
/run/docker.sock:
exists: true
/var/lib/docker/containers:
exists: true
opts:
- ro
/usr/share/metricbeat/metricbeat.yml:
exists: true
opts:
Expand Down
4 changes: 0 additions & 4 deletions metricbeat/examples/security/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ mount:
exists: true
/run/docker.sock:
exists: true
/var/lib/docker/containers:
exists: true
opts:
- ro
/usr/share/metricbeat/metricbeat.yml:
exists: true
opts:
Expand Down
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
- replicasets
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources:
- nodes/stats
verbs: ["get"]

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

0 comments on commit 9f03b20

Please sign in to comment.