Skip to content

Commit 98f830b

Browse files
Santhosh Kumar VudaSanthosh Kumar Vuda
authored andcommitted
OL8 docker image support, fluentd version uptake, logging analytics output plugin version upgrade to 2.0.2 for memory usage improvements
1 parent ac3b3a0 commit 98f830b

File tree

11 files changed

+106
-13
lines changed

11 files changed

+106
-13
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Change Log
2+
3+
## 2022-02-24
4+
### Added
5+
- Oracle Linux 8 based Docker Image support.
6+
### Changed
7+
- fluent-plugin-oci-logging-analytics version upgrade to 2.0.2 for memory usage improvements.
8+
- Fluentd version upgrade to 1.14.3.
9+
10+
## 2022-02-7
11+
### Added
12+
- Helm chart v1.0.0 release.
13+
### Fixed
14+
- Fluentd config fix in CRI (configmap-cri.yaml) for Container Generic Logs.
15+
16+
## 2022-01-20
17+
### Added
18+
- Initial release.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ The following are the list of objects supported at present:
9696
9797
We are in the process of building a docker image based off Oracle Linux 8 including Fluentd, OCI Logging Analytics Output Plugin and all the required dependencies.
9898
All the dependencies will be build from source and installed into the image. This image soon would be available to use as a pre-built image as is (OR) to create a custom image using this image as a base image.
99-
At present, for testing purposes follow the below mentioned steps to build an image using official Fluentd Docker Image as base image (off Debian).
100-
- Download all the files from [this dir](logan/docker-images/v1.0/debian/) into a local machine having access to internet.
99+
At present, follow the below mentioned steps to build an image either using Dockerfile off Oracle Linux 8 as base image (OR) Dockerfile off Fluentd base image from Dockerhub (off Debian).
100+
- Download all the files from one of the below mentioned dirs into a local machine having access to internet.
101+
- [OL8](logan/docker-images/v1.0/oraclelinux/8/)
102+
- [Debian](logan/docker-images/v1.0/debian/)
101103
- Run the following command to build the docker image.
102104
- *docker build -t fluentd_oci_la -f Dockerfile .*
103105
- The docker image built from the above step, can either be pushed to Docker Hub or OCI Container Registry (OCIR) or to a Local Docker Registry depending on the requirements.

logan/docker-images/v1.0/debian/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Referred version from fluentd-kubernetes-daemonset gitgub repo ###
22

3-
FROM fluent/fluentd:v1.14.1-debian-1.0
3+
FROM fluent/fluentd:v1.14.3-debian-1.0
44

55
USER root
66
WORKDIR /home/fluent

logan/docker-images/v1.0/debian/Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source "https://rubygems.org"
22

