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

Clarify init container concept #47946

Conversation

vishnuswmech
Copy link
Contributor

@vishnuswmech vishnuswmech commented Sep 16, 2024

I have made the Init container concepts from both Pod and Deployment perspective.

and This is my first contribution and let me know if any changes needs to be done on PR.

Issue

Fixes: #38271

Copy link

linux-foundation-easycla bot commented Sep 16, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: vishnuswmech / name: Sri Vishnuvardhan A (27779ce)

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

Welcome @vishnuswmech!

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 Sep 16, 2024
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 16, 2024
Copy link

netlify bot commented Sep 16, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 27779ce
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/66ea44daaac37d0008f2aa35
😎 Deploy Preview https://deploy-preview-47946--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.

@k8s-ci-robot k8s-ci-robot added 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 Sep 16, 2024
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.

Thank you for the PR.

Here's some feedback

We shouldn't merge this as-is, but I hope we can help you tweak it so it's good to go in.

@vishnuswmech
Copy link
Contributor Author

Thanks @sftim for the suggestions.

Sure, Will work on it.

@vishnuswmech vishnuswmech force-pushed the feature/38271-init-container-concepts branch from 5729147 to b1a1a97 Compare September 17, 2024 16:30
@vishnuswmech
Copy link
Contributor Author

@sftim I have made the changes based on your suggestions. Kindly review this and let me know if any further corrections needed.

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.

/lgtm

I think there's room to improve, but I want to be clear: further tweaks are optional.

@@ -291,10 +291,9 @@ is in the `Pending` state but should have a condition `Initialized` set to false
If the Pod [restarts](#pod-restart-reasons), or is restarted, all init containers
must execute again.

Changes to the init container spec are limited to the container image field.
Altering an init container image field is equivalent to restarting the Pod.
Changes to the init container spec are limited to the container image field. Altering the image field of the init container does not restart or recreate 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.

Try this:

Suggested change
Changes to the init container spec are limited to the container image field. Altering the image field of the init container does not restart or recreate the Pod.
Changes to the init container spec are limited to the container image field.
Directly altering the `image` field of an init container does _not_ restart the
Pod or trigger its recreation. If the Pod has yet to start, that change may
have an effect on how the Pod boots up.
For a [pod template](/docs/concepts/workloads/pods/#pod-templates)
you can typically change any field for an init container; the impact of making
that change depends on where the pod template is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is done.


Because init containers can be restarted, retried, or re-executed, init container
However, since init containers can be restarted, retried, or re-executed, init container
Copy link
Contributor

Choose a reason for hiding this comment

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

The original text was good here I think:

Suggested change
However, since init containers can be restarted, retried, or re-executed, init container
Because init containers can be restarted, retried, or re-executed, init container

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


Because init containers can be restarted, retried, or re-executed, init container
However, since init containers can be restarted, retried, or re-executed, init container
code should be idempotent. In particular, code that writes to files on `EmptyDirs`
Copy link
Contributor

Choose a reason for hiding this comment

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

(optionally)

Suggested change
code should be idempotent. In particular, code that writes to files on `EmptyDirs`
code should be idempotent. In particular, code that writes into any `emptyDir` volume

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sense. It is done.

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

LGTM label has been added.

Git tree hash: 0fb00a4522491e0b3a7b6e0b37ff13633cde1b6a

@reylejano
Copy link
Member

@vishnuswmech , what do you think of sftim's suggestions

@vishnuswmech
Copy link
Contributor Author

Thanks @sftim , now got some idea.

@reylejano I will make the necessary changes and will commit it shortly.

@vishnuswmech vishnuswmech force-pushed the feature/38271-init-container-concepts branch from b1a1a97 to 80ae398 Compare September 18, 2024 03:07
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 18, 2024
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 18, 2024
@vishnuswmech vishnuswmech force-pushed the feature/38271-init-container-concepts branch from 80ae398 to 27779ce Compare September 18, 2024 03:11
@vishnuswmech
Copy link
Contributor Author

@sftim @reylejano Made the required changes based on your suggestions. Kindly check now and let me know if any further modifications needed.

@vishnuswmech
Copy link
Contributor Author

@sftim Kindly approve this.

@T-Lakshmi
Copy link
Contributor

All suggestions are seems incorporated and preview looks good to me.
Preview page
/lgtm

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

LGTM label has been added.

Git tree hash: 0e0b7bfc2d6569d882e71a68460d6ad9127d9c53

@vishnuswmech
Copy link
Contributor Author

Thanks @T-Lakshmi for your review.

@vishnuswmech
Copy link
Contributor Author

@sftim Kindly approve this PR.

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sftim

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 Sep 23, 2024
@sftim
Copy link
Contributor

sftim commented Sep 23, 2024

/retitle Clarify init container concept

@k8s-ci-robot k8s-ci-robot changed the title 38271 - Init Container concept clarity Clarify init container concept Sep 23, 2024
@k8s-ci-robot k8s-ci-robot merged commit 29d3fe6 into kubernetes:main Sep 23, 2024
6 checks passed
@vishnuswmech vishnuswmech deleted the feature/38271-init-container-concepts branch September 23, 2024 09:17
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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Init containers concept page is confusing - https://k8s.io/docs/concepts/workloads/pods/init-containers/
5 participants