Skip to content

Add pod Observed Generation docs for 1.34 #51371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jonathancecilj
Copy link

Description

Add pod ObservedGeneration info to pod docs as part of beta promotion.

Observed Pod Generation KEP: kubernetes/enhancements#2377

Issue

Closes: #51195

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 25, 2025
Copy link

linux-foundation-easycla bot commented Jun 25, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 25, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @jonathancecilj!

It looks like this is your first PR to kubernetes/website 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/website has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign salaxander for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Jun 25, 2025
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 25, 2025
Copy link

netlify bot commented Jun 25, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 5b13e12
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/685b5845e43e860008c8596b
😎 Deploy Preview https://deploy-preview-51371--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@natasha41575
Copy link
Contributor

/assign

Copy link
Contributor

@natasha41575 natasha41575 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! I have a few small suggestions. Thanks for taking this on

@@ -260,6 +255,19 @@ The above update rules apply to regular pod updates, but other pod fields can be
- **Binding:** The `binding` subresource allows setting the pod's `spec.nodeName` via a `Binding` request.
This is typically only used by the {{< glossary_tooltip text="scheduler" term_id="kube-scheduler" >}}.

### Pod generation

- The `generation` field is unique. It will be automatically set by the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The `generation` field is unique. It will be automatically set by the
- The `metadata.generation` field is unique. It will be automatically set by the

Previously this was in a section that was talking about metadata, but since we are moving it to its own section, we should make it expicit


{{< feature-state for_k8s_version="v1.34" state="beta" >}}

- `observedGeneration` is an optional field that is captured in the `status` section of the Pod
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove the word "optional". Optional usually implies that it is optional for the user, but in this case the field is set by the system (and is always set when the feature gate is on)

Suggested change
- `observedGeneration` is an optional field that is captured in the `status` section of the Pod
- `observedGeneration` is a field that is captured in the `status` section of the Pod

{{< feature-state for_k8s_version="v1.34" state="beta" >}}

- `observedGeneration` is an optional field that is captured in the `status` section of the Pod
object. Kubelet will set `status.observedGeneration` to track the pod state to the current pod status.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
object. Kubelet will set `status.observedGeneration` to track the pod state to the current pod status.
object. If the feature gate `PodObservedGenerationTracking` is set, the Kubelet will set `status.observedGeneration` to track the pod state to the current pod status.

object. Kubelet will set `status.observedGeneration` to track the pod state to the current pod status.
The pod's `status.observedGeneration` will reflect the `metadata.generation` of the pod at the point
that the pod status is being reported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a great high-level description of what generation / observedGeneration is, thank you!

Just one thing I want us to add here. #51195 states that we have to carefully document the nuanced meaning of observedGeneration. That "nuance" I think is captured well in summary section of the mutable fields analysis doc:

If allocated spec is reflected directly in the pod status, it makes sense for the observed generation to be the generation observed in the current sync loop. This is the case for: allocated resources, resize status, ephemeral containers.
If the status is an indirect result of running the spec, then the generation associated is the generation from the previous sync loop. This is the case for: actual resources, container image, activeDeadlineSeconds/terminationGracePeriodSeconds

Can we add something to this effect here?

@natasha41575
Copy link
Contributor

/cc @SergeyKanzhelev
(as the sig node reviewer of this feature)

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 27, 2025
@jonathancecilj jonathancecilj marked this pull request as ready for review June 28, 2025 19:27
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 28, 2025
@jonathancecilj
Copy link
Author

/retest

@k8s-ci-robot
Copy link
Contributor

@jonathancecilj: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tallclair
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 30, 2025
@tallclair
Copy link
Member

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document status.observedGeneration
4 participants