Skip to content
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

Add support for azure blob storage #411

Merged
merged 1 commit into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

IMAGE_NAME := fluent/fluentd-kubernetes
ALL_IMAGES := \
v1.11/debian-azureblob:v1.11.1-debian-azureblob-1.0,v1.11-debian-azureblob-1 \
v1.11/debian-elasticsearch7:v1.11.1-debian-elasticsearch7-1.3,v1.11-debian-elasticsearch7-1,v1-debian-elasticsearch \
v1.11/debian-elasticsearch6:v1.11.1-debian-elasticsearch6-1.0,v1.11-debian-elasticsearch6-1 \
v1.11/debian-loggly:v1.11.1-debian-loggly-1.0,v1.11-debian-loggly-1 \
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See also dockerhub tags page: https://hub.docker.com/r/fluent/fluentd-kubernetes

#### Current stable

- `v1.11.1-debian-azureblob-1.0,v1.11-debian-azureblob-1` [docker-image/v1.11/debian-azureblob/Dockerfile](docker-image/v1.11/debian-azureblob/Dockerfile)
- `v1.11.1-debian-elasticsearch7-1.3,v1.11-debian-elasticsearch7-1,v1-debian-elasticsearch` [docker-image/v1.11/debian-elasticsearch7/Dockerfile](docker-image/v1.11/debian-elasticsearch7/Dockerfile)
- `v1.11.1-debian-elasticsearch6-1.0,v1.11-debian-elasticsearch6-1` [docker-image/v1.11/debian-elasticsearch6/Dockerfile](docker-image/v1.11/debian-elasticsearch6/Dockerfile)
- `v1.11.1-debian-loggly-1.0,v1.11-debian-loggly-1` [docker-image/v1.11/debian-loggly/Dockerfile](docker-image/v1.11/debian-loggly/Dockerfile)
Expand Down Expand Up @@ -168,7 +169,7 @@ oc patch ds fluentd -p "spec:
- name: fluentd
securityContext:
privileged: true"
oc delete pod -l k8s-app=fluentd-logging
oc delete pod -l k8s-app = fluentd-logging
Copy link
Contributor

@cosmo0920 cosmo0920 Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces around equal cause oc delete pod command failure.
Could you delete them?

