Skip to content

Commit

Permalink
feat: Add kubernetes daemonsets for fluentd 1.17
Browse files Browse the repository at this point in the history
Signed-off-by: RJ Sampson <rj.sampson@chainguard.dev>
  • Loading branch information
EyeCantCU committed Dec 13, 2024
1 parent 5a695e6 commit 615bfa9
Show file tree
Hide file tree
Showing 4 changed files with 564 additions and 0 deletions.
141 changes: 141 additions & 0 deletions ruby3.1-fluentd-kubernetes-daemonset-1.17.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
package:
# fluentd supported versions: https://github.com/fluent/fluentd/blob/master/SECURITY.md
# The kubernetes daemonset trails fluentd releases by a bit
name: ruby3.1-fluentd-kubernetes-daemonset-1.17
version: 1.17.1.1.2
epoch: 0
description: Fluentd ${{vars.fluentdMM}} daemonset for Kubernetes
copyright:
- license: Apache-2.0

environment:
contents:
packages:
- autoconf
- automake
- bash
- build-base
- busybox
- ca-certificates-bundle
- libtool
- m4
- ruby${{vars.rubyMM}}-bundler
- ruby-${{vars.rubyMM}}-dev
- snappy-dev

var-transforms:
- from: ${{package.name}}
match: .*-(\d+\.\d+)
replace: $1
to: fluentdMM
- from: ${{package.name}}
match: ^ruby(\d\.\d+)-.*
replace: $1
to: rubyMM
- from: ${{package.version}}
match: ^(\d+\.\d+\.\d+)\.(\d+\.\d+)
replace: $1-$2
to: mangled-package-version

data:
- name: plugins
items:
azureblob:
cloudwatch:
elasticsearch7:
elasticsearch8:
forward:
gcs:
graylog:
kafka:
kafka2:
kinesis:
logentries:
loggly:
logzio:
opensearch:
papertrail:
s3:
syslog:

pipeline:
- uses: git-checkout
with:
expected-commit: 6183f108748bc4ed980437d6f93cf5f990e33b36
repository: https://github.com/fluent/fluentd-kubernetes-daemonset.git
tag: v${{vars.mangled-package-version}}

