Set Your Developers Free: Fleet Management at Spotify - Stefan Särne, Spotify

Stefan Särne, Spotify

KubeCon + CloudNativeCon Europe 2025 · Session

Overview

In this KubeCon EU talk, Stefan Särne from Spotify delves into the critical evolution of fleet management within their vast microservices ecosystem. The presentation highlights how Spotify transformed its approach to managing thousands of backend services and data pipelines, moving from a reactive, manual, and often chaotic process to a highly automated, proactive, and "fleet-first" methodology. Särne uses the infamous Log4j incident as a pivotal case study, illustrating the immense challenges faced by large organizations in patching critical vulnerabilities at scale, and how this crisis spurred a fundamental shift in their operational strategy.

Watch on YouTube

Visual summary for Set Your Developers Free: Fleet Management at Spotify - Stefan Särne, Spotify by Stefan Särne, Spotify
Visual summary for Set Your Developers Free: Fleet Management at Spotify - Stefan Särne, Spotify by Stefan Särne, Spotify

Key moments

  1. 0:00 Introduction and the pivotal Log4j incident
  2. 2:00 The daunting, manual process of updating thousands of services
  3. 4:39 Post-mortem: Realizing the need for proactive automation
  4. 6:00 Implementing 'Fleet Shift' for automated, fleet-wide changes
  5. 6:30 Streamlined incident response with fleet shift automation

Set Your Developers Free: Fleet Management at Spotify

Speakers: Stefan Särne, Spotify

Conference: KubeCon EU

YouTube: https://www.youtube.com/watch?v=Zr7y27HpII4

Overview

In this KubeCon EU talk, Stefan Särne from Spotify delves into the critical evolution of fleet management within their vast microservices ecosystem. The presentation highlights how Spotify transformed its approach to managing thousands of backend services and data pipelines, moving from a reactive, manual, and often chaotic process to a highly automated, proactive, and "fleet-first" methodology. Särne uses the infamous Log4j incident as a pivotal case study, illustrating the immense challenges faced by large organizations in patching critical vulnerabilities at scale, and how this crisis spurred a fundamental shift in their operational strategy.

The talk is a compelling narrative on the necessity of robust platform engineering in an environment where software grows exponentially faster than the engineering headcount. Spotify's journey underscores the strategic importance of standardization, automation, and a cultural realignment to maintain developer velocity, enhance security posture, and free engineers to focus on feature development rather than repetitive maintenance tasks. This deep dive into Spotify's fleet management paradigm offers invaluable insights for any organization grappling with the complexities of operating a large, distributed software fleet.

Background

▶ Watch: Introduction and the pivotal Log4j incident (0:00)

Spotify operates a massive and complex software landscape, characterized by a microservices architecture that supports hundreds of millions of users globally. At the core of this architecture are approximately 700 independent engineering teams, each typically owning one to three systems. These systems, in turn, comprise numerous components, services, and websites, leading to an astonishing catalog of around 200,000 software entities. This distributed ownership model, while fostering autonomy, presents significant challenges when widespread changes or urgent security patches are required.

The catalyst for Spotify's intensified focus on fleet management was the Log4j incident in late 2021. Särne vividly recounts the initial, hypothetical response to this zero-day vulnerability. Upon discovering the ability for remote code execution in their Java backend services, the immediate questions were: "Is this a problem for us?" and "What is the scope?" It quickly became apparent that despite not directly using Log4j in some primary applications, many underlying libraries and frameworks, including their Scala-based data processing framework Shio, were vulnerable. The scale of the problem was daunting: 4,667 backend services and 1,955 data pipelines were potentially affected.

The initial response involved a manual, high-stress "war room" scenario. A large team was assembled, public communication channels were established, and engineers were paged and emailed to manually update a single line in their dependency management. Even with this Herculean effort, a "long tail" of unpatched services persisted due to various issues: owners being off-call, emails going unread, or teams no longer existing. This manual approach was time-consuming, disruptive, and prone to human error, ultimately taking 11 hours to patch 80% of components and two full days to reach 99%. This incident served as a stark reminder of the limitations of a component-first mindset and the urgent need for automation and a more proactive, fleet-first strategy. Prior to this, even a standard migration, such as upgrading Java from version 9 to 11, could take as long as 10 months when approached component by component. The engineering leadership recognized that the software fleet was growing significantly faster than their engineering headcount, with the number of lines of code owned by each engineer doubling in just two years, necessitating a strategic investment in fleet management.

Key Findings

▶ Watch: The daunting, manual process of updating thousands of services (2:00)