3-
gem "fluentd", "1.14.1"
4-
gem "fluent-plugin-oci-logging-analytics", "2.0.0"
3+
gem "fluentd", "1.14.3"
4+
gem "fluent-plugin-oci-logging-analytics", "2.0.2"
55
gem "fluent-plugin-concat", "~> 2.5.0"
66
gem "fluent-plugin-rewrite-tag-filter", "~> 2.4.0"
77
gem "fluent-plugin-parser-cri", "~> 0.1.1"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM container-registry.oracle.com/os/oraclelinux:8
2+
3+
USER root
4+
WORKDIR /fluentd
5+
6+
# Environment variables
7+
ENV PATH /fluentd/vendor/bundle/ruby/2.7.0/bin:$PATH
8+
ENV GEM_PATH /fluentd/vendor/bundle/ruby/2.7.0:$GEM_PATH
9+
ENV GEM_HOME /fluentd/vendor/bundle/ruby/2.7.0
10+
# skip runtime bundler installation
11+
ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1
12+
ENV TINI_VERSION=0.19.0
13+
14+
COPY Gemfile /fluentd/
15+
16+
# Install ruby 2.7 along with rubygems and bundler.
17+
RUN dnf -y module enable ruby:2.7 \
18+
&& dnf -y install --nodocs ruby ruby-libs \
19+
&& dnf -y install --nodocs rubygems rubygem-openssl rubygem-psych \
20+
&& dnf -y install --nodocs rubygem-bundler rubygem-io-console \
21+
# Install development dependent packages for gems native installation
22+
&& dnf -y install --nodocs gcc make redhat-rpm-config openssl ruby-devel gcc-c++ libtool libffi-devel bzip2 \
23+
# Install Fluentd, it's dependencies along with other run time dependencies for OCI Logging Analytics Solution
24+
&& bundle config silence_root_warning true \
25+
&& bundle config --local path /fluentd/vendor/bundle \
26+
&& bundle install --gemfile=/fluentd/Gemfile \
27+
# Install tini, init for containers
28+
&& curl -L -o /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini" \
29+
&& curl -L -o /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini.asc" \
30+
&& export GNUPGHOME="$(mktemp -d)" \
31+
&& gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
32+
&& gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini \
33+
&& chmod +x /usr/local/bin/tini \
34+
# Install jemalloc
35+
&& curl -L -o /tmp/jemalloc-4.5.0.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/4.5.0/jemalloc-4.5.0.tar.bz2 \
36+
&& cd /tmp && tar -xjf jemalloc-4.5.0.tar.bz2 && cd jemalloc-4.5.0/ \
37+
&& ./configure && make \
38+
&& mv lib/libjemalloc.so.2 /usr/lib \
39+
# Install hostname, required by fluent-plugin-rewrite-tag-filter
40+
&& dnf -y install hostname \
41+
# Remove all the development dependent packages
42+
&& dnf -y remove gcc make redhat-rpm-config openssl ruby-devel gcc-c++ libtool libffi-devel bzip2 \
43+
&& dnf clean all \
44+
&& rm -rf /var/cache/dnf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
45+
46+
RUN mkdir -p /fluentd/etc /fluentd/plugins \
47+
&& touch /fluentd/etc/disable.conf
48+
49+
# Environment variables
50+
ENV FLUENTD_CONF="/fluentd/etc/fluent.conf"
51+
ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"
52+
53+
COPY entrypoint.sh /fluentd/entrypoint.sh
54+
# Give execution permission to entrypoint.sh
55+
RUN ["chmod", "+x", "/fluentd/entrypoint.sh"]
56+
57+
# Overwrite ENTRYPOINT to run fluentd as root for /var/log / /var/lib
58+
ENTRYPOINT ["tini", "--", "/fluentd/entrypoint.sh"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
source "https://rubygems.org"
2+
3+
gem "oj", "3.10.18"
4+
gem "json", "2.4.1"
5+
gem "ext_monitor", "0.1.2"
6+
gem "fluentd", "1.14.3"
7+
gem "fluent-plugin-oci-logging-analytics", "2.0.2"
8+
gem "fluent-plugin-concat", "~> 2.5.0"
9+
gem "fluent-plugin-rewrite-tag-filter", "~> 2.4.0"
10+
gem "fluent-plugin-parser-cri", "~> 0.1.1"
11+
gem "fluent-plugin-kubernetes_metadata_filter", "2.9.1"
12+
gem "fluent-plugin-kubernetes-objects", "~> 1.1.7"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
3+
exec fluentd -c ${FLUENTD_CONF} -p /fluentd/plugins --gemfile /fluentd/Gemfile ${FLUENTD_OPT}

logan/helm-chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.0.0
18+
version: 1.0.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
2424
# appVersion here reflects OCI Logging Analytics Fluentd Output Plugin version
25-
appVersion: "2.0.0"
25+
appVersion: "2.0.2"

logan/helm-chart/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ extraEnv: []
2929
## parameters to set requests and limits for memory and cpu
3030
resources:
3131
limits:
32-
memory: 750Mi
32+
memory: 500Mi
3333
requests:
3434
cpu: 100m
35-
memory: 500Mi
35+
memory: 250Mi
3636
## @param extraVolumes Extra volumes. Below is an example extra volume
3737
## - name: tmpDir
3838
## hostPath:

logan/kubernetes-resources/logs-collection/fluentd-daemonset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ spec:
9797
## parameters to limit the memory and requests for the pods
9898
resources:
9999
limits:
100-
memory: 750Mi
100+
memory: 500Mi
101101
requests:
102102
cpu: 100m
103-
memory: 500Mi
103+
memory: 250Mi
104104
volumeMounts:
105105
- name: varlog
106106
mountPath: /var/log

0 commit comments

Comments
 (0)