-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
issue-20372 - Initial impl for restartable init-container #20647
base: main
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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/test-infra repository. |
Please sign your commits. git commit -a --amend -s |
06ed6d0
to
210cd0e
Compare
The code looks good. Please make sure to add test(s) |
Cockpit tests failed for commit 5fb6d9f8a862ec72232ec33793b3696f03d2009b. @martinpitt, @jelly, @mvollmer please check. |
5fb6d9f
to
f827d95
Compare
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.
In addition, there is no test for the actual restarting of an init container
The cockpit test failure detected a crun regression in podman-next, see containers/crun#1367 Unrelated to this PR. |
Thanks @ygalblum for the comment, I had updated my test. |
Great, thanks
Yes, this is what I meant. I thought that once the container pass the check, podman will monitor and restart them. Have you tried it our manually? |
@ygalblum
I assume podman didn't support it because podman won't continue until old init container exit. There is not such requirement to restart old init container. |
e48556d
to
ec63837
Compare
7b9cf2b
to
ec63837
Compare
I fear that merging this code without the code to restart the init-container might mislead the users as they will expect that the init-container is restarted while in fact in won't. |
No idea on the second question about the init container. |
According to https://github.com/containers/podman/blame/7dc7cbfd9b0440ddc86e210a2272fdaccd6376bb/pkg/domain/infra/abi/play.go#L803, the original init-container can not be restarted. So maybe we can just merge this PR with documentation? Regarding to restarting, do you know how podman restart regular container. I didn't see how it is done in Podman code |
Conmon restarts the container. |
Fine by me. @containers/podman-maintainers Are you OK with this approach? |
Makes sense from my understanding of a pod, that an init container only happens once during creation of the pod. |
K8S is kinda piggybacking on init-containers to define side-car containers that must start successfully before the main container however unlike the conventional init-containers these ones are expected to keep running as long as the pod is running and therefore have a restartPolicy. The question was whether we should merge this change alone. The problem is that with this change, Podman ignores a configuration it accepts. However, from https://github.com/containers/podman/blame/7dc7cbfd9b0440ddc86e210a2272fdaccd6376bb/pkg/domain/infra/abi/play.go#L803 we see that even today Podman does not restart the init-container if the restartPolicy is So, I think we it's OK to merge this change with the current functionality. But, make sure the documentation is clear about it. |
Thanks, I updated |
I am fine with merging, since we are already broken, and this makes us less broken. But we should fix the handling of init containers with restart policy in a separate PR. |
The LGTM. @vincentywdeng do you mind squashing the commits? |
2adb741
to
107135e
Compare
Thanks, I squashed my commits. How can I proceed with the the PR? There are some failed tests which I belive is unrelated to my change. |
@vincentywdeng It seems that there is a failing check on the commit subject length: |
107135e
to
ef9d787
Compare
Thanks, I updated the commit title. The rest failures are all
|
The code LGTM and it seems like the test failures are unrelated. |
ef9d787
to
5766d6a
Compare
Yes. Just rebase on top of the current |
582f341
to
fa972b6
Compare
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.
Sorry for the last minute nit. But, I think it can be beneficial
Supports sidecar container by setting restartPolicy of init container to 'always' Closes containers#20372 Signed-off-by: Vincent Deng <[email protected]>
fa972b6
to
a450f2b
Compare
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincentywdeng, ygalblum 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 |
@ashley-cui @umohnani8 PTAL |
@containers/podman-maintainers PTAL. This will probably affect the discussion #22496 |
Implementing native sidecar as kubernetes
https://kubernetes.io/blog/2023/08/25/native-sidecar-containers/
Does this PR introduce a user-facing change?