Hello.
I'm using Elasticsearch filebeat 7.17.
According to the document, filebeat can use namespace's annotation when pod's annotation does not exist.
But it seems to be working against my expectations.
The following cases operate normally.
...
apiVersion: v1
kind: Pod
metadata:
annotations:
log-topic: service
...
However, it does not work when you delete the comment from pod and put the same annotation in namespace.
This is my filebeat setting file.
filebeat.autodiscover:
providers:
- type: kubernetes
hint.enabled: true
add_resource_metadata:
namespace:
include_annotations: ["log-topic"]
templates:
- condition.contains:
kubernetes.annotations.log-topic: service
config:
- type: docker
containers.ids:
- ${data.kubernetes.container.id}
fields:
log_topic: k8s.logging.filebeat.service
output.kafka:
hosts: ["kafka_fqdn:port"]
topic: '%{[fields.log_topic]}'
partition.round_robin:
reachable_only: false
required_acks: 1
compression: gzip
max_message_bytes: 1000000
worker: 6