subpackages:
- range: plugins
name: ${{package.name}}-${{range.key}}
description: Fluentd kubernetes daemonset for ${{range.key}}
options:
no-depends: true
no-provides: true
dependencies:
runtime:
- ca-certificates
- ruby-${{vars.rubyMM}}
- tini
pipeline:
- working-directory: ./docker-image/v${{vars.fluentdMM}}/debian-${{range.key}}
runs: |
# Install bundle
mkdir -p ${{targets.contextdir}}/fluentd/vendor/bundle
bundle config silence_root_warning true
bundle config set path ${{targets.contextdir}}/fluentd/vendor/bundle
bundle config set clean 'true'
bundle config set deployment 'true'
bundle install --gemfile ./Gemfile --jobs $(nproc)
bundle config unset path
# Link fluentd to path
mkdir -p ${{targets.contextdir}}/usr/bin
ln -s /fluentd/vendor/bundle/ruby/${{vars.rubyMM}}.0/bin/fluentd ${{targets.contextdir}}/usr/bin/fluentd
# Copy gemfile
mkdir -p ${{targets.contextdir}}/fluentd
cp ./Gemfile ${{targets.contextdir}}/fluentd/Gemfile
# Copy configuration
mkdir -p ${{targets.contextdir}}/fluentd/etc
cp -r ./conf/* ${{targets.contextdir}}/fluentd/etc
touch ${{targets.contextdir}}/fluentd/etc/disable.conf
# Create log directory
mkdir -p ${{targets.contextdir}}/fluentd/log
# Copy plugins
mkdir -p ${{targets.contextdir}}/fluentd/plugins
cp -r ./plugins/* ${{targets.contextdir}}/fluentd/plugins
# Copy entrypoint
cp entrypoint.sh ${{targets.contextdir}}/fluentd/entrypoint.sh
test:
environment:
environment:
FLUENTD_CONF: "fluent.conf"
FLUENTD_DISABLE_BUNDLER_INJECTION: 1
GEM_PATH: "/fluentd/vendor/bundle/ruby/${{vars.rubyMM}}.0"
GEM_HOME: "/fluentd/vendor/bundle/ruby/${{vars.rubyMM}}.0"
KUBERNETES_SERVICE_HOST: "127.0.0.1"
KUBERNETES_SERVICE_PORT: 32764
pipeline:
- uses: test/kwok/cluster
# Just make sure the config is okay, kwok doesn't get us very far
- uses: test/daemon-check-output
with:
start: tini -- /fluentd/entrypoint.sh
timeout: 10
expected_output: parsing config file is succeeded

update:
enabled: true
version-transform:
- match: '_'
replace: '.'
github:
identifier: fluent/fluentd-kubernetes-daemonset
strip-prefix: v
tag-filter: v1.17.
use-tag: true
141 changes: 141 additions & 0 deletions ruby3.2-fluentd-kubernetes-daemonset-1.17.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
package:
# fluentd supported versions: https://github.com/fluent/fluentd/blob/master/SECURITY.md
# The kubernetes daemonset trails fluentd releases by a bit
name: ruby3.2-fluentd-kubernetes-daemonset-1.17
version: 1.17.1.1.2
epoch: 0
description: Fluentd ${{vars.fluentdMM}} daemonset for Kubernetes
copyright:
- license: Apache-2.0

environment:
contents:
packages:
- autoconf
- automake
- bash
- build-base
- busybox
- ca-certificates-bundle
- libtool
- m4
- ruby${{vars.rubyMM}}-bundler
- ruby-${{vars.rubyMM}}-dev
- snappy-dev

var-transforms:
- from: ${{package.name}}
match: .*-(\d+\.\d+)
replace: $1
to: fluentdMM
- from: ${{package.name}}
match: ^ruby(\d\.\d+)-.*
replace: $1
to: rubyMM
- from: ${{package.version}}
match: ^(\d+\.\d+\.\d+)\.(\d+\.\d+)
replace: $1-$2
to: mangled-package-version

data:
- name: plugins
items:
azureblob:
cloudwatch:
elasticsearch7:
elasticsearch8:
forward:
gcs:
graylog:
kafka:
kafka2:
kinesis:
logentries:
loggly:
logzio:
opensearch:
papertrail:
s3:
syslog:

pipeline:
- uses: git-checkout
with:
expected-commit: 6183f108748bc4ed980437d6f93cf5f990e33b36
repository: https://github.com/fluent/fluentd-kubernetes-daemonset.git
tag: v${{vars.mangled-package-version}}

subpackages:
- range: plugins
name: ${{package.name}}-${{range.key}}
description: Fluentd kubernetes daemonset for ${{range.key}}
options:
no-depends: true
no-provides: true
dependencies:
runtime:
- ca-certificates
- ruby-${{vars.rubyMM}}
- tini
pipeline:
- working-directory: ./docker-image/v${{vars.fluentdMM}}/debian-${{range.key}}
runs: |
# Install bundle
mkdir -p ${{targets.contextdir}}/fluentd/vendor/bundle
bundle config silence_root_warning true
bundle config set path ${{targets.contextdir}}/fluentd/vendor/bundle
bundle config set clean 'true'
bundle config set deployment 'true'
bundle install --gemfile ./Gemfile --jobs $(nproc)
bundle config unset path
# Link fluentd to path
mkdir -p ${{targets.contextdir}}/usr/bin
ln -s /fluentd/vendor/bundle/ruby/${{vars.rubyMM}}.0/bin/fluentd ${{targets.contextdir}}/usr/bin/fluentd
# Copy gemfile
mkdir -p ${{targets.contextdir}}/fluentd
cp ./Gemfile ${{targets.contextdir}}/fluentd/Gemfile
# Copy configuration
mkdir -p ${{targets.contextdir}}/fluentd/etc
cp -r ./conf/* ${{targets.contextdir}}/fluentd/etc
touch ${{targets.contextdir}}/fluentd/etc/disable.conf
# Create log directory
mkdir -p ${{targets.contextdir}}/fluentd/log
# Copy plugins
mkdir -p ${{targets.contextdir}}/fluentd/plugins
cp -r ./plugins/* ${{targets.contextdir}}/fluentd/plugins
# Copy entrypoint
cp entrypoint.sh ${{targets.contextdir}}/fluentd/entrypoint.sh
test:
environment:
environment:
FLUENTD_CONF: "fluent.conf"
FLUENTD_DISABLE_BUNDLER_INJECTION: 1
GEM_PATH: "/fluentd/vendor/bundle/ruby/${{vars.rubyMM}}.0"
GEM_HOME: "/fluentd/vendor/bundle/ruby/${{vars.rubyMM}}.0"
KUBERNETES_SERVICE_HOST: "127.0.0.1"
KUBERNETES_SERVICE_PORT: 32764
pipeline:
- uses: test/kwok/cluster
# Just make sure the config is okay, kwok doesn't get us very far
- uses: test/daemon-check-output
with:
start: tini -- /fluentd/entrypoint.sh
timeout: 10
expected_output: parsing config file is succeeded

update:
enabled: true
version-transform:
- match: '_'
replace: '.'
github:
identifier: fluent/fluentd-kubernetes-daemonset
strip-prefix: v
tag-filter: v1.17.
use-tag: true
Loading

0 comments on commit 615bfa9

Please sign in to comment.