-
Notifications
You must be signed in to change notification settings - Fork 40
filebeat config is loaded from configMap object #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
epasham
wants to merge
8
commits into
ApsOps:master
Choose a base branch
from
epasham:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e16d535
Create k8s-logging-cfg.yml
epasham 520d2ef
Create k8s-logging-filebeat.yml
epasham 9164887
Update k8s-logging-filebeat.yml
epasham a1d542f
Update k8s-logging-filebeat.yml
epasham 3d888be
Update k8s-logging-cfg.yml
epasham 8e62088
Update k8s-logging-cfg.yml
epasham 0485044
Update k8s-logging-filebeat.yml
epasham 9375037
Update README.md
epasham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: logging-cfg | ||
| namespace: default | ||
| data: | ||
| filebeat.yml: | | ||
| filebeat.registry_file: /var/log/containers/filebeat_registry | ||
|
|
||
| filebeat.prospectors: | ||
| - input_type: log | ||
| paths: | ||
| - "/var/log/containers/*.log" | ||
| symlinks: true | ||
| json.keys_under_root: true | ||
| json.add_error_key: true | ||
| json.message_key: log | ||
| multiline.pattern: '^\s' | ||
| multiline.match: after | ||
| document_type: kube-logs | ||
| fields: | ||
| host: ${FILEBEAT_HOST:${HOSTNAME}} | ||
| fields_under_root: true | ||
|
|
||
| output.logstash: | ||
| hosts: ${LOGSTASH_HOSTS:?No logstash host configured. Use env var LOGSTASH_HOSTS to set hosts.} | ||
| timeout: 15 | ||
| # Available log levels are: critical, error, warning, info, debug | ||
| logging.level: ${LOG_LEVEL:error} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| apiVersion: extensions/v1beta1 | ||
| kind: DaemonSet | ||
| metadata: | ||
| name: logging-filebeat | ||
| namespace: default | ||
| labels: | ||
| name: logging-filebeat | ||
| spec: | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: logging-filebeat | ||
| name: logging-filebeat | ||
| spec: | ||
| containers: | ||
| - name: filebeat | ||
| image: apsops/filebeat-kubernetes | ||
| env: | ||
| - name: LOGSTASH_HOSTS | ||
| value: logstash.default.svc.cluster.local:5044 | ||
| - name: LOG_LEVEL | ||
| value: info | ||
| - name: FILEBEAT_HOST | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: spec.nodeName | ||
| resources: | ||
| requests: | ||
| cpu: 50m | ||
| memory: 50Mi | ||
| limits: | ||
| cpu: 50m | ||
| memory: 100Mi | ||
| securityContext: | ||
| privileged: true | ||
| runAsUser: 0 | ||
| volumeMounts: | ||
| - name: config-volume | ||
| mountPath: /etc/filebeat | ||
| - name: varlogcontainers | ||
| mountPath: /var/log/containers | ||
| - name: varlogpods | ||
| mountPath: /var/log/pods | ||
| - name: varlibdockercontainers | ||
| mountPath: /var/lib/docker/containers | ||
| terminationGracePeriodSeconds: 30 | ||
| volumes: | ||
| # mount /var/log/containers to get friendly named symlinks to actual logs | ||
| - name: varlogcontainers | ||
| hostPath: | ||
| path: /var/log/containers | ||
| # mount /var/log/pods as its where pod logs are collected | ||
| - name: varlogpods | ||
| hostPath: | ||
| path: /var/log/pods | ||
| # mount /var/lib/docker/containers which is where the logs _actually_ are | ||
| - name: varlibdockercontainers | ||
| hostPath: | ||
| path: /var/lib/docker/containers | ||
| # mount the configmap with the filebeat config file | ||
| - name: config-volume | ||
| configMap: | ||
| name: logging-cfg | ||
| items: | ||
| - key: filebeat.yml | ||
| path: filebeat.yml | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably better to update it in the README?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kube manifest file and the readme file is updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to run this in privileged mode? And this is already in README, so you might as well remove this file.