-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Document pod status.observedGeneration
#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
Document pod status.observedGeneration
#51371
Conversation
|
Welcome @jonathancecilj! |
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/assign |
natasha41575
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - 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 |
There was a problem hiding this comment.
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)
| - `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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
|
/cc @SergeyKanzhelev |
|
/retest |
|
@jonathancecilj: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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. |
|
/ok-to-test |
|
/retest |
|
/retitle Document pod per this comment:
|
status.observedGeneration
natasha41575
left a comment
There was a problem hiding this 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
|
No idea why the tests have been consistently failing... can you try rebasing? |
e54e4b2 to
9af480c
Compare
|
/lgtm /assign @lmktfy |
|
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `spec.initContainers[*].image`, `spec.activeDeadlineSeconds`, `spec.terminationGracePeriodSeconds` or | |
| `spec.initContainers[*].image`, `spec.activeDeadlineSeconds`, `spec.terminationGracePeriodSeconds`, |
There was a problem hiding this comment.
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. | ||
|
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" >}} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **activeDeadlineSeconds** & **terminationGracePeriodSeconds** & **DeletionTimestamp**: The effects of these fields on the | |
| - **activeDeadlineSeconds** & **terminationGracePeriodSeconds** & **deletionTimestamp**: The effects of these fields on the |
SergeyKanzhelev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
LGTM label has been added. Git tree hash: ea8e669a455dd0359007320f2f229f85ad1877c9
|
|
/lgtm |
|
friendly ping @reylejano |
SergeyKanzhelev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
good for docs, thanks everyone |
|
[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 |
Description
Add pod ObservedGeneration info to pod docs as part of beta promotion.
Observed Pod Generation KEP: kubernetes/enhancements#2377
Issue
Closes: #51195