When do I use unique: true?

Using kubernetes module for my metricbeat config, deployed as DaemonSet.

metricbeat.config.modules:
    # Mounted `metricbeat-daemonset-modules` configmap:
    path: ${path.config}/modules.yml
    # Reload module configs as they change:
    reload.enabled: false
metricbeat.autodiscover:
  providers:
    - type: kubernetes
      scope: cluster
      node: ${NODE_IP}
      unique: true
      templates:
        - config:
            - module: kubernetes
              metricsets:
                - container
                - node
                - pod
                - system
                - volume
              period: 60s
              enabled: true
              hosts: ["https://${NODE_IP}:10250"]
              bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
              ssl.certificate_authorities:
                - /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
              add_metadata: true
processors:
  - add_cloud_metadata:
output.logstash:
  hosts: ["monitoring-logstash:5044"]

If unique: true is set, my metrics work as intended, when it's false, metrics act weird.

Now, this is unexpected, because the host is NODE_IP on all metricbeat instances, which is different for every instance for obvious reasons. Why does setting unique to true matter? Does this mean that I don't need to deploy metricbeat as a DaemonSet, but a simple Deployment is enough?

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