Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packaging: switch to YAML config files by default #9837

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions conf/fluent-bit-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
service:
flush: 1
log_level: info
http_server: false
http_listen: 0.0.0.0
http_port: 2020
parsers_file: parsers.yaml
plugins_file: plugins.yaml

pipeline:
inputs:
- name: dummy
tag: dummy.local

outputs:
- name: stdout
match: '*'
2 changes: 1 addition & 1 deletion conf/fluent-bit-metrics.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[OUTPUT]
name prometheus_exporter
match node_metrics
listen 0.0.0.0
host 0.0.0.0
port 2021
# Add user-defined labels
# -----------------------
Expand Down
14 changes: 14 additions & 0 deletions conf/fluent-bit-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
service:
flush: 1
log_level: info

pipeline:
inputs:
- name: node_exporter_metrics
tag: node_metrics

outputs:
- name: prometheus_exporter
match: node_metrics
host: 0.0.0.0
port: 2021
17 changes: 17 additions & 0 deletions conf/fluent-bit-win32.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
service:
flush: 1
log_level: info
http_server: false
http_listen: 0.0.0.0
http_port: 2020
parsers_file: parsers.yaml
plugins_file: plugins.yaml

pipeline:
inputs:
- name: winlog
channels: 'Setup,Windows PowerShell'

outputs:
- name: stdout
match: '*'
17 changes: 17 additions & 0 deletions conf/fluent-bit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
service:
flush: 1
log_level: info
http_server: false
http_listen: 0.0.0.0
http_port: 2020
parsers_file: parsers.yaml
plugins_file: plugins.yaml

pipeline:
inputs:
- name: cpu
tag: cpu.local

outputs:
- name: stdout
match: '*'
9 changes: 9 additions & 0 deletions conf/parsers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
parsers:
- name: json
format: json

- name: docker
format: json
time_key: time
time_format: "%Y-%m-%dT%H:%M:%S.%L"
time_keep: true
2 changes: 2 additions & 0 deletions conf/plugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
plugins:
# - /other/path/to/out_gstdout.so
3 changes: 3 additions & 0 deletions cpack/debian/conffiles
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/etc/fluent-bit/parsers.conf
/etc/fluent-bit/plugins.conf
/etc/fluent-bit/fluent-bit.conf
/etc/fluent-bit/parsers.yaml
/etc/fluent-bit/plugins.yaml
/etc/fluent-bit/fluent-bit.yaml
2 changes: 1 addition & 1 deletion cpack/macos/fluent-bit.plist.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<array>
<string>@CMAKE_INSTALL_FULL_BINDIR@/@FLB_OUT_NAME@</string>
<string>--config</string>
<string>@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_SYSCONFDIR@/@FLB_OUT_NAME@/@FLB_OUT_NAME@.conf</string>
<string>@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_SYSCONFDIR@/@FLB_OUT_NAME@/@FLB_OUT_NAME@.yaml</string>
</array>
<key>RunAtLoad</key>
<true/>
Expand Down
2 changes: 1 addition & 1 deletion cpack/wix/WIX.template.in.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</SetProperty>

<Property Id="CreateFluentBitWinSvc" Value=" "/>
<CustomAction Id="SetCreateFluentBitWinSvcCommand" Property="CreateFluentBitWinSvc" Value="&quot;sc.exe&quot; create @FLB_OUT_NAME@ binpath= &quot;\&quot;[INSTALL_ROOT]bin\@[email protected]\&quot; -c \&quot;[INSTALL_ROOT]conf\@FLB_OUT_NAME@.conf\&quot;&quot; start= delayed-auto" Execute="immediate" />
<CustomAction Id="SetCreateFluentBitWinSvcCommand" Property="CreateFluentBitWinSvc" Value="&quot;sc.exe&quot; create @FLB_OUT_NAME@ binpath= &quot;\&quot;[INSTALL_ROOT]bin\@[email protected]\&quot; -c \&quot;[INSTALL_ROOT]conf\@FLB_OUT_NAME@.yaml\&quot;&quot; start= delayed-auto" Execute="immediate" />
<CustomAction Id="CreateFluentBitWinSvc" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />

<Property Id="LaunchFluentBitWinSvc" Value=" "/>
Expand Down
20 changes: 10 additions & 10 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ RUN make -j "$(getconf _NPROCESSORS_ONLN)"
RUN install bin/fluent-bit /fluent-bit/bin/

# Configuration files
COPY conf/fluent-bit.conf \
conf/parsers.conf \
conf/parsers_ambassador.conf \
conf/parsers_java.conf \
conf/parsers_extra.conf \
conf/parsers_openstack.conf \
conf/parsers_cinder.conf \
conf/plugins.conf \
COPY conf/fluent-bit.* \
conf/parsers.* \
conf/parsers_ambassador.* \
conf/parsers_java.* \
conf/parsers_extra.* \
conf/parsers_openstack.* \
conf/parsers_cinder.* \
conf/plugins.* \
/fluent-bit/etc/

# Generate schema and include as part of the container image
Expand Down Expand Up @@ -185,7 +185,7 @@ EXPOSE 2020

# Entry point
ENTRYPOINT [ "/fluent-bit/bin/fluent-bit" ]
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.conf"]
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.yaml"]

FROM debian:bookworm-slim AS debug
ARG RELEASE_VERSION
Expand Down Expand Up @@ -239,4 +239,4 @@ COPY --from=builder /fluent-bit /fluent-bit
EXPOSE 2020

