-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is mostly to get rid of the vulnerabilities that the Debian-based image carries with it.
- Loading branch information
1 parent
9a54d29
commit c9379e5
Showing
9 changed files
with
218 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -90,11 +90,20 @@ jobs: | |
- name: Test fluent-plugin-protobuf | ||
run: make test-fluent-plugin-protobuf | ||
|
||
image-test: | ||
image-test-debian: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Build kubernetes-fluentd | ||
- name: Build Debian image | ||
run: make build | ||
- name: Test kubernetes-fluentd image | ||
- name: Test Debian image | ||
run: make image-test | ||
|
||
image-test-alpine: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Build Alpine image | ||
run: make build-alpine | ||
- name: Test Alpine image | ||
run: make image-test-alpine |
This file contains 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 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 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 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,122 @@ | ||
FROM ruby:2.6.8-alpine3.14 AS builder | ||
|
||
RUN apk update \ | ||
&& apk add \ | ||
build-base \ | ||
git \ | ||
gnupg \ | ||
linux-headers \ | ||
ruby-dev \ | ||
snappy-dev | ||
|
||
RUN echo 'gem: --no-document' >> /etc/gemrc | ||
|
||
# Fluentd plugin dependencies | ||
RUN gem install \ | ||
fluentd:1.12.2 \ | ||
concurrent-ruby:1.1.8 \ | ||
google-protobuf:3.17.3 \ | ||
lru_redux:1.1.0 \ | ||
net-http-persistent:4.0.1 \ | ||
snappy:0.0.17 \ | ||
specific_install:0.3.5 | ||
|
||
# Use unreleased Kubeclient version with persistent HTTP connections. | ||
RUN gem specific_install https://github.com/abonas/kubeclient --ref 3267dc3fd02c49e3b19f1210ff7cb84c3b2a4478 | ||
|
||
# FluentD plugins to allow customers to forward data if needed to various cloud providers | ||
RUN gem install \ | ||
fluent-plugin-s3 | ||
# TODO: Support additional cloud providers | ||
# && gem install fluent-plugin-google-cloud \ | ||
# && gem install fluent-plugin-azure-storage-append-blob | ||
|
||
# FluentD plugins from RubyGems | ||
RUN gem install \ | ||
fluent-plugin-concat:2.4.0 \ | ||
fluent-plugin-prometheus:1.6.1 \ | ||
fluent-plugin-record-modifier:2.0.1 \ | ||
fluent-plugin-rewrite-tag-filter:2.2.0 \ | ||
fluent-plugin-sumologic_output:1.7.1 \ | ||
fluent-plugin-systemd:1.0.2 | ||
|
||
WORKDIR /sumologic-kubernetes-fluentd | ||
|
||
COPY fluent-plugin-datapoint/ ./fluent-plugin-datapoint | ||
RUN cd fluent-plugin-datapoint \ | ||
&& gem build fluent-plugin-datapoint.gemspec -o ../fluent-plugin-datapoint.gem \ | ||
&& cd .. | ||
|
||
COPY fluent-plugin-enhance-k8s-metadata/ ./fluent-plugin-enhance-k8s-metadata | ||
RUN cd fluent-plugin-enhance-k8s-metadata \ | ||
&& gem build fluent-plugin-enhance-k8s-metadata.gemspec -o ../fluent-plugin-enhance-k8s-metadata.gem \ | ||
&& cd .. | ||
|
||
COPY fluent-plugin-events/ ./fluent-plugin-events | ||
RUN cd fluent-plugin-events \ | ||
&& gem build fluent-plugin-events.gemspec -o ../fluent-plugin-events.gem \ | ||
&& cd .. | ||
|
||
COPY fluent-plugin-kubernetes-metadata-filter ./fluent-plugin-kubernetes-metadata-filter | ||
RUN cd fluent-plugin-kubernetes-metadata-filter \ | ||
&& gem build fluent-plugin-kubernetes-metadata-filter.gemspec -o ../fluent-plugin-kubernetes-metadata-filter.gem \ | ||
&& cd .. | ||
|
||
COPY fluent-plugin-kubernetes-sumologic/ ./fluent-plugin-kubernetes-sumologic | ||
RUN cd fluent-plugin-kubernetes-sumologic \ | ||
&& gem build fluent-plugin-kubernetes-sumologic.gemspec -o ../fluent-plugin-kubernetes-sumologic.gem \ | ||
&& cd .. | ||
|
||
COPY fluent-plugin-prometheus-format ./fluent-plugin-prometheus-format | ||
RUN cd fluent-plugin-prometheus-format \ | ||
&& gem build fluent-plugin-prometheus-format.gemspec -o ../fluent-plugin-prometheus-format.gem \ | ||
&& cd .. | ||
|
||
COPY fluent-plugin-protobuf/ ./fluent-plugin-protobuf | ||
RUN cd fluent-plugin-protobuf \ | ||
&& gem build fluent-plugin-protobuf.gemspec -o ../fluent-plugin-protobuf.gem \ | ||
&& cd .. | ||
|
||
RUN gem install \ | ||
--local fluent-plugin-datapoint \ | ||
--local fluent-plugin-enhance-k8s-metadata \ | ||
--local fluent-plugin-events \ | ||
--local fluent-plugin-kubernetes-metadata-filter \ | ||
--local fluent-plugin-kubernetes-sumologic \ | ||
--local fluent-plugin-prometheus-format \ | ||
--local fluent-plugin-protobuf | ||
|
||
FROM ruby:2.6.8-alpine3.14 | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
ca-certificates \ | ||
snappy-dev \ | ||
tini | ||
|
||
RUN delgroup ping \ | ||
&& addgroup -S -g 999 fluent \ | ||
&& adduser -S -g fluent -u 999 fluent \ | ||
# for log storage (maybe shared with host) | ||
&& mkdir -p /fluentd/log \ | ||
# configuration/plugins path (default: copied from .) | ||
&& mkdir -p /fluentd/etc /fluentd/plugins \ | ||
&& chown -R fluent /fluentd && chgrp -R fluent /fluentd | ||
|
||
COPY fluent.conf /fluentd/etc/ | ||
COPY entrypoint.sh /bin/ | ||
|
||
ENV FLUENTD_CONF="fluent.conf" | ||
|
||
ENV LD_PRELOAD="" | ||
EXPOSE 24224 5140 | ||
|
||
COPY --from=builder --chown=fluent:fluent /usr/local/bundle /usr/local/bundle | ||
|
||
USER 999:999 | ||
|
||
ARG BUILD_TAG=latest | ||
ENV TAG $BUILD_TAG | ||
|
||
ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"] | ||
CMD ["fluentd"] |
This file contains 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 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 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,33 @@ | ||
<source> | ||
@type forward | ||
@id input1 | ||
@label @mainstream | ||
port 24224 | ||
</source> | ||
|
||
<filter **> | ||
@type stdout | ||
</filter> | ||
|
||
<label @mainstream> | ||
<match docker.**> | ||
@type file | ||
@id output_docker1 | ||
path /fluentd/log/docker.*.log | ||
symlink_path /fluentd/log/docker.log | ||
append true | ||
time_slice_format %Y%m%d | ||
time_slice_wait 1m | ||
time_format %Y%m%dT%H%M%S%z | ||
</match> | ||
<match **> | ||
@type file | ||
@id output1 | ||
path /fluentd/log/data.*.log | ||
symlink_path /fluentd/log/data.log | ||
append true | ||
time_slice_format %Y%m%d | ||
time_slice_wait 10m | ||
time_format %Y%m%dT%H%M%S%z | ||
</match> | ||
</label> |