Spotify's journey into comprehensive fleet management yielded several key findings and strategic shifts, fundamentally altering how they operate and secure their extensive software ecosystem:

  1. The Imperative of Automation (Fleet Shift): The Log4j incident starkly demonstrated that manual processes could not cope with the scale and urgency of fleet-wide changes. Spotify's primary innovation, Fleet Shift, emerged as an automated system designed to apply changes across the entire software fleet. This system transforms the daunting task of updating thousands of components into a manageable, programmatic operation, drastically reducing the time and human effort required for critical updates and migrations.
  1. Standardization through Golden Tech: To enable widespread automation, Spotify realized the necessity of standardizing its technology stack. The concept of Golden Technologies was introduced, identifying a blessed set of technologies that simplify software building for engineers and, crucially, unlock the ability to perform fleet-wide management. This standardization effort streamlines maintenance, reduces complexity, and ensures that platform teams can efficiently make changes across diverse services.
  1. Automated Merging and Deployment with Guardrails: Beyond just creating changes, Spotify integrated Fleet Shift with their continuous integration and deployment (CI/CD) pipelines. The Auto Merger system automatically reviews and merges PRs generated by Fleet Shift, provided all tests pass. This is coupled with a robust deployment system that rolls out changes cohort by cohort, incorporating guardrails to monitor for issues and alert the fleet management team if anomalies are detected, preventing widespread outages.
  1. Cultural Transformation and Developer Empowerment: A significant finding was the need for a cultural shift among developers. Initially, receiving automated PRs for review was seen as tedious. However, by demonstrating the reliability and safety of the automated process, developers were trained to trust and even ignore these routine PRs, freeing them to focus on more impactful feature engineering. This shift is quantified by a growing 3:1 ratio of bot-generated PRs to human-generated PRs, with bots handling the "boring" work.
  1. Quantifiable Efficiency and Velocity Gains: The impact of fleet management is measured in tangible benefits. The time required for common migrations has plummeted from 10 months to 1-2 weeks for 70% completion. More impressively, Spotify calculated that by the end of 2024, their fleet management efforts would have saved the equivalent of 355 full-time engineers worth of work in a single year. This translates directly into accelerated feature delivery and increased developer satisfaction.
  1. Expanding Scope of Change Makers: While initially driven by platform teams, the capabilities of fleet management are now being leveraged by other internal teams. The integration with code search allows feature platforms and other organizational units to define and apply their own fleet-wide changes, from API updates to code cleanups, further democratizing the power of large-scale automation.

Technical Deep Dive

▶ Watch: Post-mortem: Realizing the need for proactive automation (4:39)

Spotify's fleet management system, centered around the Fleet Shift mechanism, is a sophisticated orchestration of automation tools and cultural practices designed to manage their vast poly-repo microservices architecture.

At its core, a Fleet Shift is initiated by an author who defines a desired change. This change can target specific repositories, leverage predefined datasets, or dynamically identify components using Spotify's internal code search system. For instance, in a Log4j scenario, a Fleet Shift could target all services written in Java that contain a specific vulnerable version like log4j 1.4.12. For monorepos, where components are identified by paths within a single repository, the system can target changes based on component types and their respective paths.

Once a target and change are defined, the Fleet Shift service springs into action. It simulates the actions a human engineer would take:

  1. Kubernetes Jobs: For each targeted repository, the system spins up a dedicated Kubernetes job.
  2. Repo Cloning and Setup: Each job clones the respective repository and sets up the necessary environment.
  3. Docker Container for Transformation: A Docker container is launched within the Kubernetes job. This container executes the actual code or text transformation. For simple changes, this might involve a regular expression-based search and replace. For dependency updates, Spotify leverages a Bill of Materials (BOM), which acts as a centralized dependency manifest. This BOM enables a more or less single-version policy across their poly-repo environment, simplifying updates by modifying a single BOM version that propagates to all dependent services.
  4. Pushing Changes: After the transformation, the changes are committed to a new branch within the repository and pushed to GitHub.
  5. Pull Request Creation: Fleet Shift then automatically creates a Pull Request (PR) for each modified repository, making the change visible to the owning team.

However, simply creating PRs isn't enough for true automation. The success of Fleet Shift hinges on the readiness of the fleet. Spotify's approach to readiness focuses on several pillars:

  • Robust Testing: Every component must have comprehensive tests with decent coverage, and these tests must consistently pass. The goal is to maintain a "releasable main" branch at all times, ensuring that any automated change can be validated.
  • Monitoring and Alerting: Critical for detecting regressions. Each service needs proper monitoring and alerting configured so that any issues arising from an automated deployment are immediately flagged.
  • Standardized Technologies (Golden Tech): This is a cornerstone. Spotify distinguishes between "green" technologies (anything currently in use) and "golden" technologies (blessed, standardized choices). By encouraging teams to adopt Golden Tech, the platform team can efficiently develop and apply changes across a homogeneous environment. This simplifies tooling and enables the platform to "maintain all these components for free" by automating updates and migrations to the latest blessed versions. For example, they use fleet management to migrate services to Golden Tech standards.

