Skip to content
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

[KEP-3973]: docs for DeploymentPodReplacementPolicy #48370

Closed

Conversation

atiratree
Copy link
Member

@k8s-ci-robot k8s-ci-robot added this to the 1.32 milestone Oct 15, 2024
@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 Kubernetes 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language labels Oct 15, 2024
@k8s-ci-robot k8s-ci-robot requested a review from sftim October 15, 2024 18:48
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 15, 2024
Copy link

netlify bot commented Oct 15, 2024

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit 2b59b4b
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/671117f4a37b83000889a86f

@atiratree
Copy link
Member Author

the kubernetes/kubernetes#123430 is still not merged yet
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 15, 2024
Copy link

netlify bot commented Oct 15, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 2b59b4b
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/671117f47aaff000083895b3
😎 Deploy Preview https://deploy-preview-48370--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 site configuration.

Copy link
Contributor

@sftim sftim 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 PR and for getting it in well ahead of the review deadline.

I've made some suggestions to help you align with our style guide.

@@ -1317,6 +1330,49 @@ created Pod should be ready without any of its containers crashing, for it to be
This defaults to 0 (the Pod will be considered available as soon as it is ready). To learn more about when
a Pod is considered ready, see [Container Probes](/docs/concepts/workloads/pods/pod-lifecycle/#container-probes).

### Pod Replacement Policy
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
### Pod Replacement Policy
### Pod replacement policies {#pod-replacement-policy}

This aligns with the style guide, even though the rest of the page follows a mixture of styles. It could use an update.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wouldn't it be better to keep the name same as the name of the feature/field for a better lookup?

Comment on lines 1370 to 1374
{{< note >}}
If you manually delete a Pod, the lifecycle is controlled by the ReplicaSet and the replacement will be created
immediately (even if the old Pod is still in a Terminating state). The Pod Replacement Policies control only
Deployment rollouts and scaling.
{{< /note >}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using too many note shortcodes. Try this instead:

Suggested change
{{< note >}}
If you manually delete a Pod, the lifecycle is controlled by the ReplicaSet and the replacement will be created
immediately (even if the old Pod is still in a Terminating state). The Pod Replacement Policies control only
Deployment rollouts and scaling.
{{< /note >}}
If you manually delete a Pod, the lifecycle of that Pod and its replacement is controlled by the associated ReplicaSet; a replacement will be created immediately. When you delete a Pod manually, and the deleted
Pod was owned by a ReplicaSet, the ReplicaSet creates a new Pod as soon as you trigger deletion (even if the old Pod is still in a Terminating state).
Setting a pod replacement policy for a Deployment only has an effect on:
1. rollouts for changes to a Deployment
2. changes to the scale of that Deployment

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestions. As mentioned in #48370 (comment), I think it is better to just say rollouts. I have also removed the list at the end to keep it more compact and highlight the policies above.

deployment. Some pods may take a long time to terminate and may consume additional resources during this
time. As a result, the total number of all pods can temporarily exceed `.spec.replicas`
(or `.spec.replicas + .spec.strategy.rollingUpdate.maxSurge` for RollingUpdate Deployments).
A `.spec.podReplacementPolicy` field can be used to control when a Deployment should create new pods.
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
A `.spec.podReplacementPolicy` field can be used to control when a Deployment should create new pods.
Providing this feature is enabled in your cluster, you can specify a `.spec.podReplacementPolicy`
to control when a Deployment should create new pods. The field affects the behavior of the
Deployment during scaling operations and when rolling out updates.

Copy link
Member Author

Choose a reason for hiding this comment

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

  • Do we have to mention the enablement the 2nd time? I would think it is implied for the rest of the section.
  • Same question about the last part. Should we mention it again? We also have it at the end.

Comment on lines 1344 to 1345
Deployment Pods can become terminating due to deletion, usually during the rollout or scaling of a new
deployment. Some pods may take a long time to terminate and may consume additional resources during this
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
Deployment Pods can become terminating due to deletion, usually during the rollout or scaling of a new
deployment. Some pods may take a long time to terminate and may consume additional resources during this
Pods that (indirectly) belong to a Deployment can become terminating due to deletion, usually during
the rollout of a change or an update to the scale of an existing Deployment.
After a change to a Deployment, some pods may take a long time to terminate and may consume
additional resources during that period of

Copy link
Member Author

Choose a reason for hiding this comment

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

  • I think using (indirectly) is a bit confusing. The relationship is quite direct via the owner references.
  • rollout of a change is also a bit confusing as it is possible to do a rollout without any change: kubectl rollout restart

@atiratree atiratree force-pushed the pod-replacement-policy-docs branch from 2887b57 to 187c7ed Compare October 17, 2024 13:36
@atiratree atiratree force-pushed the pod-replacement-policy-docs branch from 187c7ed to 2b59b4b Compare October 17, 2024 13:58
@atiratree
Copy link
Member Author

@sftim thanks for the review, I have included most of your suggestions.

@atiratree
Copy link
Member Author

Unfortunately we did not manage to finish the API review, so this feature is postponed to 1.33

@atiratree atiratree closed this Nov 8, 2024
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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. language/en Issues or PRs related to English language 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.

3 participants