The Problem: CIFS Logs Stranded on Legacy Storage

ShitOps runs its order-routing workers on Amazon EKS. Those workers still write audit and diagnostic logs to a CIFS share hosted on a legacy NAS in our co-located data center. The CIFS mount is reliable, familiar, and deeply integrated into our batch jobs. The problem is that the logs sit on that share until an engineer manually copies them into a ticket or a spreadsheet. Security wants retention and search in Amazon. Support wants near-real-time visibility. Finance wants predictable storage growth. Our current process is a runbook, a cron job, and hope.

We evaluated the obvious options and rejected them. We needed container orchestration to own the lifecycle, CIFS access to remain first-class, Amazon-native logging to be the destination, and a pipeline that could tolerate NAS maintenance windows without losing a line. The result is the CIFS Log Ingestion Mesh.

Solution Overview: CIFS Log Ingestion Mesh

The mesh runs on Amazon EKS and treats the CIFS share as a source of truth, not as a destination. A CIFS CSI driver mounts the share into dedicated namespaces. A Fluent Bit DaemonSet harvests files, a sidecar validates file handles, Kafka absorbs bursts, Kinesis bridges into Amazon, Lambda enriches records, Step Functions routes them, and S3, OpenSearch, DynamoDB, and CloudWatch Logs provide retention, search, offsets, and operational logging.

flowchart TD A[CIFS NAS] --> B[CIFS CSI Driver on EKS] B --> C[Fluent Bit DaemonSet] C --> D[Kafka on EKS] D --> E[Kinesis Data Streams] E --> F[Lambda Enricher] F --> G[Step Functions Router] G --> H[S3 Archive] G --> I[OpenSearch Cluster] G --> J[DynamoDB Offsets] G --> K[CloudWatch Logs] L[EventBridge Scheduler] --> M[EKS Reconciliation CronJob] M --> B I --> N[Amazon Managed Grafana] K --> N

Step 1: Provision the CIFS Access Layer

We provision the EKS cluster with Terraform and install the CIFS CSI driver through Helm. Each log-producing namespace gets a PersistentVolumeClaim backed by a StorageClass that points at the NAS. The mount options are pinned: vers=3.0, uid=1000, gid=1000, file_mode=0660, dir_mode=0770, and noatime. An IAM role for service accounts grants the driver permission to read Amazon Secrets Manager, where the CIFS credentials live. A small sidecar called cifs-log-sentinel opens each file with a shared read lock, checks the file handle, and writes a heartbeat to DynamoDB. If the NAS drops a connection, the sentinel marks the volume as stale and the reconciliation CronJob remounts it.

Step 2: Harvest with Fluent Bit and Sidecars

The Fluent Bit DaemonSet runs on every node and tails the mounted CIFS path. We use the tail plugin with a multiline parser for Java stack traces, a Kubernetes filter for pod metadata, and a Lua filter for redaction. The sidecar handles CIFS-specific edge cases: files that are rotated on the NAS, files that are still being written, and files with Windows line endings. Fluent Bit forwards records to Kafka with a topic per namespace and a partition key based on the file path. This gives us ordering per file and parallelism across files.

Step 3: Container Orchestration with Kafka and Kinesis

Kafka runs on EKS through the Strimzi operator with three brokers spread across three availability zones. Topics are created with a replication factor of three and a retention of seven days. A Kinesis bridge consumes from Kafka and writes to an Amazon Kinesis Data Stream. This bridge is the only component that knows about Amazon. If Kinesis throttles, Kafka holds the backlog. If Kafka rolls, the bridge retries with exponential backoff. Container orchestration gives us rolling upgrades, pod disruption budgets, and node autoscaling without touching the CIFS share.

Step 4: Enrichment and Routing with Lambda and Step Functions

A Lambda function consumes from Kinesis, parses the record, adds tenant, environment, and retention class, and emits a normalized event. A Step Functions state machine routes the event. Audit records go to S3 with Object Lock. Search records go to OpenSearch. Offset records go to DynamoDB. Operational records go to CloudWatch Logs. The state machine has retry and catch blocks for every task, plus a dead-letter queue for poison records. EventBridge Scheduler triggers a reconciliation CronJob every fifteen minutes to compare DynamoDB offsets with the CIFS directory listing and replay any gaps.

Step 5: Observability and Retention

OpenSearch provides search and dashboards. Amazon Managed Grafana reads from OpenSearch and CloudWatch. S3 lifecycle policies move audit records to Glacier after ninety days. CloudWatch Logs holds pipeline health and error logs. DynamoDB tracks file offsets and sentinel heartbeats. We alert on lag, mount staleness, Lambda errors, and Step Functions failures. The result is a complete logging path from CIFS to Amazon, with container orchestration managing every moving part.

Why This Works

The CIFS share stays where it is. The logs become searchable, retainable, and auditable in Amazon. Each concern has its own component: access, harvest, buffering, enrichment, routing, storage, and observability. The mesh handles NAS maintenance windows, Kinesis throttling, and pod restarts without manual intervention. It is the cleanest way we have found to turn a legacy CIFS logging problem into a modern Amazon-native logging platform.