The automated workflow then proceeds:

  1. A PR generated by Fleet Shift is created on GitHub.
  2. CI Runs: The continuous integration pipeline is triggered, running all tests against the proposed change.
  3. Auto Merger: If the CI checks pass, the Auto Merger service automatically merges the PR into the main branch. This is a critical step, as it bypasses manual human review for routine, verified changes.
  4. Continuous Deployment: Once merged, the deployment system automatically takes over, deploying the updated service.
  5. Guardrails: To prevent wide-scale issues, deployments are rolled out cohort by cohort. A separate service monitors key metrics and guardrails during deployment. If any issues or "out of the ordinary" behavior are detected, the rollout is paused, and the fleet management team is alerted.

Spotify's fleet management capabilities extend beyond simple dependency updates. They categorize changes into several types:

  • Simple Text/Regex Changes: Used for dependency updates (via BOM), configuration changes (e.g., optimizing Bigtable cluster configurations to save costs by reducing minimal nodes and adjusting scalability), and other straightforward modifications.
  • Code Transforms: More complex changes that modify source code. This includes updating or deprecating APIs, and even handling breaking version updates by automatically refactoring code.
  • Code Cleanups: Identifying and applying consistent code style or removing deprecated patterns across the fleet.

Looking ahead, Spotify is exploring the integration of AI and Large Language Models (LLMs) into Fleet Shift. The vision is to leverage LLMs to perform even more complex code migrations and refactorings that have previously been too challenging to automate. While acknowledging that human review might still be necessary, even achieving 90% automation for complex changes represents a significant win, further freeing engineers and accelerating technological evolution across the fleet.

Demo / Proof of Concept

▶ Watch: Implementing 'Fleet Shift' for automated, fleet-wide changes (6:00)

While Stefan Särne's talk does not feature a live, interactive demonstration of the Fleet Shift system, it effectively serves as a retrospective "proof of concept" by detailing two distinct scenarios: the initial, manual handling of the Log4j incident and the subsequent, improved response leveraging the nascent fleet management capabilities.

The talk uses the Log4j incident as its central narrative, contrasting the hypothetical initial chaotic response with the "slightly more prepared" second scenario where some automation was in place. In the improved scenario, the fleet management team was able to prepare the change as a fleet shift, applying it across all services and data pipelines. While still requiring a team (up to 50 people) to coordinate, the core difference was the ability to automerge and continuously deploy the fix. This significantly accelerated the patching process: 80% of all components were updated, deployed, and running in production without incidents after just 11 hours. Within two days, 99% of the fleet was patched, a dramatic improvement over purely manual methods.

Further evidence of the system's efficacy is presented through quantitative metrics:

  • Migration Time Reduction: A graph illustrating a drastic reduction in the time it takes to complete 70% of migrations. What once took 10 months for a Java version upgrade (e.g., Java 9 to 11) now typically takes only one to two weeks as of 2021. This demonstrates the system's ability to rapidly roll out new features and updates to developers.
  • Bot vs. Human PRs: A comparison showing a significant increase in bot-generated Pull Requests. While human-generated PRs are slowly increasing, bot-generated PRs are growing much faster, reaching a 3:1 ratio of bot-to-human PRs. This signifies that automation is handling a vast majority of the routine, "boring" changes, allowing humans to focus on more complex and interesting work.
  • Engineer Time Saved: Spotify quantifies the impact by estimating that the fleet management efforts saved the equivalent of 355 full-time engineers worth of work in 2024 alone. This calculation is based on assigning an estimated time (30 minutes for trivial PRs, up to 2 hours for more complex ones) to each automated change that would otherwise require manual intervention.

These metrics and the narrative of the Log4j incident serve as a compelling demonstration of the system's power and its real-world impact on Spotify's operational efficiency, security posture, and developer productivity.

Defensive Implications

▶ Watch: Streamlined incident response with fleet shift automation (6:30)

