A “Krispr” Approach to Kubernetes Infrastructure

Keeping pods fresh by leveraging the mutating admission controller webhook

Daniel Low
8 min readintermediate
--
View Original

Overview

The article discusses Airbnb's innovative approach to managing Kubernetes infrastructure using a tool called Krispr, which facilitates the injection of infrastructure components into pods. It highlights the challenges faced with version fragmentation and the solution provided through the use of mutating admission controllers and a new mutator framework.

What You'll Learn

1

How to use mutating admission controllers to inject components into Kubernetes pods

2

Why maintaining version control of shared infrastructure components is crucial for stability

3

How to implement a mutator framework for Kubernetes manifests

Prerequisites & Requirements

  • Understanding of Kubernetes and its architecture
  • Familiarity with command line tools and Kubernetes CLI(optional)

Key Questions Answered

What is Krispr and how does it improve Kubernetes infrastructure management?
Krispr is a command line tool developed by Airbnb that facilitates the injection of infrastructure components into Kubernetes pods using mutating admission controllers. It allows infrastructure engineers to define what changes to make to pod specifications without being involved in the complexities of how those changes are applied, thereby improving the efficiency and reliability of infrastructure updates.
How does the mutating admission controller webhook work in Kubernetes?
The mutating admission controller webhook intercepts API calls to modify Kubernetes objects before they are stored. By using this webhook, Airbnb can inject components like service discovery into pods at creation time, ensuring that new pods automatically receive the latest infrastructure updates without requiring service owners to manually upgrade.
What challenges did Airbnb face with their previous infrastructure management approach?
Airbnb faced significant challenges with version fragmentation and maintenance complexity due to the reliance on service owners to upgrade kube-gen versions for shared infrastructure components. This led to difficulties in tracking rollouts and increased operational overhead, making it hard to maintain stability across services.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Container Orchestration
Kubernetes
Used to define and manage workloads at Airbnb.
Tool
Krispr
A command line tool for managing mutators and injecting components into Kubernetes manifests.

Key Actionable Insights

1
Implementing a mutating admission controller can streamline the process of injecting shared components into Kubernetes pods.
This approach allows for centralized management of infrastructure components, reducing the burden on service owners and ensuring that all new pods are consistently updated with the latest configurations.
2
Using a framework like Krispr can help standardize the way infrastructure components are managed and deployed.
By abstracting the mutator logic, teams can focus on defining what needs to change rather than how to implement those changes, which can improve development velocity and reduce errors.

Common Pitfalls

1
Relying too heavily on service owners to manage infrastructure component upgrades can lead to fragmentation and inconsistencies.
This often results in a lack of visibility into which services are using outdated components, complicating maintenance and increasing operational risks.

Related Concepts

Kubernetes Architecture
Mutating Admission Controllers
Service Discovery In Microservices