```

This is from [nekop's japanese article](https://nekop.hatenablog.com/entry/2018/04/20/170257).
Expand Down
1 change: 1 addition & 0 deletions docker-image/v1.11/debian-azureblob/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.gitkeep
50 changes: 50 additions & 0 deletions docker-image/v1.11/debian-azureblob/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /templates/Dockerfile.erb

FROM fluent/fluentd:v1.11.1-debian-1.0

LABEL maintainer="Eduardo Silva <eduardo@treasure-data.com>"
USER root
WORKDIR /home/fluent
ENV PATH /fluentd/vendor/bundle/ruby/2.6.0/bin:$PATH
ENV GEM_PATH /fluentd/vendor/bundle/ruby/2.6.0
ENV GEM_HOME /fluentd/vendor/bundle/ruby/2.6.0
# skip runtime bundler installation
ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1

COPY Gemfile* /fluentd/
RUN buildDeps="sudo make gcc g++ libc-dev libffi-dev" \
runtimeDeps="pkg-config libxslt-dev libxml2-dev" \
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get install \
-y --no-install-recommends \
$buildDeps $runtimeDeps net-tools \
&& gem install bundler --version 2.1.4 \
&& bundle config silence_root_warning true && bundle config build.nokogiri --use-system-libraries \
&& bundle install --gemfile=/fluentd/Gemfile --path=/fluentd/vendor/bundle \
&& SUDO_FORCE_REMOVE=yes \
apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
$buildDeps \
&& rm -rf /var/lib/apt/lists/* \
&& gem sources --clear-all \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem

# Copy configuration files
COPY ./conf/fluent.conf /fluentd/etc/
COPY ./conf/systemd.conf /fluentd/etc/
COPY ./conf/kubernetes.conf /fluentd/etc/
COPY ./conf/prometheus.conf /fluentd/etc/
RUN touch /fluentd/etc/disable.conf

# Copy plugins
COPY plugins /fluentd/plugins/
COPY entrypoint.sh /fluentd/entrypoint.sh

# Environment variables
ENV FLUENTD_OPT=""
ENV FLUENTD_CONF="fluent.conf"

# Overwrite ENTRYPOINT to run fluentd as root for /var/log / /var/lib
ENTRYPOINT ["tini", "--", "/fluentd/entrypoint.sh"]
20 changes: 20 additions & 0 deletions docker-image/v1.11/debian-azureblob/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /templates/Gemfile.erb

source "https://rubygems.org"

gem "fluentd", "1.11.1"
gem "oj", "3.8.1"
gem "fluent-plugin-multi-format-parser", "~> 1.0.0"
gem "fluent-plugin-concat", "~> 2.4.0"
gem "fluent-plugin-grok-parser", "~> 2.6.0"
gem "fluent-plugin-prometheus", "~> 1.6.1"
gem 'fluent-plugin-json-in-json-2', ">= 1.0.2"
gem "fluent-plugin-record-modifier", "~> 2.0.0"
gem "fluent-plugin-detect-exceptions", "~> 0.0.12"
gem "fluent-plugin-rewrite-tag-filter", "~> 2.2.0"
gem "azure-storage-blob", "~> 1.0"
gem "fluent-plugin-azure-storage-append-blob", "~> 0.1.1"
gem "fluent-plugin-kubernetes_metadata_filter", "~> 2.3.0"
gem "ffi"
gem "fluent-plugin-systemd", "~> 1.0.1"
150 changes: 150 additions & 0 deletions docker-image/v1.11/debian-azureblob/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
azure-core (0.1.15)
faraday (~> 0.9)
faraday_middleware (~> 0.10)
nokogiri (~> 1.6)
azure-storage-blob (1.1.0)
azure-core (~> 0.1.13)
azure-storage-common (~> 1.0)
nokogiri (~> 1.6, >= 1.6.8)
azure-storage-common (1.1.0)
azure-core (~> 0.1.13)
nokogiri (~> 1.6, >= 1.6.8)
concurrent-ruby (1.1.6)
cool.io (1.6.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
ffi (1.13.1)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
fluent-config-regexp-type (1.0.0)
fluentd (> 1.0.0, < 2)
fluent-plugin-azure-storage-append-blob (0.1.1)
azure-storage-blob (~> 1.0)
fluentd (>= 0.14.10, < 2)
fluent-plugin-concat (2.4.0)
fluentd (>= 0.14.0, < 2)
fluent-plugin-detect-exceptions (0.0.13)
fluentd (>= 0.10)
fluent-plugin-grok-parser (2.6.1)
fluentd (>= 0.14.6, < 2)
fluent-plugin-json-in-json-2 (1.0.2)
fluentd (>= 0.14.0, < 2)
yajl-ruby (~> 1.0)
fluent-plugin-kubernetes_metadata_filter (2.3.0)
fluentd (>= 0.14.0, < 2)
kubeclient (< 5)
lru_redux
fluent-plugin-multi-format-parser (1.0.0)
fluentd (>= 0.14.0, < 2)
fluent-plugin-prometheus (1.6.1)
fluentd (>= 0.14.20, < 2)
prometheus-client (< 0.10)
fluent-plugin-record-modifier (2.0.1)
fluentd (>= 1.0, < 2)
fluent-plugin-rewrite-tag-filter (2.2.0)
fluent-config-regexp-type
fluentd (>= 0.14.2, < 2)
fluent-plugin-systemd (1.0.2)
fluentd (>= 0.14.11, < 2)
systemd-journal (~> 1.3.2)
fluentd (1.11.1)
cool.io (>= 1.4.5, < 2.0.0)
http_parser.rb (>= 0.5.1, < 0.7.0)
msgpack (>= 1.3.1, < 2.0.0)
serverengine (>= 2.0.4, < 3.0.0)
sigdump (~> 0.2.2)
strptime (>= 0.2.2, < 1.0.0)
tzinfo (>= 1.0, < 3.0)
tzinfo-data (~> 1.0)
yajl-ruby (~> 1.0)
http (4.4.1)
addressable (~> 2.3)
http-cookie (~> 1.0)
http-form_data (~> 2.2)
http-parser (~> 1.2.0)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
http-form_data (2.3.0)
http-parser (1.2.1)
ffi-compiler (>= 1.0, < 2.0)
http_parser.rb (0.6.0)
jsonpath (1.0.5)
multi_json
to_regexp (~> 0.2.1)
kubeclient (4.9.0)
http (>= 3.0, < 5.0)
jsonpath (~> 1.0)
recursive-open-struct (~> 1.1, >= 1.1.1)
rest-client (~> 2.0)
lru_redux (1.1.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
mini_portile2 (2.4.0)
msgpack (1.3.3)
multi_json (1.15.0)
multipart-post (2.1.1)
netrc (0.11.0)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
oj (3.8.1)
prometheus-client (0.9.0)
quantile (~> 0.2.1)
public_suffix (4.0.5)
quantile (0.2.1)
rake (13.0.1)
recursive-open-struct (1.1.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
serverengine (2.2.1)
sigdump (~> 0.2.2)
sigdump (0.2.4)
strptime (0.2.4)
systemd-journal (1.3.3)
ffi (~> 1.9)
to_regexp (0.2.1)
tzinfo (2.0.2)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2020.1)
tzinfo (>= 1.0.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
yajl-ruby (1.4.1)

PLATFORMS
ruby

DEPENDENCIES
azure-storage-blob (~> 1.0)
ffi
fluent-plugin-azure-storage-append-blob (~> 0.1.1)
fluent-plugin-concat (~> 2.4.0)
fluent-plugin-detect-exceptions (~> 0.0.12)
fluent-plugin-grok-parser (~> 2.6.0)
fluent-plugin-json-in-json-2 (>= 1.0.2)
fluent-plugin-kubernetes_metadata_filter (~> 2.3.0)
fluent-plugin-multi-format-parser (~> 1.0.0)
fluent-plugin-prometheus (~> 1.6.1)
fluent-plugin-record-modifier (~> 2.0.0)
fluent-plugin-rewrite-tag-filter (~> 2.2.0)
fluent-plugin-systemd (~> 1.0.1)
fluentd (= 1.11.1)
oj (= 3.8.1)

BUNDLED WITH
2.1.4
30 changes: 30 additions & 0 deletions docker-image/v1.11/debian-azureblob/conf/fluent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /templates/conf/fluent.conf.erb

@include "#{ENV['FLUENTD_SYSTEMD_CONF'] || 'systemd'}.conf"
@include "#{ENV['FLUENTD_PROMETHEUS_CONF'] || 'prometheus'}.conf"
@include kubernetes.conf
@include conf.d/*.conf

<match **>
@type azure-storage-append-blob

azure_storage_account "#{ENV['AZUREBLOB_ACCOUNT_NAME']}"
azure_storage_access_key "#{ENV['AZUREBLOB_ACCOUNT_KEY']}"
azure_container "#{ENV['AZUREBLOB_CONTAINER']}"
auto_create_container true
path "#{ENV['AZUREBLOB_LOG_PATH']}"
azure_object_key_format %{path}%{time_slice}_%{index}.log
time_slice_format %Y%m%d-%H
# if you want to use %{tag} or %Y/%m/%d/ like syntax in path / azure_blob_name_format,
# need to specify tag for %{tag} and time for %Y/%m/%d in <buffer> argument.
<buffer>
@type file
path /var/log/fluent/azurestorageappendblob
timekey 60 # 1 minute
timekey_wait 60
timekey_use_utc true # use utc
chunk_limit_size 256m
</buffer>
</match>
Loading