Skip to content

Conversation

@yuanwang04
Copy link
Contributor

Description

Add documentation for container restart policy and container restart rules for 1.34.

Issue

kubernetes/enhancements#5307

Closes: #

@k8s-ci-robot k8s-ci-robot added this to the 1.34 milestone Jul 1, 2025
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 1, 2025
@netlify
Copy link

netlify bot commented Jul 1, 2025

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

Name Link
🔨 Latest commit 5a0ebb3
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-io-vnext-staging/deploys/6892e5ad052cb30007408393

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Jul 1, 2025
@k8s-ci-robot k8s-ci-robot requested a review from windsonsea July 1, 2025 22:43
@k8s-ci-robot
Copy link
Contributor

Welcome @yuanwang04!

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 size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 1, 2025
@yuanwang04 yuanwang04 force-pushed the container_restart_rules branch from 1584f3a to fb64460 Compare July 28, 2025 21:54
@k8s-ci-robot k8s-ci-robot added area/blog Issues or PRs related to the Kubernetes Blog subproject area/localization General issues or PRs related to localization language/ja Issues or PRs related to Japanese language language/ko Issues or PRs related to Korean language language/pt Issues or PRs related to Portuguese language language/uk Issues or PRs related to Ukrainian language language/zh Issues or PRs related to Chinese language sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 28, 2025
@yuanwang04 yuanwang04 force-pushed the container_restart_rules branch from fb64460 to 07b2126 Compare July 28, 2025 21:58
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 28, 2025
@yuanwang04 yuanwang04 force-pushed the container_restart_rules branch from 07b2126 to c686fc1 Compare July 28, 2025 22:33
@yuanwang04 yuanwang04 marked this pull request as ready for review July 28, 2025 22:33
@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 Jul 28, 2025
@yuanwang04
Copy link
Contributor Author

/cc @SergeyKanzhelev The doc change is ready for review, PTAL, thanks!

@yuanwang04 yuanwang04 force-pushed the container_restart_rules branch from 0e5cb33 to 595e00e Compare July 29, 2025 21:59
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 29, 2025
@yuanwang04 yuanwang04 force-pushed the container_restart_rules branch 2 times, most recently from 76110f3 to bff050f Compare July 31, 2025 22:39
@michellengnx
Copy link
Contributor

Hello @yuanwang04 👋! I'm reaching out from the Docs team. Just checking in as we approach Docs Freeze on Wednesday August 6, 2025 18:00 PDT. This documentation appears to still be under review. To meet the Docs Freeze, this PR must have a technical review as well as lgtm and approve labels applied, without any unaddressed comments or concerns from SIG Docs. Thank you!

@lmktfy
Copy link
Member

lmktfy commented Aug 3, 2025

Also see: issue #51757

Copy link
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

/lgtm

I think we should merge this and then iterate. The suggestions in this review show some of the iterating we could do.

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

LGTM label has been added.

Git tree hash: 52c47db6223e2cc2fb2c8967988f6d4e0cf74c09

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

I like @lmktfy 's suggestions, but it is ok to follow up later with them

@yuanwang04 yuanwang04 force-pushed the container_restart_rules branch from bff050f to 5a0ebb3 Compare August 6, 2025 05:18
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 6, 2025
Copy link
Member

@windsonsea windsonsea left a comment

Choose a reason for hiding this comment

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

Nits

Comment on lines +286 to +287
{{< feature-state
feature_gate_name="ContainerRestartRules" >}}
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
{{< feature-state
feature_gate_name="ContainerRestartRules" >}}
{{< feature-state feature_gate_name="ContainerRestartRules" >}}

Put the shortcode onto a single line.

Copy link
Member

Choose a reason for hiding this comment

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

Ideally yes

command: ['sh', '-c', 'echo "Keep restarting" && sleep 1800 && exit 1']
```
A Pod with Always restart policy with an init container that only execute once. If the init
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
A Pod with Always restart policy with an init container that only execute once. If the init
A Pod with `Always` restart policy with an init container that only execute once. If the init

Use a consistent style for those values

command: ['sh', '-c', 'sleep 1800 && exit 0']
```
A Pod with Never restart policy with a container that ignores and restarts on specific exit codes.
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
A Pod with Never restart policy with a container that ignores and restarts on specific exit codes.
A Pod with `Never` restart policy with a container that ignores and restarts on specific exit codes.

If none of the rules’ conditions matched, Kubernetes fallback to container’s configured
`restartPolicy`.

For example, a Pod with OnFailure restart policy that have a `try-once` container. This allows
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
For example, a Pod with OnFailure restart policy that have a `try-once` container. This allows
For example, a Pod with `OnFailure` restart policy that have a `try-once` container. This allows

Comment on lines +246 to +247
You can configure restarts as a policy that applies to all Pods, or using container-level configuration (for example: when you define a
{{< glossary_tooltip text="sidecar container" term_id="sidecar-container" >}}).
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
You can configure restarts as a policy that applies to all Pods, or using container-level configuration (for example: when you define a
{{< glossary_tooltip text="sidecar container" term_id="sidecar-container" >}}).
You can configure restarts as a policy that applies to all Pods, or using container-level configuration
(for example: when you define a {{< glossary_tooltip text="sidecar container" term_id="sidecar-container" >}}).

@drewhagen
Copy link
Member

Hello @yuanwang04 👋!

I'm reaching out on behalf of the Release Docs team.

It looks like this PR is still actively in review with new feedback, although both SIG Node and SIG Docs have given lgtm prior to its removal on recent commits.

A friendly reminder that Docs Freeze is approaching today, at 18:00 PT (less than 9 hours). This documentation appears to still be under review. To meet the Docs Freeze, this PR must complete a technical review with SIG Node as well as lgtm and approve labels applied, without any unaddressed comments or concerns from SIG Docs.

If you wish to include this enhancement in 1.34 but are concerned about meeting the deadline, please consider proactively filing an exception request. Thanks!

cc: @kubernetes/sig-node-leads FYSA

{{< feature-state
feature_gate_name="ContainerRestartRules" >}}

If your cluster has the feature gate `ContainerRestartRules` enabled, you can specify
Copy link
Member

Choose a reason for hiding this comment

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

We really recommend hyperlinking the phrase "feature gates" to the list of feature gates.

Copy link
Member

@lmktfy lmktfy left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: b82434731d66a53810f9852c8dba7ccbcc661c3f

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmktfy, 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
@lmktfy
Copy link
Member

lmktfy commented Aug 6, 2025

Good to merge; follow up PRs welcome!

@k8s-ci-robot k8s-ci-robot merged commit a29bca9 into kubernetes:dev-1.34 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. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants