Configuring metricbeat to collect Kubernetes metrics

Hi Everyone I am configuring metric beat to collect Kubernetes logs ,
I am using below config
apiVersion: v1
kind: ConfigMap
metadata:
name: metricbeat-config
namespace: kube-system
labels:
app: metricbeat
data:
metricbeat.yml: |-
metricbeat.config.modules:

Mounted metricbeat-daemonset-modules configmap:

path: ${path.config}/modules.d/*.yml

Reload module configs as they change:

reload.enabled: false
processors:

  • add_cloud_metadata:
    output.elasticsearch:
    hosts: ["http://34.69.16.96:8080/"]
    setup.dashboards.enabled: true
    setup.kibana.host: ["http://35.225.226.65:8080/"]
    #setup.kibana.protocol: "https"
    setup.template.settings:
    index.number_of_shards: 5
    index.number_of_replicas: 1
    index.number_of_routing_shards: 30

And I am getting bellow error
eror: error validating "metricbeat-config.yaml": error validating data: [ValidationError(ConfigMap.data.hosts): invalid type for io.k8s.api.core.v1.ConfigMap.d
ata: got "array", expected "string", unknown object type "nil" in ConfigMap.data.metricbeat.config.modules, unknown object type "nil" in ConfigMap.data.output.e
lasticsearch, ValidationError(ConfigMap.data.processors): invalid type for io.k8s.api.core.v1.ConfigMap.data: got "array", expected "string", ValidationError(Co
nfigMap.data.setup.kibana.host): invalid type for io.k8s.api.core.v1.ConfigMap.data: got "array", expected "string", unknown object type "nil" in ConfigMap.data
.setup.template.settings]; if you choose to ignore these errors, turn validation off with --validate=false

Please help me out I am new to k8s

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