The insights shared by Stefan Särne on Spotify's fleet management strategy carry profound defensive implications for any organization operating at scale, particularly in the face of rapidly evolving cyber threats.

  1. Accelerated Vulnerability Patching (Reduced MTTR): The most immediate and critical defensive benefit is the ability to rapidly patch zero-day vulnerabilities and other critical security flaws. The Log4j incident highlighted that even with a dedicated incident response team, manual patching of thousands of services is prohibitively slow. Fleet Shift reduces the Mean Time To Respond (MTTR) for such incidents from days or weeks to hours, significantly narrowing the window of exposure for critical vulnerabilities. This proactive capability is paramount in mitigating the impact of widespread security events.
  1. Proactive Security Posture Management: Fleet management allows security teams to enforce best practices and security policies across the entire fleet proactively. This includes automatically updating vulnerable dependencies, applying security hardening configurations, migrating to more secure versions of libraries or frameworks, and rolling out security agent updates. Instead of relying on individual teams to keep up with security recommendations, the platform can ensure consistent security baselines.
  1. Standardization and Attack Surface Reduction: The emphasis on Golden Technologies directly contributes to reducing the attack surface. By limiting the number of different technologies and versions in use, security teams can focus their efforts on securing a smaller, well-understood set of components. This reduces the complexity of security assessments, simplifies the application of security controls, and minimizes the potential for misconfigurations or unknown vulnerabilities arising from diverse, unmanaged tech stacks.
  1. Elimination of "Long Tail" Vulnerabilities: One of the persistent challenges in large organizations is the "long tail" of unpatched systems or services that are difficult to track or update. Fleet management automation systematically addresses this by ensuring that changes are applied across the entire defined scope, leaving fewer overlooked components and thus reducing the overall security debt.
  1. Improved Compliance and Auditability: With automated changes, every modification is tracked through PRs, CI/CD pipelines, and deployment logs. This provides a clear, auditable trail of when and how security fixes or configuration changes were applied, simplifying compliance efforts and internal/external audits.
  1. Empowering Security-as-Code: Fleet management enables security policies to be expressed and enforced as code. Security teams can define desired states or transformations, which are then automatically applied by Fleet Shift, ensuring consistent adherence without manual intervention. This shifts security left, embedding it directly into the development and deployment pipeline.
  1. Resilience Through Automated Rollbacks and Guardrails: The cohort-based deployment with automated guardrails enhances resilience. If a security patch or configuration change inadvertently introduces a regression or new vulnerability, the system can automatically halt the rollout or trigger an alert, preventing the issue from affecting the entire fleet. This provides a safety net for automated changes, crucial for maintaining service availability while enhancing security.

Key Takeaways

  • Fleet management is indispensable for large-scale microservices architectures: As software fleets grow faster than engineering teams, manual operations become unsustainable, leading to security risks, slow migrations, and developer burnout.
  • Automation is the cornerstone of effective fleet management: Spotify's Fleet Shift system demonstrates that automating changes across thousands of services drastically reduces the Mean Time To Respond (MTTR) for critical incidents like Log4j and accelerates technology migrations from months to weeks.
  • Standardization (Golden Tech) unlocks automation at scale: Establishing a set of "blessed" technologies simplifies the platform's ability to create and apply fleet-wide changes, reducing complexity and attack surface.
  • A cultural shift is necessary for successful automation: Developers must be trained to trust and leverage automated processes, freeing them from mundane tasks to focus on higher-value feature engineering.
  • Fleet management delivers significant, quantifiable business value: Spotify saved the equivalent of 355 full-time engineers in one year, demonstrating tangible returns on investment in terms of productivity, speed, and cost efficiency.
  • The future of fleet management involves advanced AI/LLMs: Spotify is exploring how AI can perform even more complex code transformations and migrations, promising to further expand the scope of automated changes and developer empowerment.

About the Speaker(s)

Stefan Särne is a speaker from Spotify, where he is deeply involved in the company's platform engineering efforts, particularly in the domain of fleet management. His presentation at KubeCon EU showcases his expertise in architecting and implementing large-scale automation solutions for complex microservices environments. Särne's insights are drawn from Spotify's real-world challenges and successes in managing a vast software fleet, emphasizing the strategic importance of automation, standardization, and cultural change to enhance developer productivity and system reliability.

Reviews

Dr. Zero (Offensive Security Researcher) — MUST SEE

This talk by Stefan Särne from Spotify provides an exceptional deep dive into their "Fleet Shift" system, a highly automated platform engineering solution for managing thousands of microservices. Leveraging the Log4j incident as a stark example, Särne articulates how Spotify transitioned from chaotic manual patching to a proactive, fleet-first strategy. The discussion on "Golden Technologies," automated PR merging with guardrails, and the significant cultural shift required is invaluable, demonstrating how such a system can drastically reduce vulnerability patching times from days to hours and save hundreds of full-time engineers' worth of work annually. This is a no-bullshit, data-driven…

Heather Calloway (CISO) — MUST SEE

This talk from Spotify isn't just a technical deep dive; it's a compelling case study in institutional resilience and strategic risk management, directly relevant to every CISO and executive leader. The Log4j incident laid bare the systemic vulnerabilities inherent in sprawling, manually managed microservices architectures. Spotify's response – a deliberate, quantified investment in fleet management, automation, and standardization – provides a clear blueprint for how large organizations can transform their security posture, accelerate operations, and achieve genuine accountability at scale. It demonstrates that the path to robust security isn't just about detection, but about proactive…

→ Top-rated talks at KubeCon + CloudNativeCon Europe 2025

All talks from KubeCon + CloudNativeCon Europe 2025