Skip to content

Commit 4381637

Browse files
authored
Merge pull request #17 from Cryptophobia/master
Updates to fluentd from drycc/fluentd
2 parents 0557fcc + 8fbaf60 commit 4381637

17 files changed

Lines changed: 117 additions & 90 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
sudo: required
22
language: go
33
services:
4-
- docker
5-
script: make test
4+
- docker
5+
script: make docker-build test
66
notifications:
77
slack:
88
secure: pWDCV3od8gxvzxh9DrOTvBL54XoCfWYhZZlwd2ZbyyOz6SS12Psg/ZuCT2253p4yMfF/LPlsz76mr7NgcCrMI0ReveTa/rnt3XBZtyY+1rlsQsy2oxgdAzbO587ENCQeMw2F/OWHaixMT8NDqxEqQd6xafK9Zmg6BeBjwgs7XfXKcR3WzNIuCO0ZG05+Yd0FIxmd/8Xm5tGiFEYr05+Ix6MLdF9MSCXZUPeu1EsYXhDljokLq49w63W1UMU10tm4t7VCEdaO+X9w6EJ5Ov8HDxb6L6IviUYY6+IGTZ01nwIoM6OrGQqfEAytYqgTKdehgQzQnAbLI6TW2wJ0twqEsLrlbTa4NW4j0KkazQJkN5kqcKYQvaeKJJhvJIG44Gi/u78pW3S6W7NU5DhrlE6bbxdIBHJW1vJBimkqu2oBNrO5ZoBB9MS9zflBsU5g/pQpVeHWMnWE8fcYDGa1PqAcr7q6wtdPsrVZhnHmmARN3PwZzIVVVsXbaIQG8VLC5grLGnwMf1Y1fz2nK3sVpCftvrYZT3G6CNAASo+eLOwYdZdiJ9jIS7WNLN1GtpIEvjeDt3QRqsDyH8YoAKUvY5h/v8IWPP/BaSwQbJwep4+Dj7xkpXX5/4wm4jEnVFV1p4xE0lD1AXvEMAVHtPhhggvscNhF9j6oeoPju6eTPcxG+5o=

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) Microsoft Corporation. All rights reserved.
3+
Copyright (c) Team Hephy. All rights reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SHORT_NAME ?= fluentd
22
BUILD_TAG ?= git-$(shell git rev-parse --short HEAD)
3-
DEIS_REGISTRY ?= ${DEV_REGISTRY}
4-
IMAGE_PREFIX ?= deis
3+
HEPHY_REGISTRY ?= ${DEV_REGISTRY}
4+
IMAGE_PREFIX ?= hephy
55

66
include versioning.mk
77

@@ -22,4 +22,4 @@ upgrade:
2222
helm upgrade fluentd charts/fluentd --namespace deis --set org=${IMAGE_PREFIX},docker_tag=${VERSION}
2323

2424
uninstall:
25-
helm delete fluentd --purge
25+
helm delete fluentd --purge

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11

