Collecting Kubernetes logs into OpenSearch: when a central store is worth building
A platform team running many clusters usually needs a central log store once pods are short-lived, logs from one namespace must be searched alongside logs from another, and retention has to follow rules set by security or compliance. The pattern that works is a collector on each node (typically Fluent Bit running as a DaemonSet) that reads container and node logs, forwards them to Data Prepper for parsing and enrichment, and writes the result into OpenSearch. Teams need this when kubectl logs stops being enough: when a pod is rescheduled or deleted before anyone reads its output, when an incident spans several clusters, or when auditors ask how long logs from production namespaces are kept and who can read them.
The three core components are all released under the Apache License, Version 2.0. Kubernetes is Apache 2.0 licensed according to its GitHub repository, Fluent Bit is Apache-2.0 licensed according to its GitHub repository, and all software in the OpenSearch project is Apache 2.0 licensed, with the OpenSearch FAQ describing no paid edition. Licensing does not decide whether the stack is suitable, though. Your cost is the people, infrastructure and support you put behind it, and that cost is what a quote for this work should break down. Before committing, confirm the versions you will run against the current releases pages for each project, because Fluent Bit and OpenSearch both ship new minor versions on a regular cycle and older lines move into maintenance.
Decide early whether the central store is worth the operating burden. Ask whether one team owns logs for all clusters, which namespaces carry regulated data, how long each class of log must be kept, and whether a managed or simpler log tool already meets those needs. A central OpenSearch store makes sense when you need cross-cluster search, consistent retention per namespace, and access controls the security team can review. If your needs are narrow, a smaller setup may be enough. OpenSearch log ingestion documentation describes the collector to Data Prepper to OpenSearch flow that this design follows.
How container and node logs move from pods to OpenSearch
Logs start as container stdout and node-level files on each Kubernetes node, where a Fluent Bit DaemonSet collects them. Fluent Bit forwards them to Data Prepper, which parses and enriches each record before indexing it into OpenSearch data streams, one per namespace. Dashboards reads from the cluster afterward. The trust boundary sits between the cluster and the OpenSearch cluster, so check which credentials cross it, how they are stored as Kubernetes Secrets, and whether the transport is encrypted at both ends.
Log flow from pods and nodes through collection and parsing into OpenSearch.
How Fluent Bit, Data Prepper and OpenSearch divide the work
The documented OpenSearch log ingestion pattern splits the job across three components: a collector such as Fluent Bit runs close to the logs and ships them, Data Prepper parses and enriches them, and OpenSearch stores and searches the structured result. For Kubernetes, the collector normally runs as a DaemonSet so one agent reads container log files on each node. Keeping the collector on the node, rather than in the application pods, means application teams do not change their code to emit logs, and the platform team controls one configuration for the whole cluster.
Fluent Bit suits node-level collection because it is a lightweight agent written in C, its documentation cites a memory footprint of about 450 KB, and it ships more than 100 built-in plugins for inputs, filters and outputs. It also offers native OpenTelemetry (OTLP) ingestion and delivery, which matters if you later move traces or metrics through the same agent. Fluent Bit is licensed under Apache-2.0 and is a CNCF graduated project under the Fluentd umbrella. Confirm the exact Fluent Bit version and plugin set you need against the current release notes before you pin it in your DaemonSet.
Data Prepper sits between the collector and the index. It receives records, applies processors that turn raw lines into fields, such as parsing JSON or extracting Kubernetes metadata, and writes them to OpenSearch with the index or data stream settings you define. Decide early which parsing happens in Fluent Bit filters and which happens in Data Prepper, because each extra hop adds configuration to maintain and a place where a malformed record can stall the pipeline. Ask your team to test a sample of real pod logs through both stages before you commit to the split.
Which collection and parsing options fit which cluster
This table compares the main ways to move Kubernetes container and node logs into OpenSearch, from Fluent Bit writing directly to the cluster to paths with Data Prepper, a buffer or an alternative collector in between. Read each row against your log volume, parsing needs and how many teams depend on the pipeline. Buffering and ingest pipeline design are covered in the centralized logging architecture page.
| Option | What it adds | When it fits | Trade-offs |
|---|---|---|---|
| Fluent Bit direct to OpenSearch | Node-level collection with Kubernetes metadata enrichment and an output plugin that writes straight to the cluster | Small to moderate clusters where logs need little transformation and one team owns the pipeline | Parsing logic lives in Fluent Bit configuration, so changes are harder to review across teams; confirm the output plugin and index settings your version supports |
| Fluent Bit to Data Prepper | Data Prepper transforms logs into structured documents before indexing, separating parsing from collection | Multiple namespaces need different parsing, enrichment or routing rules that should be versioned centrally | Adds a service to size, secure and monitor; confirm the Data Prepper pipeline configuration for your log formats |
| Fluent Bit to a buffer such as Kafka, then Data Prepper | A durable queue between collectors and the indexing tier, so short outages or reindex work do not drop collection | Bursty workloads, many clusters feeding one platform, or a need to replay logs after a failure | Another stateful system with its own capacity, retention and access controls; the centralized logging architecture page covers this path in depth |
| Logstash in front of OpenSearch | A mature pipeline language with a large plugin catalog and existing team skills | Organizations that already run Logstash for syslog or other sources and want one tool for several inputs | Heavier resource use per pipeline than a lightweight collector; confirm the current license and support terms before adopting it |
| OpenTelemetry Collector to OpenSearch | A vendor-neutral collector for logs, metrics and traces with a shared configuration model | Teams standardizing telemetry across applications and Kubernetes, where traces and logs share one agent | Output and mapping support for OpenSearch depends on the component version; confirm field mapping and data stream behavior before committing |
Index or data stream layout per namespace, cluster or team
A per-namespace layout creates one data stream for each Kubernetes namespace, so a namespace such as payments-prod writes to a stream named with that namespace as a fixed part of the name. This maps cleanly to how most clusters already separate ownership, and it lets retention and rollover settings follow the namespace boundary. The cost is that every new namespace adds a stream, and small namespaces may produce many nearly empty backing indices that still need shard and policy management.
- Naming: Decide whether the stream name uses the raw namespace or a team prefix, and who approves new names before a namespace is created.
- Shard and rollover: Confirm whether one shard count and one rollover size suit the busiest namespace and the quietest one, or whether those two need separate templates.
- Dashboards access: Map each namespace to a role and, if teams share Dashboards, to a tenant so that a team sees its own streams and saved objects only.
- Renames: A renamed namespace does not rename existing streams. Plan whether the old stream stays until retention expires, whether the collector config is updated, and how queries that span the rename are written.
- Retention: Ask whether each namespace needs its own lifecycle policy, and who owns the decision when a team asks for a longer period.
Check that your platform team can answer who creates a namespace stream, who retires it, and which policy applies to it in the first week of production.
A per-application layout creates a stream for each workload or service, often keyed by a Kubernetes label such as app.kubernetes.io/name. It gives application owners the most precise view and lets high-volume services get their own sizing and retention, but it multiplies the number of streams quickly in clusters where each team runs many small services. Label values are also less stable than namespaces, since teams change them during refactoring.
- Naming: Define a rule for normalizing label values, including case, separators and version suffixes, so that one service does not split into several streams.
- Shard and rollover: Expect stream counts to grow with service count, and confirm that the cluster has room for the resulting shard totals before the layout is adopted.
- Dashboards access: Role mapping becomes a maintenance task. Decide whether application owners receive roles directly or whether a platform group grants them through a namespace-level rule.
- Renames: Renaming a label creates a new stream and orphans the old one. Ask whether the collector can carry a stable service identifier that survives label changes.
- Retention: Confirm whether low-value services should share a default policy, so that policy work does not scale with every deployment.
Illustrative example: a team that renames checkout-api to checkout-service would start a second stream, and dashboards filtered on the old name would show a gap unless both names are queried.
A shared layout writes logs from many namespaces into a small number of streams and records the namespace, pod, and container as fields on each document. Stream and shard counts stay low and lifecycle policy is written once, which simplifies operations. Isolation then depends on document-level security and field-level controls in the OpenSearch Security plugin, so access rules must be tested against real documents rather than assumed from the index design.
- Naming: Keep stream names generic, such as one per environment or log tier, and standardize the namespace field name across all collectors.
- Shard and rollover: Shared streams concentrate traffic, so confirm that rollover size and shard count handle the noisiest tenant without forcing other teams into its settings.
- Dashboards access: Document-level security rules filter on the namespace field. Test that saved objects, index patterns and shared dashboards do not leak documents from other teams.
- Renames: A renamed namespace changes the field value for new documents only. Old documents keep the previous value, so security rules and queries must match both values or use a stable team identifier added at ingestion.
- Retention: Retention applies to the whole stream, so a team that needs a shorter or longer period may require a separate stream anyway. Confirm this before promising per-team retention.
Confirm with your security team whether document-level filtering satisfies the isolation they expect, and record the test cases that prove it.
How to set up Kubernetes log collection into OpenSearch
This sequence takes a Kubernetes cluster from a verified OpenSearch cluster to a tested log pipeline that writes container and node logs into namespace-aware indices or data streams. Each step ends with a check so the team knows the pipeline is working before it depends on it.
Confirm the OpenSearch cluster and node roles
The platform team confirms that the OpenSearch cluster is healthy and that its node roles match the docs' guidance: dedicated cluster manager nodes, data nodes, and ingest or coordinating nodes where the pipeline needs them. Replicas should sit on separate nodes and shard allocation awareness should be configured for the failure domains in your infrastructure. Confirm the OpenSearch version you will run and its maintenance status on the releases page before you build anything on it. Done when the cluster reports green health, you can reach its HTTPS endpoint from the cluster network, and you have a written list of the endpoints and the version the pipeline will target.
Create a dedicated ingest identity with TLS
The security or platform team creates a separate OpenSearch user for log ingestion, mapped to a role that can write only to the log index patterns and data streams it needs, with no cluster admin rights. Issue TLS certificates for the Data Prepper and client connections, and confirm that the certificates are trusted by the pipeline components. Store the credentials in your secrets system rather than in manifests. Done when a test request authenticated as the ingest user can write a document to the intended index pattern and is refused when it attempts to write to a system index or to read other tenants' data.
Deploy Fluent Bit as a DaemonSet
Deploy Fluent Bit to every node as a DaemonSet so it can read container log files and node-level logs. Configure the tail input for container logs, and add node and system log inputs as your policy requires. Pods should run with the least privileges that allow log file access, and you should review the cluster's Pod Security Standards level before admitting the agent. Done when every node in the cluster has one running collector pod, the collector reports no read errors on the container log path, and log lines from a test workload appear in the collector's local output.
Configure Kubernetes metadata enrichment
Enable the Kubernetes filter in Fluent Bit so each record carries the namespace, pod, container and node names, plus labels you choose to keep. Limit the labels copied into records to the ones used for routing and search, because high-cardinality fields increase index size. Confirm that the filter can reach the API server with a service account scoped to read pod metadata only. Done when a test record from a known pod shows the expected namespace and pod name fields, and a sample from a second namespace shows different values in the same fields.
Define the Data Prepper pipeline
Define a Data Prepper pipeline that receives records from Fluent Bit, parses the message field into structured fields, normalizes timestamps, and writes to OpenSearch using the ingest identity from step two. Use a dead-letter or failure path for records that cannot be parsed so they are kept for review instead of silently discarded. Set pipeline worker and buffer settings from a load test rather than defaults. Done when the pipeline starts without errors, the sink reports successful bulk writes, and the failure path receives a deliberately malformed test record.
Create index templates or data stream policies
Create an index template or data stream template that defines the field mappings for the enriched records, including the namespace field as a keyword, and set the naming convention for namespace-based indices or data streams. Attach a lifecycle policy that sets retention for each class of namespace, reflecting the retention requirements your compliance and security teams have confirmed. Check the OpenSearch documentation for the data stream and lifecycle features in your chosen version. Done when the template is applied to new indices, a sample write creates the expected index or data stream name, and the lifecycle policy shows as attached in the cluster.
Verify with test pods and load
Deploy a small set of test pods in at least two namespaces, have each write known log lines at a steady rate, and then query OpenSearch to confirm that documents appear under the correct namespace and pod fields. Run a short load test at the volume you expect in production and check the pipeline and collector metrics for dropped or retried records. Document the results, including any buffer limits you changed. Done when document counts per namespace match the number of lines the test pods wrote, the collector and pipeline report no dropped records under load, and the failure path is empty or contains only the malformed records you sent on purpose.
Securing the logs and the collection path
The collector holds credentials, reads cluster metadata and ships logs that often contain sensitive data from many namespaces. The controls below cover the cluster that runs the collector, the pipeline that carries logs and the people who read them, so each one should be decided before the first log is shipped.
Encrypt Secrets at rest in etcd
Kubernetes stores Secrets unencrypted in etcd by default. The Fluent Bit and Data Prepper credentials for OpenSearch, including the username and password or client certificate, live in those Secrets, so anyone who can read the etcd data or its backups can read them. Confirm that encryption at rest is enabled for the API server, that etcd backups are encrypted, and decide whether an external store fits your policy.
Secrets good practicesScope RBAC for the collector
Fluent Bit reads pod and namespace metadata to enrich log records, and it needs no write access to the cluster. Bind its service account to a ClusterRole that only grants the read verbs it needs, and avoid giving it list or watch access to Secrets. Review the binding after each Helm chart upgrade, because default manifests may grant broader rights than your enrichment needs.
Apply Pod Security Standards to the DaemonSet
Fluent Bit runs as a DaemonSet that reads container log files from each node's file system, which usually means host path mounts. Those mounts and any privileged settings are the parts a Pod Security Standards level will flag. Decide which level the logging namespace can meet, document any exception for the host mounts, and confirm the choice against your cluster's admission configuration.
Pod Security StandardsLimit namespace reads with OpenSearch roles
Document-level and field-level security in the OpenSearch Security plugin can restrict which users see logs from sensitive namespaces and mask fields such as request bodies or user identifiers. Map each team to roles that match its namespaces, and test the restriction with a non-admin account before go-live. Confirm that the same restrictions apply in Dashboards and through the API.
OpenSearch security docsEncrypt and authenticate the transport
Logs cross the cluster network from each node to Data Prepper and then to OpenSearch, and they can carry credentials or personal data. Enable TLS on node and client traffic, connect the collector through a certificate or account it is allowed to use, and plan certificate rotation before the first expiry. Confirm which identity backend will authenticate people who open Dashboards.
Audit access and confirm against CIS
Turn on OpenSearch audit logging so reads of sensitive indices leave a record, and keep Kubernetes audit logs for changes to the collector's RBAC and Secrets. Then compare the cluster against the relevant CIS Kubernetes Benchmark recommendations, treating the benchmark as a checklist to confirm in your environment rather than a certification. Record which items you accepted as exceptions and why.
CIS Kubernetes BenchmarkRetention, lifecycle and the cost of keeping everything
Retention is a policy decision you make per namespace or data class before the first pipeline ships, and OpenSearch enforces it through index lifecycle management. Set one retention period for application logs, another for platform and ingress logs, and a separate, usually longer, period for audit-relevant events. Each period maps to an index or data stream policy that moves data through hot, warm and delete phases. Confirm the exact lifecycle policy syntax and state names against the version you deploy, because the policy API has changed across releases. Decide early which data streams carry which policy, since changing the mapping later means reindexing or accepting a split history.
Volume is what drives both storage cost and cluster sizing. Every namespace that logs at debug level, every sidecar that writes verbose access records, and every high-cardinality field you index adds disk, heap and shard count. Before you size the cluster, measure daily ingest per namespace for a representative period, multiply by the retention window you chose, and add replica copies and headroom for merges and snapshots. Treat the result as an input to the sizing exercise, not a final number. Ask your team to name the owner of each retention setting, because policies that nobody reviews tend to drift toward keeping everything.
Retention periods must come from your own legal, contractual and operational requirements, not from a default in a tutorial. Your compliance, legal and security teams should confirm how long each class of log must be kept, who may read it, and when it must be deleted, and the platform team should encode those answers in lifecycle policies. DeployOpen does not set these periods for you. Techniques that reduce the bill for data you must keep, such as compression settings, rollups, searchable snapshots and replica choices, are covered on a separate page about reducing OpenSearch log storage cost.
Limits to confirm in your environment
Several version windows and compatibility rules decide how long a Kubernetes log pipeline stays supported. Check each one against your own cluster and OpenSearch deployment before you pick the collector, the pipeline and the index layout.
Kubernetes version support window
The Kubernetes project maintains the three most recent minor releases. As of September 2026, these were 1.37, 1.36 and 1.35, with 1.35 reaching end of life on February 28, 2027. Confirm which minor version your clusters run and when your upgrade lands relative to those dates, because the collector configuration you build now will need to be re-tested after each cluster upgrade.
Kubernetes releasesCollector version skew rules
Kubernetes requires the kube-apiserver to be upgraded one minor version at a time, and kubelets may be up to three minor versions older than the kube-apiserver. Fluent Bit runs on every node as a DaemonSet, so node version differences during a rolling cluster upgrade can change which log paths and metadata fields are present. Plan collector changes as part of the cluster upgrade, not after it.
Version skew policyFluent Bit release line
Fluent Bit v5.1.4 was the latest release as of October 16, 2026, and v5.0.11 was released for the previous line on October 9, 2026. Choose the line your team will patch, confirm that the plugins and parsers you need exist in that line, and check the Kubernetes metadata filter and output settings against the release notes before you pin the image tag.
Fluent Bit releasesOpenSearch version and 3.x features
OpenSearch maintains a version under maintenance until the next major version enters maintenance or one year passes, whichever is longer. During maintenance a version receives bug fixes and security patches but no new features. Confirm which OpenSearch minor you run, and whether your index templates, ISM policies or pipeline features depend on 3.x capabilities that an older version lacks.
OpenSearch releasesData Prepper compatibility
Data Prepper pipelines that parse and enrich Kubernetes logs must match the OpenSearch version they write to. Check the Data Prepper release you deploy against your OpenSearch minor, and test the sink settings, index naming and data stream handling in a staging cluster. A mismatch often shows up only as rejected bulk requests once real volume arrives.
Collectors per tenant
If several teams or tenants share one cluster, decide whether each needs its own collector deployment or whether one collector routes by namespace. Separate collectors isolate configuration and credentials but multiply DaemonSet pods on every node. Confirm with your security team how tenant boundaries map to OpenSearch roles, index patterns and document-level security before you choose.
Questions teams ask before collecting Kubernetes logs
What does a Kubernetes log collection project cost, and what drives the effort?
The cost depends on the scope agreed in writing, and that scope is shaped by a few variables: the number of clusters, the daily log volume, how much parsing and enrichment each log source needs, who can search which namespaces, and how long each class of logs must be kept. Each of these adds design, testing and documentation work. Costs fall into two groups. One-time work covers collection design, Fluent Bit and Data Prepper configuration, index or data stream templates, access roles and verification. Recurring work covers upgrades of Fluent Bit, Data Prepper and OpenSearch, retention changes and the storage you pay for on your own infrastructure. Ask any provider for a quote that lists these items separately, and ask what is excluded, such as new clusters added later.
How long does a first Kubernetes logging pipeline take to set up?
The timeline depends on how many clusters feed the cluster, how many distinct log formats need parsing, how quickly your team can grant access to node and namespace logs, and whether the OpenSearch cluster already exists with enough capacity. A single cluster with standard container output usually moves faster than a multi-cluster estate with custom application formats. Ask for a plan that sequences the work: a pilot namespace first, then parsing rules, then index layout and retention, then access roles and dashboards. Confirm the schedule against your change calendar, since production cutovers often wait for approval.
What does our team need to provide before the work starts?
Three inputs are needed before design begins. The first is access to the Kubernetes clusters, including permission to deploy Fluent Bit as a DaemonSet and read pod and node logs in the environments in scope. The second is OpenSearch capacity: a running cluster with agreed node roles, storage and TLS, so the pipeline has a stable target. The third is decisions your organization must own: identity and role mapping for who can read each namespace, the retention period for each log class, and which fields may be masked or excluded for privacy. Name an owner for each decision, because delays usually come from unassigned choices rather than from technical work.
Can an internal platform team run Kubernetes log collection on its own?
Yes, a platform team with Kubernetes and OpenSearch experience can build and run this pipeline without an outside partner. Fluent Bit and Data Prepper are open source under Apache 2.0, and the documentation covers installation and configuration. The harder parts are usually the parsing rules for each application, the index and retention design, and access control that matches your identity model. Teams that choose to do it themselves should budget time for testing with real log volume and for runbooks covering failure modes such as backpressure and disk pressure on OpenSearch. A partner is most useful when the team lacks spare capacity or needs an outside review of the design.
Do we need a paid OpenSearch edition for centralized Kubernetes logs?
No paid edition is needed for this work. The OpenSearch FAQ describes all software in the project as released under the Apache License, Version 2.0, and it does not describe a paid edition. Fluent Bit is also licensed under Apache-2.0 and Kubernetes is under Apache 2.0. Your costs will come from infrastructure, storage, staff time and any services you buy, not from a license fee for the core software. Confirm the current licensing terms in the OpenSearch FAQ before you finalize procurement, and check the license of any plugin or connector you add.
How does the log collection setup change after OpenSearch or Kubernetes upgrades?
Upgrades affect three components: the Kubernetes cluster, the Fluent Bit agents and the OpenSearch cluster with Data Prepper. Kubernetes requires the control plane to move one minor version at a time, and the kubelets on nodes may trail the API server by a limited number of minor versions, so the log agents must be retested on each node pool after an upgrade. OpenSearch versions stay in maintenance for a defined period and receive security patches during that time, so plan minor and major upgrades before a version leaves maintenance. Fluent Bit releases are frequent, so pin versions and test configuration changes in a non-production cluster. Ask any provider how they will verify ingestion, parsing and access roles after each upgrade.
How should we decide retention and index layout per namespace?
Start from the rules that apply to each log class, not from storage size. Some logs must be kept for audit reasons, while debug output may only be useful for days. Map each namespace or application group to a data stream or index pattern, then set retention for each pattern with index state management, so old data is removed on a schedule. Keep the number of indices reasonable, because very small indices per namespace add overhead. Check retention requirements with your compliance and legal owners before you configure deletion, since deleted logs cannot be recovered from the pipeline. Tell the engineers which namespace belongs to which pattern so alerts and dashboards stay correct after growth.
How DeployOpen scopes and delivers Kubernetes log collection
DeployOpen plans, builds, tests, documents and supports Kubernetes log collection into self-hosted OpenSearch inside your own clusters and cloud accounts. Each engagement starts with a written scope covering collection, parsing, index layout and retention, so your platform, security and compliance teams can review the design before anything is built.
How we scope
- Inventory clusters, namespaces, log sources and the teams that will search and alert on them.
- Agree which Fluent Bit and Data Prepper pipelines, data stream layouts and retention rules are in the written scope.
- Confirm the OpenSearch version, hosting model and access requirements, including SSO and role mapping, before build starts.
How we build
- Deploy Fluent Bit as a DaemonSet with parsing, filtering and namespace metadata enrichment configured for your clusters.
- Configure Data Prepper pipelines that transform and index logs into per-namespace or per-service data streams.
- Test log loss, backpressure, timestamp accuracy and index template behavior against realistic volumes in a non-production cluster first.
How we hand over
- Document pipeline configuration, index naming, role mappings, retention settings and the steps to add a new namespace.
- Walk your platform and security teams through the design, test results and known limits before cutover.
- Deliver configuration in a form your team can version and review, with runbooks for common collection failures.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover.
- Plan upgrades for Fluent Bit, Data Prepper and OpenSearch against the release cadence each project publishes.
- Re-test collection after cluster upgrades or new workloads so log coverage does not drift unnoticed.

