-
Notifications
You must be signed in to change notification settings - Fork 1.1k
WIP: drop the infra container (again!) #3997
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
WIP: drop the infra container (again!) #3997
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haircommander The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2a86740 to
aaca421
Compare
aaca421 to
764277f
Compare
0b9b4ec to
084fe24
Compare
having exec sync update state each time is a bit excessive. In addition to exec'ing extra, it causes potential for runc state to flake, causing the container to go down. instead, we should just check if the pid is running, and proceed if so Signed-off-by: Peter Hunt <[email protected]>
in any case where we want to directly manipulate a pid on the host. this is unsafe, as we can encounter pid wrap. for those cases, we need to check the pid is the one we want to access, whether it's creating a namespace path with /proc or directly killing a container also, add unit tests for this fix, as well as refactor a few of the oci tests Signed-off-by: Peter Hunt <[email protected]>
pid namespaces were special cased as a namespace that was not managed, because they function differently For the other namespaces, we can pass a new namespace to the runtime when that namespace is private to the pod However, it would be a bother creating a new pid namespace (conmon would have to unshare the namespace, then do the bind mount) Instead, mount the pid namespace *after* the sandbox is created. This way, the infra container's runtime config doesn't list the namespace (more on that below) but subsequent containers created can join the namespace, instead of the proc entry. This further protects us from pid wrap A consequence of not adding the file to the config is the restore case is a bit odd. The other namespaces can join the namespace listed in the restored config.json, but the pid namespace is not saved in its config json. Work around this by saving the pidns location to the infra container's runDir this PR also adds unit tests, and refactors a couple of things to make tests pass Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
some changes this includes: - allow for the infra container to not be created by the runtime, if sb.NeedsInfra() is false - add concept of a 'spoofed' container. This allows us to make calls to ID(), Name(), and Description() without having the runtime create the container - using spoof, change checks of podInfraContainer == nil to Spoofed(), as well as re-add Description() calls - reorder some infra container creation code - add unit tests for NeedsInfra and Spoofed - add integration test for drop infra - sysctls are configured in the runtime after the process unshares in the shared namespaces. since we aren't using a runtime, we need to repeat this step. - After unsharing, but before binding, configure the sysctls for the namespace. - spoof container state Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
Signed-off-by: Peter Hunt <[email protected]>
084fe24 to
b924339
Compare
|
@haircommander: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
@haircommander: PR needs rebase. DetailsInstructions 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. |
|
superceded by #4165 |
What type of PR is this?
/kind api-change
What this PR does / why we need it:
this is a #3474 redux, built for the modern era! it also contains #3868 and #3910
With this PR, users can specify
--drop-infraand cri-o will drop the infra container when able.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?