Write libvirt logs to host

This modifies the libvirt chart to write logs directly to the
host by default. This also modifies the fluentbit and fluentd
charts to capture libvirt logs from the host and index them into
Elasticsearch

Change-Id: I0bbc49d2c0d4cf4895f797e48f309f308ffd021f
This commit is contained in:
Steve Wilkerson 2018-12-19 16:54:04 -06:00
parent 13a58c5530
commit 281b0799f0
3 changed files with 37 additions and 0 deletions

View File

@ -120,6 +120,16 @@ conf:
DB.Sync: Normal
Buffer_Chunk_Size: 1M
Buffer_Max_Size: 1M
- libvirt:
header: input
Name: tail
Tag: libvirt
Path: /var/log/libvirt/libvirtd.log
DB: /var/log/libvirt.db
Mem_Buf_Limit: 5MB
DB.Sync: Normal
Buffer_Chunk_Size: 1M
Buffer_Max_Size: 1M
- kubelet:
header: input
Name: systemd
@ -142,6 +152,11 @@ conf:
DB.Sync: Normal
Buffer_Chunk_Size: 1M
Buffer_Max_Size: 1M
- libvirt_record_modifier:
header: filter
Name: record_modifier
Match: libvirt
Record: hostname ${HOSTNAME}
- kernel_record_modifier:
header: filter
Name: record_modifier
@ -318,6 +333,22 @@ conf:
key: application
pattern: rabbitmq
tag: auth.${tag}
- libvirt_elasticsearch:
header: match
type: elasticsearch
user: "#{ENV['ELASTICSEARCH_USERNAME']}"
password: "#{ENV['ELASTICSEARCH_PASSWORD']}"
expression: "libvirt"
include_tag_key: true
host: "#{ENV['ELASTICSEARCH_HOST']}"
port: "#{ENV['ELASTICSEARCH_PORT']}"
logstash_format: true
logstash_prefix: libvirt
buffer_chunk_limit: 2M
buffer_queue_limit: 8
flush_interval: "5"
max_retry_wait: 300
disable_retry_limit: ""
- journal_elasticsearch:
header: match
type: elasticsearch

View File

@ -166,6 +166,8 @@ spec:
mountPath: /dev
- name: cgroup
mountPath: /sys/fs/cgroup
- name: logs
mountPath: /var/log/libvirt
- name: machine-id
mountPath: /etc/machine-id
readOnly: true
@ -221,6 +223,9 @@ spec:
- name: dev
hostPath:
path: /dev
- name: logs
hostPath:
path: /var/log/libvirt
- name: cgroup
hostPath:
path: /sys/fs/cgroup

View File

@ -82,6 +82,7 @@ conf:
ca_file: ""
listen_addr: 127.0.0.1
log_level: "3"
log_outputs: "1:file:/var/log/libvirt/libvirtd.log"
qemu:
stdio_handler: "file"
user: "nova"