Kubernetes
Deployment
Troubleshooting
Software Engineering
DevOps

Kubernetes Deployment generation is 35, but latest observed generation is 34

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Understanding Kubernetes: Deployment Discrepancy—Generation 35 vs. Latest Observed Generation 34

Kubernetes is a robust container orchestration platform that is widely used for managing containerized applications. It is designed to simplify deployment, scaling, and operations of application containers across cluster environments. However, sometimes users encounter issues that can be perplexing, especially around deployment generation mismatches such as "Deployment generation is 35, but latest observed generation is 34."

Exploring Kubernetes Deployments

In Kubernetes, a Deployment provides declarative updates for Pods and ReplicaSets. A Deployment ensures that the desired state specified by the user is achieved and maintained despite differences due to server-side updates or existing application state. It provides capabilities such as rolling updates and rollbacks, which are essential for maintaining application availability during updates.

Key Concepts

1. Generation

  • Generation in Kubernetes refers to the specification version of the Deployment. Every time the Deployment specification is updated (e.g., changing the image, modifying the environmental variables), the Deployment's generation number is incremented.
  • Latest Observed Generation is the latest Deployment generation that the controller has processed.
Why the Discrepancy?

The difference between the `generation` and the `latest observed generation` usually indicates that the controller has not processed the most recent Deployment change. This can be due to:

  • The Deployment controller being busy or lagging.
  • An issue with the API server.
  • An ongoing update that hasn't completed.

Let's dive into a few technical aspects and solutions.

Technical Explanation

To diagnose a discrepancy in Deployment generation, several areas should be checked:

1. Check Deployment Status

Run the following command to view the detailed status of your Deployment:

  • Wait for Reconciliation: Often, the issue resolves itself as the controller processes the Deployment updates. This typically takes a few moments.
  • Manual Check: Verify if there are failing Pods due to configuration errors or resource limits that may need to be corrected.
  • Controller Resources: Ensure the Deployment controller has adequate resources and is not overwhelmed by other tasks.
    • name: example-container

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.