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

Don't reuse memory of a restartable init container #120715

Conversation

gjkim42
Copy link
Member

@gjkim42 gjkim42 commented Sep 17, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

When memory-manager-policy is static and you create a guaranteed pod with a restartable init container,
a restartable init container shares its memory resources with a regular container.

This PR makes sure that a restartable init container does not share its memory resources with regular containers.

Which issue(s) this PR fixes:

Fixes #

xref #119442

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fixed a bug where the memory resources allocated to an init container, with containerRestartPolicy of `Always`, were erroneously reused by a regular container.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/753-sidecar-containers

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 17, 2023
@k8s-ci-robot k8s-ci-robot added area/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 17, 2023
@gjkim42 gjkim42 force-pushed the do-not-reuse-memory-of-restartable-init-containers branch from 655d915 to 7113523 Compare September 17, 2023 05:25
@gjkim42 gjkim42 force-pushed the do-not-reuse-memory-of-restartable-init-containers branch from 7113523 to b4e5b86 Compare September 17, 2023 05:49
@gjkim42
Copy link
Member Author

gjkim42 commented Sep 17, 2023

/retest

@gjkim42
Copy link
Member Author

gjkim42 commented Sep 17, 2023

/test pull-kubernetes-node-e2e-containerd-sidecar-containers
/test pull-kubernetes-node-kubelet-serial-containerd-sidecar-containers

@gjkim42
Copy link
Member Author

gjkim42 commented Sep 17, 2023

/retest

@bart0sh bart0sh added this to Triage in SIG Node PR Triage Sep 18, 2023
@bart0sh
Copy link
Contributor

bart0sh commented Sep 18, 2023

/triage accepted
/priority important-soon
/cc @ffromani @swatisehgal @SergeyKanzhelev

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Sep 18, 2023
@bart0sh bart0sh moved this from Triage to Needs Reviewer in SIG Node PR Triage Sep 18, 2023
@Tal-or
Copy link
Contributor

Tal-or commented Sep 28, 2023

Hello @gjkim42, just wonder, is this issue is something you're planning to work on?

@gjkim42
Copy link
Member Author

gjkim42 commented Sep 28, 2023

Hello @gjkim42, just wonder, is this issue is something you're planning to work on?

Yes, this PR is waiting for the reviewers.

@Tal-or
Copy link
Contributor

Tal-or commented Sep 28, 2023

Hello @gjkim42, just wonder, is this issue is something you're planning to work on?

Yes, this PR is waiting for the reviewers.

My bad I thought I'm commenting on the issue itself.
Thank you for clarifying anyway :)

@gjkim42
Copy link
Member Author

gjkim42 commented Oct 6, 2023

/test pull-kubernetes-node-e2e-containerd-sidecar-containers
/test pull-kubernetes-node-kubelet-serial-containerd-sidecar-containers

@gjkim42
Copy link
Member Author

gjkim42 commented Oct 30, 2023

/assign @mrunalp

Could you take a look at this? This fixes a bug that regular containers reuse the sidecar container's memory resources.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gjkim42, mrunalp

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 Oct 31, 2023
@dims
Copy link
Member

dims commented Oct 31, 2023

/lgtm

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

LGTM label has been added.

Git tree hash: e1cf3e72a244c969604b0231d99c06132b97e18c

@k8s-ci-robot k8s-ci-robot merged commit 9604314 into kubernetes:master Nov 1, 2023
16 checks passed
SIG Node PR Triage automation moved this from Needs Reviewer to Done Nov 1, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Nov 1, 2023
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. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants