From 611a78fb349d9902eee837d38711023bf7987854 Mon Sep 17 00:00:00 2001 From: portdirect Date: Sun, 17 Dec 2017 09:18:48 -0500 Subject: [PATCH] Fluent-Logging: Update fluent-bit to use common OSH entrypoint pattern This PS updates the fluent-logging chart to use the same entrypoint pattern as other OSH components. Change-Id: I3bf9baf9824e1b7f7e46c4fcae292240566d9153 --- .../templates/bin/_fluent-bit.sh.tpl | 21 +++++++++++++++++++ fluent-logging/templates/configmap-bin.yaml | 2 ++ .../templates/daemonset-fluent-bit.yaml | 10 +++++++++ 3 files changed, 33 insertions(+) create mode 100644 fluent-logging/templates/bin/_fluent-bit.sh.tpl diff --git a/fluent-logging/templates/bin/_fluent-bit.sh.tpl b/fluent-logging/templates/bin/_fluent-bit.sh.tpl new file mode 100644 index 000000000..7745af8e2 --- /dev/null +++ b/fluent-logging/templates/bin/_fluent-bit.sh.tpl @@ -0,0 +1,21 @@ +#!/bin/sh + +{{/* +Copyright 2017 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. +*/}} + +set -ex + +exec /fluent-bit/bin/fluent-bit -c /fluent-bit/etc/fluent-bit.conf diff --git a/fluent-logging/templates/configmap-bin.yaml b/fluent-logging/templates/configmap-bin.yaml index d95622d77..312f59af6 100644 --- a/fluent-logging/templates/configmap-bin.yaml +++ b/fluent-logging/templates/configmap-bin.yaml @@ -24,6 +24,8 @@ metadata: data: fluentd.sh: | {{ tuple "bin/_fluentd.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + fluent-bit.sh: | +{{ tuple "bin/_fluent-bit.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} helm-tests.sh: | {{ tuple "bin/_helm-tests.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} image-repo-sync.sh: |+ diff --git a/fluent-logging/templates/daemonset-fluent-bit.yaml b/fluent-logging/templates/daemonset-fluent-bit.yaml index 640b58f46..2d95ae41b 100644 --- a/fluent-logging/templates/daemonset-fluent-bit.yaml +++ b/fluent-logging/templates/daemonset-fluent-bit.yaml @@ -51,7 +51,13 @@ spec: image: {{ .Values.images.tags.fluentbit }} imagePullPolicy: {{ .Values.images.pull_policy }} {{ tuple $envAll $envAll.Values.pod.resources.fluentbit | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} + command: + - /tmp/fluent-bit.sh volumeMounts: + - name: fluent-logging-bin + mountPath: /tmp/fluent-bit.sh + subPath: fluent-bit.sh + readOnly: true - name: varlog mountPath: /var/log - name: varlibdockercontainers @@ -74,6 +80,10 @@ spec: - name: varlibdockercontainers hostPath: path: /var/lib/docker/containers + - name: fluent-logging-bin + configMap: + name: fluent-logging-bin + defaultMode: 0555 - name: fluent-logging-etc configMap: name: fluent-logging-etc