From add885b9a8fe60cf0ad1e1314fa8141435b36fbf Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Wed, 22 May 2019 10:36:00 -0500 Subject: [PATCH] OSH-Images: Add fluentd image with systemd plugin This adds a custom fluentd-kubernetes-daemonset image with the systemd plugin for consuming logs for things like the kubelet and docker directly from systemd. This uses version 1.4.2 of the image as the base Change-Id: Icfad220fa7c243eab45cf5ece4244f75200a0812 --- fluentd/Dockerfile.debian | 3 +++ fluentd/build.sh | 14 ++++++++++ zuul.d/fluentd.yaml | 57 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 fluentd/Dockerfile.debian create mode 100755 fluentd/build.sh create mode 100644 zuul.d/fluentd.yaml diff --git a/fluentd/Dockerfile.debian b/fluentd/Dockerfile.debian new file mode 100644 index 0000000..82ced98 --- /dev/null +++ b/fluentd/Dockerfile.debian @@ -0,0 +1,3 @@ +FROM docker.io/fluent/fluentd-kubernetes-daemonset:v1.4.2-debian-elasticsearch-1.0 + +RUN gem install fluent-plugin-systemd -v 1.0.1 diff --git a/fluentd/build.sh b/fluentd/build.sh new file mode 100755 index 0000000..39acab6 --- /dev/null +++ b/fluentd/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +SCRIPT=`realpath $0` +SCRIPT_DIR=`dirname ${SCRIPT}` +## Only build from main folder +cd ${SCRIPT_DIR}/.. + +IMAGE="fluentd" +VERSION=${VERSION:-latest} +DISTRO=${DISTRO:-debian} +REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"} +EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""} +docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} + +cd - diff --git a/zuul.d/fluentd.yaml b/zuul.d/fluentd.yaml new file mode 100644 index 0000000..9c4ef0f --- /dev/null +++ b/zuul.d/fluentd.yaml @@ -0,0 +1,57 @@ +--- +# Copyright 2019 The Openstack-Helm Authors. +# +# 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. + +- project: + check: + jobs: + - openstack-helm-images-build-fluentd + gate: + jobs: + - openstack-helm-images-upload-fluentd + promote: + jobs: + - openstack-helm-images-promote-fluentd + periodic: + jobs: + - openstack-helm-images-build-fluentd + +- job: + name: openstack-helm-images-build-fluentd + parent: openstack-helm-images-build + description: Build fluentd image with custom plugins + vars: &fluentd_vars + docker_images: + - context: fluentd + repository: openstackhelm/fluentd + dockerfile: Dockerfile.debian + tags: + - latest-debian + files: &fluentd_files + - fluentd/.* + - zuul.d/fluentd.yaml + +- job: + name: openstack-helm-images-upload-fluentd + parent: openstack-helm-images-upload + description: Build and upload fluentd image with additional plugins + vars: *fluentd_vars + files: *fluentd_files + +- job: + name: openstack-helm-images-promote-fluentd + parent: openstack-helm-images-promote + description: Promote a previously published fluentd image to latest. + vars: *fluentd_vars + files: *fluentd_files