# No entry point so we can just shell in
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.conf"]
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.yaml"]
5 changes: 4 additions & 1 deletion dockerfiles/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,16 @@ RUN cmake -G "'Visual Studio 16 2019'" -DOPENSSL_ROOT_DIR='C:\dev\vcpkg\packages
# Set up config files and binaries in single /fluent-bit hierarchy for easy copy in later stage
RUN New-Item -Path /fluent-bit/etc/ -ItemType "directory"; `
Copy-Item -Path /src/conf/fluent-bit-win32.conf /fluent-bit/etc/fluent-bit.conf; `
Copy-Item -Path /src/conf/fluent-bit-win32.yaml /fluent-bit/etc/fluent-bit.yaml; `
Copy-Item -Path /src/conf/parsers.conf /fluent-bit/etc/; `
Copy-Item -Path /src/conf/parsers.yaml /fluent-bit/etc/; `
Copy-Item -Path /src/conf/parsers_ambassador.conf /fluent-bit/etc/; `
Copy-Item -Path /src/conf/parsers_java.conf /fluent-bit/etc/; `
Copy-Item -Path /src/conf/parsers_extra.conf /fluent-bit/etc/; `
Copy-Item -Path /src/conf/parsers_openstack.conf /fluent-bit/etc/; `
Copy-Item -Path /src/conf/parsers_cinder.conf /fluent-bit/etc/; `
Copy-Item -Path /src/conf/plugins.conf /fluent-bit/etc/; `
Copy-Item -Path /src/conf/plugins.yaml /fluent-bit/etc/; `
Copy-Item -Path /src/build/bin/Release/fluent-bit.exe /fluent-bit/bin/; `
Copy-Item -Path /src/build/bin/Release/fluent-bit.dll /fluent-bit/bin/;
#
Expand Down Expand Up @@ -114,4 +117,4 @@ RUN setx /M PATH "%PATH%;C:\fluent-bit\bin"
ENTRYPOINT [ "fluent-bit.exe" ]
# Hadolint gets confused by Windows it seems
# hadolint ignore=DL3025
CMD [ "fluent-bit.exe", "-c", "/fluent-bit/etc/fluent-bit.conf" ]
CMD [ "fluent-bit.exe", "-c", "/fluent-bit/etc/fluent-bit.yaml" ]
2 changes: 1 addition & 1 deletion init/systemd.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ After=network.target
Type=simple
EnvironmentFile=-/etc/sysconfig/@FLB_OUT_NAME@
EnvironmentFile=-/etc/default/@FLB_OUT_NAME@
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/@FLB_OUT_NAME@ -c /@CMAKE_INSTALL_SYSCONFDIR@/@FLB_OUT_NAME@/@FLB_OUT_NAME@.conf
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/@FLB_OUT_NAME@ -c /@CMAKE_INSTALL_SYSCONFDIR@/@FLB_OUT_NAME@/@FLB_OUT_NAME@.yaml
Restart=always

[Install]
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugs:

apps:
service:
command: fluent-bit -c $SNAP/etc/fluent-bit/fluent-bit.conf
command: fluent-bit -c $SNAP/etc/fluent-bit/fluent-bit.yaml
daemon: simple
plugs:
- network
Expand Down
23 changes: 23 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -571,28 +571,51 @@ if(FLB_BINARY)
DESTINATION ${FLB_INSTALL_CONFDIR}
COMPONENT binary
RENAME "${FLB_OUT_NAME}.conf")
install(FILES
"${PROJECT_SOURCE_DIR}/conf/fluent-bit-win32.yaml"
DESTINATION ${FLB_INSTALL_CONFDIR}
COMPONENT binary
RENAME "${FLB_OUT_NAME}.yaml")
elseif(FLB_SYSTEM_MACOS)
install(FILES
"${PROJECT_SOURCE_DIR}/conf/fluent-bit-macos.conf"
DESTINATION ${FLB_INSTALL_CONFDIR}
COMPONENT binary
RENAME "${FLB_OUT_NAME}.conf")
install(FILES
"${PROJECT_SOURCE_DIR}/conf/fluent-bit-macos.yaml"
DESTINATION ${FLB_INSTALL_CONFDIR}
COMPONENT binary
RENAME "${FLB_OUT_NAME}.yaml")
else()
install(FILES
"${PROJECT_SOURCE_DIR}/conf/fluent-bit.conf"
DESTINATION ${FLB_INSTALL_CONFDIR}
COMPONENT binary
RENAME "${FLB_OUT_NAME}.conf")
install(FILES
"${PROJECT_SOURCE_DIR}/conf/fluent-bit.yaml"
DESTINATION ${FLB_INSTALL_CONFDIR}
COMPONENT binary
RENAME "${FLB_OUT_NAME}.yaml")
endif()

install(FILES
"${PROJECT_SOURCE_DIR}/conf/parsers.conf"
COMPONENT binary
DESTINATION ${FLB_INSTALL_CONFDIR})
install(FILES
"${PROJECT_SOURCE_DIR}/conf/parsers.yaml"
COMPONENT binary
DESTINATION ${FLB_INSTALL_CONFDIR})

install(FILES
"${PROJECT_SOURCE_DIR}/conf/plugins.conf"
COMPONENT binary
DESTINATION ${FLB_INSTALL_CONFDIR})
install(FILES
"${PROJECT_SOURCE_DIR}/conf/plugins.yaml"
COMPONENT binary
DESTINATION ${FLB_INSTALL_CONFDIR})

endif()
Loading