Skip to main content

LogAdapter

The LogAdapter custom resource simplifies the configuration of log shipping for a range of Kubernetes distributions. It builds on the Banzai Cloud logging operator to do this.

It currently supports the following distributions

  • rke
  • rke2
  • k3s
  • aks
  • eks
  • gke

example.yaml

apiVersion: opni.io/v1beta1
kind: LogAdapter
metadata:
name: example-adapter
spec:
provider: rke
opniCluster:
name: example-cluster
namespace: opni

Custom Resource Specs

LogAdapterSpec

FieldRequiredTypeDescription
providerYesstringOne of the supported distributions
opniClusterNoOpniClusterNameSpecA reference to an installed OpniCluster. If this is not present Opni will assume logs are being shipped to a central Opni system
containerLogDirNostringPath to the container logs on the host. Defaults to /var/lib/docker/containers
seLinuxEnabledNoboolEnable SELinux support. Defaults to false
rootFluentConfigNoFluentConfigSpecFluentd and Fluentbit config for the base conatiner log shipping. If this is absent it it creates default Banzaicloud configs, with a liveness probe for fluentd, and uses the Rancher logging images
fluentConfigNoFluentConfigSpecFluent config for additional Logging object for K3S and cloud providers. Defaults as per rootFluentConfig, along with additional sane default file locations for the specific distribution
aksNoAKSSpecAKS config; should be empty
eksNoEKSSpecEKS config; should be empty
gkeNoGKESpecGKE config; should be empty
rkeNoRKESpecRKE specific config
k3sNoK3SSpecK3s specific config
rke2NoRKE2SpecRKE2 specific config

N.B. If a distribution spec is set it must match the provider field

OpniClusterNameSpec

FieldRequiredTypeDescription
nameYesstringName of the opnicluster to link the LogAdapter to
namespaceNostringName of the namespace the opnicluster is in. Defaults to default

FluentConfigSpec

FieldRequiredTypeDescription
fluentbitNoFluentbitSpecUses Banzaicloud defaults with the image spec set to the Rancher logging images
fluentdNoFluentdSpecUses Banzaicloud defaults with the image spec set to the Rancher logging images, and a liveness probe configured

RKESpec

FieldRequiredTypeDescription
logLevelNostringLog level for the fluentbit aggregator. Defaults to info

K3SSpec

FieldRequiredTypeDescription
containerEngineNostringMust be either systemd or openrc. Defaults to systemd
logPathNostringFor systemd this is the path to the journalctl log location. Defaults to /var/log/journal. For openrc this is the path to the service log file. Defaults to /var/log/k3s.log

RKE2Spec

FieldRequiredTypeDescription
logPathNostringThis is the path to the journalctl log location. Defaults to /var/log/journal