# Metricbeat examples on ECK not working properly

**URL:** https://discuss.elastic.co/t/metricbeat-examples-on-eck-not-working-properly/285386
**Category:** Beats
**Tags:** docker, metricbeat
**Created:** [September 28, 2021, 3:42pm UTC](https://discuss.elastic.co/t/metricbeat-examples-on-eck-not-working-properly/285386 "2021-09-28T15:42:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![CHAVE](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chave/32/87058_2.png) [@CHAVE](https://discuss.elastic.co/u/CHAVE)
#### Post date: [September 28, 2021, 3:42pm UTC](https://discuss.elastic.co/t/metricbeat-examples-on-eck-not-working-properly/285386/1 "2021-09-28T15:42:07Z")

</div>

I'm trying to setup ECK on Google Kubernetes Engine following the quickstart guides on ECK. I'm using the default configuration for Kibana and Metricbeat, and the index `metricbeat-*` exists on my Elasticsearch cluster. However, I cannot access useful info on any of the Kibana dashboards.

My Kibana config:

```auto
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: quickstart
spec:
  version: 7.14.1
  count: 1
  elasticsearchRef:
    name: quickstart
    namespace: default
  config:
    status.allowAnonymous: true
    server.publicBaseUrl: "http://10.51.10.52:5601"
    xpack.security.authc.providers:
      basic.basic1:
        order: 0
      anonymous.anonymous1:
        order: 1
        credentials: "elasticsearch_anonymous_user" # kinda unsafe
  http:
    tls:
      selfSignedCertificate:
        disabled: true # kinda unsafe as well

```

Metricbeat config: (it's straight up copied from the examples)

```auto
apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
  name: metricbeat
spec:
  type: metricbeat
  version: 7.14.0
  elasticsearchRef:
    name: quickstart
  kibanaRef:
    name: quickstart
  config:
    metricbeat:
      autodiscover:
        providers:
        - hints:
            default_config: {}
            enabled: "true"
          host: ${NODE_NAME}
          type: kubernetes
      modules:
      - module: system
        period: 10s
        metricsets:
        - cpu
        - load
        - memory
        - network
        - process
        - process_summary
        process:
          include_top_n:
            by_cpu: 5
            by_memory: 5
        processes:
        - .*
      - module: system
        period: 1m
        metricsets:
        - filesystem
        - fsstat
        processors:
        - drop_event:
            when:
              regexp:
                system:
                  filesystem:
                    mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib)($|/)
      - module: kubernetes
        period: 10s
        host: ${NODE_NAME}
        hosts:
        - https://${NODE_NAME}:10250
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
        ssl:
          verification_mode: none
        metricsets:
        - node
        - system
        - pod
        - container
        - volume
    processors:
    - add_cloud_metadata: {}
    - add_host_metadata: {}
  daemonSet:
    podTemplate:
      spec:
        affinity:
            nodeAffinity:
              requiredDuringSchedulingIgnoredDuringExecution:
                nodeSelectorTerms:
                - matchExpressions:
                  - key: machine-type
                    operator: In
                    values:
                    - low-resource 
        serviceAccountName: metricbeat
        automountServiceAccountToken: true # some older Beat versions are depending on this settings presence in k8s context
        containers:
        - args:
          - -e
          - -c
          - /etc/beat.yml
          - -system.hostfs=/hostfs
          name: metricbeat
          volumeMounts:
          - mountPath: /hostfs/sys/fs/cgroup
            name: cgroup
          - mountPath: /var/run/docker.sock
            name: dockersock
          - mountPath: /hostfs/proc
            name: proc
          env:
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
        dnsPolicy: ClusterFirstWithHostNet
        hostNetwork: true # Allows to provide richer host metadata
        securityContext:
          runAsUser: 0
        terminationGracePeriodSeconds: 30
        volumes:
        - hostPath:
            path: /sys/fs/cgroup
          name: cgroup
        - hostPath:
            path: /var/run/docker.sock
          name: dockersock
        - hostPath:
            path: /proc
          name: proc
---
# permissions needed for metricbeat
# source: https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: metricbeat
rules:
- 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
- nonResourceURLs:
  - /metrics
  verbs:
  - get
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: metricbeat
  namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: metricbeat
subjects:
- kind: ServiceAccount
  name: metricbeat
  namespace: default
roleRef:
  kind: ClusterRole
  name: metricbeat
  apiGroup: rbac.authorization.k8s.io

```

The best I can get out of Kibana:

 ![Screenshot from 2021-09-28 12-35-01](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b6a8a62b416c0c87026a1bf82794a93e251828e.png)

What am I doing wrong? I want to know If my nodes are overloaded or not. I want to view CPU usage, RAM, disk and internet traffic on my nodes and GKE cluster. If you know a better way to accomplish this, please do share it with me.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 26, 2021, 5:42pm UTC](https://discuss.elastic.co/t/metricbeat-examples-on-eck-not-working-properly/285386/2 "2021-10-26T17:42:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
