https://github.com/komljen/docker-filebeat
https://www.elastic.co/products/beats/filebeat
https://github.com/komljen/docker-filebeat
docker dockerfile elastic filebeat kubernetes
Last synced: 7 months ago
JSON representation
https://www.elastic.co/products/beats/filebeat
- Host: GitHub
- URL: https://github.com/komljen/docker-filebeat
- Owner: komljen
- License: apache-2.0
- Created: 2017-05-03T10:41:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T14:31:52.000Z (over 7 years ago)
- Last Synced: 2025-04-05T19:34:23.970Z (10 months ago)
- Topics: docker, dockerfile, elastic, filebeat, kubernetes
- Language: Dockerfile
- Homepage:
- Size: 18.6 KB
- Stars: 9
- Watchers: 2
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Filebeat 6.x kubernetes ready docker image
## Modifying filebeat.yml
In order to overwrite the values for ```filebeat.yml``` which is a part of the ```maskeda/filebeat``` docker image with the Kuberntes ConfigMap (filebeat-config.yml), create the resource first:
```
kubectl apply -f filebeat-config.yml --namespace=default
```
Then create filebeat `DaemonSet` which will mount above config:
```
kubectl apply -f filebeat-ds.yml --namespace=default
```
## Sample filebeat-ds.yml
Please replace ```HOSTNAME:PORT``` with the desired hostname/port number and ```INDEX_VALUE``` with the preferred index prefix. The format of the INDEX_VALUE string can also be modified, please check the filebeat documentation for more info. Please let the project know if any addtional options need to be added to the filebeat-ds.yml.
```
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: filebeat
labels:
app: filebeat
spec:
template:
metadata:
labels:
app: filebeat
name: filebeat
spec:
containers:
- name: filebeat
image: komljen/filebeat
resources:
limits:
cpu: 50m
memory: 50Mi
env:
- name: LOGSTASH_HOSTS
value: HOSTNAME:PORT
- name: LOG_LEVEL
value: debug
- name: INDEX_PREFIX
value: "INDEX_VALUE-%{[@metadata]}-%{+YYYY.MM.dd}"
volumeMounts:
- name: config
mountPath: /etc/filebeat
- name: varlog
mountPath: /var/log/containers
- name: varlogpods
mountPath: /var/log/pods
readOnly: true
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: config
configMap:
name: filebeat-config
items:
- key: filebeat.yml
path: filebeat.yml
- name: varlog
hostPath:
path: /var/log/containers
- name: varlogpods
hostPath:
path: /var/log/pods
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
```