forked from kube-logging/logging-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/multi fluentbit support (kube-logging#665)
NodeAgent Support
- Loading branch information
Showing
31 changed files
with
8,884 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3,559 changes: 3,559 additions & 0 deletions
3,559
charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3,559 changes: 3,559 additions & 0 deletions
3,559
config/crd/bases/logging.banzaicloud.io_loggings.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# escape=` | ||
|
||
ARG WINDOWS_VERSION=ltsc2019 | ||
|
||
# | ||
# Builder Image - Windows Server Core | ||
# | ||
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION as builder | ||
|
||
# The FLUENTBIT_VERSION ARG must be after the FROM instruction | ||
ARG FLUENTBIT_VERSION=1.6.10 | ||
ARG IMAGE_CREATE_DATE | ||
ARG IMAGE_SOURCE_REVISION | ||
|
||
# Metadata as defined in OCI image spec annotations | ||
# https://github.com/opencontainers/image-spec/blob/master/annotations.md | ||
LABEL org.opencontainers.image.title="Fluent Bit" ` | ||
org.opencontainers.image.description="Fluent Bit is an open source and multi-platform Log Processor and Forwarder which allows you to collect data/logs from different sources, unify and send them to multiple destinations. It's fully compatible with Docker and Kubernetes environments." ` | ||
org.opencontainers.image.created=$IMAGE_CREATE_DATE ` | ||
org.opencontainers.image.version=$FLUENTBIT_VERSION ` | ||
org.opencontainers.image.authors="Eduardo Silva <[email protected]>" ` | ||
org.opencontainers.image.url="https://hub.docker.com/r/fluent/fluent-bit" ` | ||
org.opencontainers.image.documentation="https://docs.fluentbit.io/manual/" ` | ||
org.opencontainers.image.vendor="Fluent Organization" ` | ||
org.opencontainers.image.licenses="Apache-2.0" ` | ||
org.opencontainers.image.source="https://github.com/fluent/fluent-bit" ` | ||
org.opencontainers.image.revision=$IMAGE_SOURCE_REVISION | ||
|
||
# | ||
# Basic setup | ||
# | ||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
RUN Write-Host ('Creating folders'); ` | ||
New-Item -Type Directory -Path /local; ` | ||
New-Item -Type Directory -Path /fluent-bit; | ||
|
||
WORKDIR /local | ||
|
||
# | ||
# Install Fluent Bit | ||
# | ||
RUN Write-Host ('Installing Fluent Bit'); ` | ||
$majorminor = ([Version]::Parse("$env:FLUENTBIT_VERSION")).toString(2); ` | ||
Invoke-WebRequest -Uri "https://fluentbit.io/releases/$($majorminor)/td-agent-bit-$($env:FLUENTBIT_VERSION)-win64.zip" -OutFile td-agent-bit.zip; ` | ||
Expand-Archive -Path td-agent-bit.zip -Destination /local/fluent-bit; ` | ||
Move-Item -Path /local/fluent-bit/*/* -Destination /fluent-bit/; | ||
|
||
# | ||
# Technique from https://github.com/StefanScherer/dockerfiles-windows/blob/master/mongo/3.6/Dockerfile | ||
# | ||
ADD https://aka.ms/vs/15/release/vc_redist.x64.exe /local/vc_redist.x64.exe | ||
|
||
RUN Write-Host ('Installing Visual C++ Redistributable Package'); ` | ||
Start-Process /local/vc_redist.x64.exe -ArgumentList '/install', '/quiet', '/norestart' -NoNewWindow -Wait; ` | ||
Copy-Item -Path /Windows/System32/msvcp140.dll -Destination /fluent-bit/bin/; ` | ||
Copy-Item -Path /Windows/System32/vccorlib140.dll -Destination /fluent-bit/bin/; ` | ||
Copy-Item -Path /Windows/System32/vcruntime140.dll -Destination /fluent-bit/bin/; | ||
|
||
# | ||
# Runtime Image - Windows Server Nano | ||
# | ||
FROM mcr.microsoft.com/windows/servercore:$WINDOWS_VERSION as runtime | ||
|
||
COPY --from=builder /fluent-bit /fluent-bit | ||
|
||
RUN setx /M PATH "%PATH%;C:\fluent-bit\bin" | ||
|
||
ENTRYPOINT ["fluent-bit.exe", "-i", "dummy", "-o", "stdout"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// Copyright © 2021 Banzai Cloud | ||
// | ||
// 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. | ||
|
||
package nodeagent | ||
|
||
const BaseConfigName = "fluent-bit.conf" | ||
const UpstreamConfigName = "upstream.conf" | ||
|
||
var fluentBitConfigTemplate = ` | ||
[SERVICE] | ||
Flush {{ .Flush }} | ||
Grace {{ .Grace }} | ||
Daemon Off | ||
Log_Level {{ .LogLevel }} | ||
Parsers_File /fluent-bit/conf/parsers.conf | ||
Coro_Stack_Size {{ .CoroStackSize }} | ||
{{- if .Monitor.Enabled }} | ||
HTTP_Server On | ||
HTTP_Listen 0.0.0.0 | ||
HTTP_Port {{ .Monitor.Port }} | ||
{{- end }} | ||
[INPUT] | ||
Name tail | ||
{{- range $key, $value := .Input.Values }} | ||
{{- if $value }} | ||
{{ $key }} {{$value}} | ||
{{- end }} | ||
{{- end }} | ||
{{- range $id, $v := .Input.ParserN }} | ||
{{- if $v }} | ||
Parse_{{ $id}} {{$v}} | ||
{{- end }} | ||
{{- end }} | ||
{{- if not .DisableKubernetesFilter }} | ||
[FILTER] | ||
Name kubernetes | ||
{{- range $key, $value := .KubernetesFilter }} | ||
{{- if $value }} | ||
{{ $key }} {{$value}} | ||
{{- end }} | ||
{{- end }} | ||
{{- end}} | ||
{{- if .AwsFilter }} | ||
[FILTER] | ||
Name aws | ||
{{- range $key, $value := .AwsFilter }} | ||
{{- if $value }} | ||
{{ $key }} {{$value}} | ||
{{- end }} | ||
{{- end }} | ||
{{- end}} | ||
[OUTPUT] | ||
Name forward | ||
Match * | ||
{{- if .Upstream.Enabled }} | ||
Upstream /fluent-bit/conf_upstream/upstream.conf | ||
{{- else }} | ||
Host {{ .TargetHost }} | ||
Port {{ .TargetPort }} | ||
{{- end }} | ||
{{ if .TLS.Enabled }} | ||
tls On | ||
tls.verify Off | ||
tls.ca_file /fluent-bit/tls/ca.crt | ||
tls.crt_file /fluent-bit/tls/tls.crt | ||
tls.key_file /fluent-bit/tls/tls.key | ||
{{- if .TLS.SharedKey }} | ||
Shared_Key {{ .TLS.SharedKey }} | ||
{{- else }} | ||
Empty_Shared_Key true | ||
{{- end }} | ||
{{- end }} | ||
{{- if .Network.ConnectTimeoutSet }} | ||
net.connect_timeout {{.Network.ConnectTimeout}} | ||
{{- end }} | ||
{{- if .Network.KeepaliveSet}} | ||
net.keepalive {{if .Network.Keepalive }}on{{else}}off{{end}} | ||
{{- end }} | ||
{{- if .Network.KeepaliveIdleTimeoutSet }} | ||
net.keepalive_idle_timeout {{.Network.KeepaliveIdleTimeout}} | ||
{{- end }} | ||
{{- if .Network.KeepaliveMaxRecycleSet }} | ||
net.keepalive_max_recycle {{.Network.KeepaliveMaxRecycle}} | ||
{{- end }} | ||
{{- if .ForwardOptions }} | ||
{{- range $key, $value := .ForwardOptions }} | ||
{{- if $value }} | ||
{{ $key }} {{$value}} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
` | ||
|
||
var upstreamConfigTemplate = ` | ||
[UPSTREAM] | ||
Name {{ .Config.Name }} | ||
{{- range $idx, $element:= .Config.Nodes}} | ||
[NODE] | ||
Name {{.Name}} | ||
Host {{.Host}} | ||
Port {{.Port}} | ||
{{- end}} | ||
` |
Oops, something went wrong.