Sitemap

Member-only story

The fan-out fan-in pattern in K8s.

This pattern enables the workflow to distribute tasks widely, execute them concurrently, and then consolidate the results.

Alex
4 min readJun 1, 2025
Fan-out fan-in image generated with DALL-E

The fan-out/fan-in pattern in Kubernetes (K8s) is not directly documented in the provided context, but it can be inferred from similar patterns in other systems. This pattern involves distributing tasks across multiple pods or services (fan-out) and then aggregating their results (fan-in). It is used for efficient parallel processing and can be applied in scenarios such as data processing pipelines, web scraping, and real-time data processing.

fan-out fan-in pattern

The fan-out/fan-in pattern in Kubernetes is commonly implemented using a Job (or a parent controller, such as a CronJob or custom controller) that creates multiple child Jobs or Pods to process tasks in parallel (fan-out), and then aggregates the results (fan-in) when all child tasks are complete.

Below is a Kubernetes Job example that demonstrates the fan-out/fan-in pattern using an init container to generate work items, a main container to process them in parallel, and a simple aggregation step. For more advanced scenarios…

--

--

Alex
Alex

Written by Alex

DevOps Lead @evinova, former Dynatrace Solutions Engineer. Cheerleader in Chief for KMMX, Technical Writer & International Speaker, Dad & 2 cats.

No responses yet