Skip to content

Conversation

@jonathancecilj
Copy link
Contributor

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
@linux-foundation-easycla
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 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
@netlify
Copy link

netlify bot commented Jun 25, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 070dda9
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-main-staging/deploys/68880f15e23f7b0008b73373
😎 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


### 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.

@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
Contributor 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

@natasha41575
Copy link
Contributor

/retitle Document pod status.observedGeneration

per this comment:

Feel free to document this in the live docs; no need to wait for v1.34

@k8s-ci-robot k8s-ci-robot changed the title Add pod Observed Generation docs for 1.34 Document pod status.observedGeneration Jul 7, 2025
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.

thanks for the update! I just have a few small wording suggestions.

These comments are mostly because the fact that observedGeneration has a slightly different meaning for different fields is more of a side effect of the way kubelet is implemented rather than something intentional, so I'm trying to get the docs to capture that essence.

after you make these changes I'll LGTM

@natasha41575
Copy link
Contributor

natasha41575 commented Jul 9, 2025

No idea why the tests have been consistently failing... can you try rebasing?

# with your current branch checked out
git remote add upstream git@github.com:kubernetes/website.git
git fetch upstream main
git rebase upstream/main

@jonathancecilj jonathancecilj force-pushed the 51195-k8s_1_34_branch branch from e54e4b2 to 9af480c Compare July 13, 2025 23:02
@natasha41575
Copy link
Contributor

/lgtm

/assign @lmktfy
for sig-docs approval

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 14, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e0693c6713a9230bc2b50a504518ce219de7d828

- Pod updates may not change fields other than `spec.containers[*].image`,
`spec.initContainers[*].image`, `spec.activeDeadlineSeconds` or
`spec.tolerations`. For `spec.tolerations`, you can only add new entries.
`spec.initContainers[*].image`, `spec.activeDeadlineSeconds`, `spec.terminationGracePeriodSeconds` or
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`spec.initContainers[*].image`, `spec.activeDeadlineSeconds`, `spec.terminationGracePeriodSeconds` or
`spec.initContainers[*].image`, `spec.activeDeadlineSeconds`, `spec.terminationGracePeriodSeconds`,

Copy link
Member

Choose a reason for hiding this comment

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

@jonathancecilj , please take a look at @SergeyKanzhelev 's suggestion

Different status fields may either be associated with the `metadata.generation` of the current sync loop, or with the
`metadata.generation` of the previous sync loop. The key distinction is whether a change in the `spec` is reflected
directly in the `status` or is an indirect result of a running process.

Copy link
Member

Choose a reason for hiding this comment

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

can we add two notices - one for the fact that this does not apply to static pods. And one that node lifecycle controller may set this as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

The node lifecycle controller does not touch status.observedGeneration. It only touches pod conditions[].observedGeneration which does not apply to this documentation.

If we want to make it a requirement to document more carefully conditions[].observedGeneration, let's leave it out of scope of this PR. I'll take it up as a separate task.

Copy link
Member

Choose a reason for hiding this comment

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

sure. Makes sense

system such that new pods have a `metadata.generation` of 1, and every update to
mutable fields in the pod's spec will increment the `metadata.generation` by 1.

{{< feature-state feature_gate_name="PodObservedGenerationTracking" >}}
Copy link
Member

Choose a reason for hiding this comment

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

should we add a note to say that k8s is not expecting external controllers to modify this field in any ways and changing it may lead to unexpected behavior?

request.
- **Container state**: During an in-progress resize, with require restart policy reflects the previous generation's
request.
- **activeDeadlineSeconds** & **terminationGracePeriodSeconds** & **DeletionTimestamp**: The effects of these fields on the
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- **activeDeadlineSeconds** & **terminationGracePeriodSeconds** & **DeletionTimestamp**: The effects of these fields on the
- **activeDeadlineSeconds** & **terminationGracePeriodSeconds** & **deletionTimestamp**: The effects of these fields on the

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2025
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: ea8e669a455dd0359007320f2f229f85ad1877c9

@natasha41575
Copy link
Contributor

/lgtm
/assign @reylejano

@natasha41575
Copy link
Contributor

friendly ping @reylejano
would you be able to do a pass for approval?

Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/lgtm

@natalisucks
Copy link
Contributor

good for docs, thanks everyone
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: natalisucks, SergeyKanzhelev

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2025
@k8s-ci-robot k8s-ci-robot merged commit d0bdbd4 into kubernetes:main Aug 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. 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 pod status.observedGeneration

8 participants