feat: Add fluent-bit, latest cri-o, kubelet logrotate tweak

This commit is contained in:
Stefan Reimer 2022-05-18 14:12:38 +02:00
parent 22263b8b85
commit 30a78c2947
7 changed files with 113 additions and 2 deletions

View File

@ -15,6 +15,7 @@ work:
aports:
git clone https://gitlab.alpinelinux.org/alpine/aports.git --depth=1
aports_update: aports
GIT_DIR=aports/.git git fetch origin -p
GIT_DIR=aports/.git git pull origin master

View File

@ -3,7 +3,7 @@
# Contributor: TBK <alpine@jjtc.eu>
# Maintainer: ungleich <foss@ungleich.ch>
pkgname=cri-o
pkgver=1.22.3
pkgver=1.22.4
pkgrel=0
pkgdesc="OCI-based implementation of Kubernetes Container Runtime Interface"
url="https://github.com/cri-o/cri-o/"

87
v3.15/fluent-bit/APKBUILD Normal file
View File

@ -0,0 +1,87 @@
# Contributor: Stefan Reimer <stefan@zero-downtime.net>
# Maintainer: Stefan Reimer <stefan@zero-downtime.net>
pkgname=fluent-bit
pkgver=1.9.3
pkgrel=0
pkgdesc="Fast and Lightweight Log processor and forwarder"
url="https://fluentbit.io/"
# riscv64: does not support bundled luajit
arch="all !ppc64le !s390x !riscv64"
license="Apache-2.0"
makedepends="
bison
cmake
flex
fts-dev
gtest-dev
zlib-dev
"
subpackages="
$pkgname-dev
$pkgname-openrc
"
source="$pkgname-$pkgver.tar.gz::https://github.com/fluent/fluent-bit/archive/v$pkgver.tar.gz
fluent-bit.confd
fluent-bit.initd
chunkio-static-lib-fts.patch
"
# enable check when this solved - https://github.com/fluent/fluent-bit/issues/2464#issuecomment-673280055
# Disable all things AWS to make tests pass
options="!check"
build() {
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
# default CORE_STACK_SIZE=((3 * PTHREAD_STACK_MIN) / 2)=3072 is invalid
# set default to 24576
# Disable stream processor due to issue see: https://github.com/fluent/fluent-bit/issues/2464
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_FIND_LIBRARY_SUFFIXES=".a" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_EXE_LINKER_FLAGS="-static" \
-DFLB_CORO_STACK_SIZE=24576 \
-DFLB_RELEASE=Yes \
-DFLB_DEBUG=No \
-DFLB_SHARED_LIB=No \
-DFLB_JEMALLOC=Yes \
-DFLB_IN_SYSTEMD=No \
-DFLB_PROXY_GO=No \
-DFLB_HTTP_SERVER=Yes \
-DFLB_STREAM_PROCESSOR=No \
$CMAKE_CROSSOPTS .
make -C build
#-DFLB_TESTS_INTERNAL=Yes \
#-DFLB_AWS=No \
#-DFLB_SIGNV4=No \
#-DFLB_OUT_S3=No \
#-DFLB_OUT_CLOUDWATCH_LOGS=No \
#-DFLB_OUT_KINESIS_FIREHOSE=No \
#-DFLB_OUT_KINESIS_STREAMS=No \
#-DFLB_OUT_BIGQUERY=No \
#-DFLB_FILTER_AWS=No \
}
check() {
CTEST_OUTPUT_ON_FAILURE=1 make -C build test
}
package() {
make -C build DESTDIR="$pkgdir" install
install -Dm755 "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/$pkgname
install -Dm644 "$srcdir"/$pkgname.confd \
"$pkgdir"/etc/conf.d/$pkgname
mv "$pkgdir"/usr/etc/* "$pkgdir"/etc
}
sha512sums="
40fe86014ff97bc54cecb8c3251263b002659c3c79e825109334b3dc9ebfabac1f8872e2d0a2096fda169bdbd35d3fa8edc934338fd2ac100d48444c96c1af02 fluent-bit-1.9.3.tar.gz
f6431397c80a036980b5377b51e38aec25dfceeb8dbe4cd54dce1f6e77d669d9f8daf983fcc96d25332385888f1809ced5e8ab0e8ccfcd93d19494036e3dc949 fluent-bit.confd
8ba6c8e84dee90176f9b4375fb2c6444fa5d32fa601d9bcf3ea7960fec87f1ef664f175caf08bd0b052843e971efdbf08e2a5cd180ad9a8f23ff2c5cb233814f fluent-bit.initd
6bd7d8b4da93a17f29b6ea1e0286ea226d0e376024284741110936779b3229bd8d6cd03ffbdc5d3b4842294e7f32a888de0dd16b0851b65d91b062ca58530ea0 chunkio-static-lib-fts.patch
"

View File

@ -0,0 +1,10 @@
--- a/lib/chunkio/src/CMakeLists.txt
+++ b/lib/chunkio/src/CMakeLists.txt
@@ -12,6 +12,7 @@
)
set(libs cio-crc32)
+set(libs ${libs} fts)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(src

View File

@ -0,0 +1 @@
fluentbit_opts="-c /etc/fluent-bit/fluent-bit.conf"

View File

@ -0,0 +1,11 @@
#!/sbin/openrc-run
supervisor=supervise-daemon
name=fluent-bit
command="/usr/bin/fluent-bit"
command_args="$fluentbit_opts"
depend() {
need net
after firewall
}

View File

@ -1,6 +1,7 @@
/var/log/kubelet/*.log {
nodateext
missingok
size 5M
size 10
rotate 3
compress
copytruncate