Logging operator
Welcome to the Logging operator documentation!
Overview
The Logging operator solves your logging-related problems in Kubernetes environments by automating the deployment and configuration of a Kubernetes logging pipeline.
- The operator deploys and configures a log collector (currently a Fluent Bit DaemonSet) on every node to collect container and application logs from the node file system.
- Fluent Bit queries the Kubernetes API and enriches the logs with metadata about the pods, and transfers both the logs and the metadata to a log forwarder instance.
- The log forwarder instance receives, filters, and transforms the incoming logs, and transfers them to one or more destination outputs. The Logging operator supports Fluentd and syslog-ng (via the AxoSyslog syslog-ng distribution) as log forwarders.
Your logs are always transferred on authenticated and encrypted channels.
This operator helps you bundle logging information with your applications: you can describe the behavior of your application in its charts, the Logging operator does the rest.
Feature highlights
- Namespace isolation
- Native Kubernetes label selectors
- Secure communication (TLS)
- Configuration validation
- Multiple flow support (multiply logs for different transformations)
- Multiple output support (store the same logs in multiple storage: S3, GCS, ES, Loki and more…)
- Multiple logging system support (multiple Fluentd, Fluent Bit deployment on the same cluster)
- Support for both syslog-ng and Fluentd as the central log routing component
Architecture
The Logging operator manages the log collectors and log forwarders of your logging infrastructure, and the routing rules that specify where you want to send your different log messages.
The log collectors are endpoint agents that collect the logs of your Kubernetes nodes and send them to the log forwarders. Logging operator currently uses Fluent Bit as log collector agents.
The log forwarder (also called log aggregator) instance receives, filters, and transforms the incoming logs, and transfers them to one or more destination outputs. The Logging operator supports Fluentd and syslog-ng as log forwarders. Which log forwarder is best for you depends on your logging requirements. For tips, see Which log forwarder to use.
You can filter and process the incoming log messages using the flow custom resource of the log forwarder to route them to the appropriate output. The outputs are the destinations where you want to send your log messages, for example, Elasticsearch, or an Amazon S3 bucket. You can also define cluster-wide outputs and flows, for example, to use a centralized output that namespaced users can reference but cannot modify. Note that flows and outputs are specific to the type of log forwarder you use (Fluentd or syslog-ng).
You can configure the Logging operator using the following Custom Resource Definitions.
- logging - The
logging
resource defines the logging infrastructure (the log collectors and forwarders) for your cluster that collects and transports your log messages. It can also contain configurations for Fluent Bit, Fluentd, and syslog-ng. (Starting with Logging operator version 4.5, you can also configure Fluent Bit, Fluentd, and syslog-ng as separate resources.) - CRDs for Fluentd:
- output - Defines a Fluentd Output for a logging flow, where the log messages are sent using Fluentd. This is a namespaced resource. See also
clusteroutput
. To configure syslog-ng outputs, seeSyslogNGOutput
. - flow - Defines a Fluentd logging flow using
filters
andoutputs
. Basically, the flow routes the selected log messages to the specified outputs. This is a namespaced resource. See alsoclusterflow
. To configure syslog-ng flows, seeSyslogNGFlow
. - clusteroutput - Defines a Fluentd output that is available from all flows and clusterflows. The operator evaluates clusteroutputs in the
controlNamespace
only unlessallowClusterResourcesFromAllNamespaces
is set to true. - clusterflow - Defines a Fluentd logging flow that collects logs from all namespaces by default. The operator evaluates clusterflows in the
controlNamespace
only unlessallowClusterResourcesFromAllNamespaces
is set to true. To configure syslog-ng clusterflows, seeSyslogNGClusterFlow
.
- output - Defines a Fluentd Output for a logging flow, where the log messages are sent using Fluentd. This is a namespaced resource. See also
- CRDs for syslog-ng (these resources like their Fluentd counterparts, but are tailored to features available via syslog-ng):
- SyslogNGOutput - Defines a syslog-ng Output for a logging flow, where the log messages are sent using syslog-ng. This is a namespaced resource. See also
SyslogNGClusterOutput
. To configure Fluentd outputs, seeoutput
. - SyslogNGFlow - Defines a syslog-ng logging flow using
filters
andoutputs
. Basically, the flow routes the selected log messages to the specified outputs. This is a namespaced resource. See alsoSyslogNGClusterFlow
. To configure Fluentd flows, seeflow
. - SyslogNGClusterOutput - Defines a syslog-ng output that is available from all flows and clusterflows. The operator evaluates clusteroutputs in the
controlNamespace
only unlessallowClusterResourcesFromAllNamespaces
is set to true. - SyslogNGClusterFlow - Defines a syslog-ng logging flow that collects logs from all namespaces by default. The operator evaluates clusterflows in the
controlNamespace
only unlessallowClusterResourcesFromAllNamespaces
is set to true. To configure Fluentd clusterflows, seeclusterflow
.
- SyslogNGOutput - Defines a syslog-ng Output for a logging flow, where the log messages are sent using syslog-ng. This is a namespaced resource. See also
For the detailed CRD documentation, see List of CRDs.
Quickstart
See our Quickstart guides.
Support
If you encounter problems while using the Logging operator the documentation does not address, open an issue or talk to us on Discord or on the CNCF Slack.
For the list of companies that offer commercial support, see Commercial support for the Logging operator.