mirror of https://github.com/k3s-io/k3s
Reduce the size of fluentd images
parent
b17379007a
commit
5753a3196c
|
@ -22,7 +22,7 @@
|
|||
# Please see http://docs.fluentd.org/articles/install-by-deb for more
|
||||
# information about installing fluentd using deb package.
|
||||
|
||||
FROM ubuntu:14.04
|
||||
FROM gcr.io/google_containers/ubuntu-slim:0.3
|
||||
MAINTAINER Alex Robinson "arob@google.com"
|
||||
MAINTAINER Jimmi Dyson "jimmidyson@gmail.com"
|
||||
|
||||
|
@ -32,24 +32,11 @@ RUN ulimit -n 65536
|
|||
# Disable prompts from apt.
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Install prerequisites.
|
||||
RUN apt-get update && \
|
||||
apt-get install -y -q curl make g++ && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install Fluentd.
|
||||
RUN /usr/bin/curl -L https://td-toolbelt.herokuapp.com/sh/install-ubuntu-trusty-td-agent2.sh | sh
|
||||
|
||||
# Change the default user and group to root.
|
||||
# Needed to allow access to /var/log/docker/... files.
|
||||
RUN sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent
|
||||
|
||||
# Install the Elasticsearch Fluentd plug-in.
|
||||
RUN td-agent-gem install fluent-plugin-kubernetes_metadata_filter fluent-plugin-elasticsearch
|
||||
|
||||
# Copy the Fluentd configuration file.
|
||||
COPY td-agent.conf /etc/td-agent/td-agent.conf
|
||||
|
||||
COPY build.sh /tmp/build.sh
|
||||
RUN /tmp/build.sh
|
||||
|
||||
# Run the Fluentd service.
|
||||
ENTRYPOINT ["td-agent"]
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
.PHONY: build push
|
||||
|
||||
IMAGE = fluentd-elasticsearch
|
||||
TAG = 1.17
|
||||
TAG = 1.19
|
||||
|
||||
build:
|
||||
docker build -t gcr.io/google_containers/$(IMAGE):$(TAG) .
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
# Install prerequisites.
|
||||
apt-get update
|
||||
|
||||
apt-get install -y -q --no-install-recommends \
|
||||
curl ca-certificates make g++ sudo bash
|
||||
|
||||
# Install Fluentd.
|
||||
/usr/bin/curl -sSL https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh
|
||||
|
||||
# Change the default user and group to root.
|
||||
# Needed to allow access to /var/log/docker/... files.
|
||||
sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent
|
||||
|
||||
# Install the Elasticsearch Fluentd plug-in.
|
||||
td-agent-gem install fluent-plugin-kubernetes_metadata_filter fluent-plugin-elasticsearch
|
||||
|
||||
# Remove docs and postgres references
|
||||
rm -rf /opt/td-agent/embedded/share/doc \
|
||||
/opt/td-agent/embedded/share/gtk-doc \
|
||||
/opt/td-agent/embedded/lib/postgresql \
|
||||
/opt/td-agent/embedded/bin/postgres \
|
||||
/opt/td-agent/embedded/share/postgresql
|
||||
|
||||
apt-get remove -y make g++
|
||||
apt-get autoremove -y
|
||||
apt-get clean -y
|
||||
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
@ -20,7 +20,7 @@
|
|||
# scope and that the Logging API has been enabled for the project
|
||||
# in the Google Developer Console.
|
||||
|
||||
FROM ubuntu:16.04
|
||||
FROM gcr.io/google_containers/ubuntu-slim:0.3
|
||||
MAINTAINER Alex Robinson "arob@google.com"
|
||||
|
||||
# Disable prompts from apt.
|
||||
|
@ -29,19 +29,22 @@ ENV DEBIAN_FRONTEND noninteractive
|
|||
ENV DO_NOT_INSTALL_CATCH_ALL_CONFIG true
|
||||
|
||||
RUN apt-get -q update && \
|
||||
apt-get install -y curl && \
|
||||
apt-get install -y gcc && \
|
||||
apt-get install -y make && \
|
||||
apt-get install -y curl ca-certificates gcc make bash && \
|
||||
apt-get install -y --reinstall lsb-base lsb-release && \
|
||||
echo "Installing logging agent" && \
|
||||
curl -sSL https://dl.google.com/cloudagents/install-logging-agent.sh | bash && \
|
||||
/usr/sbin/google-fluentd-gem install fluent-plugin-record-reformer -v 0.8.1 && \
|
||||
/usr/sbin/google-fluentd-gem install fluent-plugin-systemd -v 0.0.3 && \
|
||||
apt-get remove -y gcc make && \
|
||||
apt-get autoremove -y && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
||||
curl -s https://dl.google.com/cloudagents/install-logging-agent.sh | bash
|
||||
|
||||
# Install the record reformer and systemd plugins.
|
||||
RUN /usr/sbin/google-fluentd-gem install fluent-plugin-record-reformer -v 0.8.1
|
||||
RUN /usr/sbin/google-fluentd-gem install fluent-plugin-systemd -v 0.0.3
|
||||
|
||||
# Remove the misleading log file that gets generated when the agent is installed
|
||||
RUN rm -rf /var/log/google-fluentd
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
|
||||
/opt/google-fluentd/embedded/share/doc \
|
||||
/opt/google-fluentd/embedded/share/gtk-doc \
|
||||
/opt/google-fluentd/embedded/lib/postgresql \
|
||||
/opt/google-fluentd/embedded/bin/postgres \
|
||||
/opt/google-fluentd/embedded/share/postgresql \
|
||||
/var/log/google-fluentd
|
||||
|
||||
# Copy the Fluentd configuration files for logging Docker container logs.
|
||||
# Either configuration file can be used by specifying `-c <file>` as a command
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
.PHONY: kbuild kpush
|
||||
|
||||
TAG = 1.21
|
||||
TAG = 1.22
|
||||
|
||||
# Rules for building the test image for deployment to Dockerhub with user kubernetes.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ metadata:
|
|||
spec:
|
||||
containers:
|
||||
- name: fluentd-elasticsearch
|
||||
image: gcr.io/google_containers/fluentd-elasticsearch:1.17
|
||||
image: aledbf/fluentd-elasticsearch:1.19
|
||||
resources:
|
||||
limits:
|
||||
memory: 200Mi
|
||||
|
|
|
@ -11,7 +11,7 @@ spec:
|
|||
dnsPolicy: Default
|
||||
containers:
|
||||
- name: fluentd-cloud-logging
|
||||
image: gcr.io/google_containers/fluentd-gcp:1.21
|
||||
image: aledbf/fluentd-gcp:1.22
|
||||
resources:
|
||||
limits:
|
||||
memory: 200Mi
|
||||
|
|
Loading…
Reference in New Issue