22
## Description
3-
[![Build Status](https://ci.deis.io/job/fluentd/badge/icon)](https://ci.deis.io/job/fluentd)
3+
[![Build Status](https://api.travis-ci.org/teamhephy/fluentd.svg?branch=master)](https://travis-ci.org/github/teamhephy/fluentd)
44

55
Deis (pronounced DAY-iss) is an open source PaaS that makes it easy to deploy and manage
66
applications on your own servers. Deis builds on [Kubernetes](http://kubernetes.io/) to provide
77
a lightweight, [Heroku-inspired](http://heroku.com) workflow.
88

9-
![Deis Graphic](https://getdeis.blob.core.windows.net/get-deis/deis-graphic-small.png)
10-
119
## About
1210
This is an centos7 based image for running [fluentd](http://fluentd.org). It is built for the purpose of running on a kubernetes cluster.
1311

1412
This work is based on the [docker-fluentd](https://github.com/fabric8io/docker-fluentd) and [docker-fluentd-kubernetes](https://github.com/fabric8io/docker-fluentd-kubernetes) images by the fabric8 team. This image is in with [deis](https://github.com/teamhephy/deis) v2 to send all log data to the [logger](https://github.com/teamhephy/logger) component.
1513

1614
## Configuration
1715

16+
### Support containerd log format
17+
By default, fluent parses logs in docker json format. If you use containerd, you only need to set the following environment variables
18+
19+
* `CONTAINER_TAIL_PARSER_TYPE="/^(?<time>.+) (?<stream>stdout|stderr)( (?<tags>.))? (?<log>.*)$/"`
20+
21+
1822
### Enable more verbose logging
1923
By default we do not capture kubernetes system logs. However, it is possible to tell fluentd to capture those logs just by specifying a few new environment variables.
2024

charts/fluentd/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: fluentd
22
home: https://github.com/teamhephy/fluentd
33
version: <Will be populated by the ci before publishing the chart>
4-
description: Log shipping mechanism for Deis Workflow.
4+
description: Log shipping mechanism for Hephy Workflow.
55
maintainers:
6-
- name: Deis Team
7-
email: engineering@deis.com
6+
- name: Team Hephy
7+
email: team@teamhephy.com

charts/fluentd/templates/logger-fluentd-daemon.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ $nsqdNodeCount := .Values.nsqd.replicas | int }}
12
apiVersion: {{ template "APIVersion" . }}
23
kind: DaemonSet
34
metadata:
@@ -84,6 +85,8 @@ spec:
8485
- name: {{ $key }}
8586
value: {{ $value | quote }}
8687
{{- end }}
88+
- name: DEIS_NSQD_ADDRS
89+
value: "{{range $i := until $nsqdNodeCount}}deis-nsqd-{{$i}}.deis-nsqd.{{ $.Release.Namespace }}.svc.cluster.local:{{$.Values.nsqd.tcp_port}}{{if lt (add 1 $i) $nsqdNodeCount}},{{end}}{{end}}"
8790
volumeMounts:
8891
- name: varlog
8992
mountPath: /var/log

charts/fluentd/values.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ boot:
2727
# Any custom fluentd environment variables (https://github.com/teamhephy/fluentd#configuration)
2828
# can be specified as key-value pairs under daemon_environment.
2929
daemon_environment:
30-
#<example-env>: <example-value>
30+
CONTAINER_TAIL_PARSER_TYPE: json
31+
32+
nsqd:
33+
replicas: 1
34+
tcp_port: 4150
35+
http_port: 4151
3136

3237
# Role-Based Access Control for Kubernetes >= 1.5
3338
global:
34-
use_rbac: false
39+
use_rbac: true

manifests/deis-logger-fluentd-daemon.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: DaemonSet
33
metadata:
44
name: deis-logger-fluentd
@@ -20,7 +20,7 @@ spec:
2020
serviceAccount: deis-logger-fluentd
2121
containers:
2222
- name: deis-logger-fluentd
23-
image: quay.io/deisci/fluentd:canary
23+
image: hephy/fluentd:canary
2424
imagePullPolicy: Always
2525
volumeMounts:
2626
- name: varlog

rootfs/Dockerfile

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
1-
FROM fluent/fluentd:v1.3
1+
FROM fluent/fluentd:v1.9-1
2+
3+
USER root
24

35
COPY fluentd /fluentd
46
COPY entrypoint.sh /bin/
57
RUN chmod +x /bin/entrypoint.sh
8+
ENV FLUENTD_CONF="/fluentd/etc/fluent.conf"
69

7-
RUN apk add bash findutils
8-
RUN apk add --update --virtual .build-deps sudo build-base ruby-dev \
9-
&& gem install bundler \
10-
&& bundle config --global silence_root_warning 1 \
11-
&& bundle install --gemfile=/fluentd/deis-output/Gemfile \
12-
&& rake --rakefile=/fluentd/deis-output/Rakefile build \
13-
&& fluent-gem install --no-document fluent-plugin-kubernetes_metadata_filter -v 2.1.4 \
14-
&& fluent-gem install --no-document fluent-plugin-elasticsearch -v 4.0.4 \
15-
&& fluent-gem install --no-document fluent-plugin-remote_syslog -v 1.0.0 \
16-
&& fluent-gem install --no-document fluent-plugin-sumologic-mattk42 -v 0.0.4 \
17-
&& fluent-gem install --no-document fluent-plugin-gelf-hs -v 1.0.7 \
18-
&& fluent-gem install --no-document influxdb -v 0.6.1 \
19-
&& fluent-gem install --no-document nsq-ruby -v 2.3.1 \
20-
&& fluent-gem install --local /fluentd/deis-output/pkg/fluent-plugin-deis_output-0.1.0.gem \
21-
&& sudo gem sources --clear-all \
22-
&& apk del .build-deps \
23-
&& rm -rf /var/cache/apk/* /root/.gem/ruby/*/cache/*.gem
10+
RUN apk add bash findutils \
11+
&& apk add --update --virtual .build-deps sudo build-base ruby-dev \
12+
&& gem install bundler:2.1.4 \
13+
&& bundle config --global silence_root_warning 1 \
14+
&& bundle install --gemfile=/fluentd/deis-output/Gemfile \
15+
&& rake --rakefile=/fluentd/deis-output/Rakefile build \
16+
&& fluent-gem install --no-document fluent-plugin-kubernetes_metadata_filter -v 2.5.2 \
17+
&& fluent-gem install --no-document fluent-plugin-elasticsearch -v 4.1.1 \
18+
&& fluent-gem install --no-document fluent-plugin-remote_syslog -v 1.0.0 \
19+
&& fluent-gem install --no-document fluent-plugin-sumologic-mattk42 -v 0.0.4 \
20+
&& fluent-gem install --no-document fluent-plugin-gelf-hs -v 1.0.8 \
21+
&& fluent-gem install --no-document influxdb -v 0.8.0 \
22+
&& fluent-gem install --no-document nsq-ruby -v 2.3.1 \
23+
&& fluent-gem install --local /fluentd/deis-output/pkg/fluent-plugin-deis_output-0.1.0.gem \
24+
&& sudo gem sources --clear-all \
25+
&& apk del .build-deps \
26+
&& rm -rf /var/cache/apk/* /root/.gem/ruby/*/cache/*.gem
2427

2528
ENTRYPOINT ["/bin/entrypoint.sh"]
2629

rootfs/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
exec "$@"

0 commit comments

Comments
 (0)