fluent-plugin-containiq
Fluentd output plugin that pushes logs to ContainIQ.
fluent-plugin-containiq on RubyGems.org
Getting Started
$ gem install fluent-plugin-containiq
<match>
@type containiq
<buffer>
@type file
path /var/log/fluent/example
</buffer>
</match>
Publish a new version
Manually bump the spec.version
in fluent-plugin-containiq.gemspec
. This will trigger a Github action to:
- Publish a new version to RubyGems.org
- Push a new latest image to containiq/logging-agent-dev
- Create a draft Repository Release
- Once that draft is published, another Github action is trigger to:
- Push a new tagged and latest image to containiq/logging-agent-dev
- Push a new tagged and latest image to containiq/logging-agent
Local Development
Steps to work on the plugin locally:
- Comment out the
fluent-plugin-containiq
gem fromk8s/Gemfile
- Build the plugin from source:
bundle exec rake build
- Uncomment the local build in
Dockerfile
and copy the build path to theCONTAINIQ_PLUGIN_LOCAL_PACKAGE
variable - Build the image:
docker image build . -t containiq/logging-agent-dev
- In
k8s/fluentd-daemonset.yaml
, setimage: containiq/logging-agent-dev
andimagePullPolicy: Never
- Run the fluentd daemonset:
kubectl apply -f k8s/fluentd-daemonset.yaml
- Run a container in any namespace that spits out logs. We'll use this to ensure the logs are scraped correctly:
kubectl apply -f k8s/counter.yaml
- Verify everything is working in the fluentd logs:
kubectl logs -n containiq -f $(kubectl get pod -l name=fluentd -o jsonpath='{.items[0].metadata.name}')
Bundler
Add following line to your Gemfile:
gem "fluent-plugin-containiq"
And then execute:
$ gem update bundler
$ bundle
Run unit tests:
bundle exec rake test
Configuration
You can generate configuration template:
$ fluent-plugin-config-format output containiq