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

dockertools: disable MemorySwap on Linux #59404

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

ohmystack
Copy link
Contributor

@ohmystack ohmystack commented Feb 6, 2018

In this commit, set MemorySwap the same with Memory to prevent using swap on Linux.

What this PR does / why we need it:

In #39731, @pires tried to disable swap on Linux by setting MemorySwap to 0.
However, according to Docker's docs, setting MemorySwap to 0 is treated as unset, and its default behavior is to set to twice the size of Memory, which can still cause the container to use the swap.

Which issue(s) this PR fixes :

This issue was mentioned in this comment: #7294 (comment)

Special notes for your reviewer:

  1. For the case on Windows, we can still use the 0 because Windows does not support MemorySwap.
  2. There is another place using the DefaultMemorySwap() is for sandbox.
    Maybe setting the sandbox's MemorySwap to 0 is fine. I didn't change that.

Release note:

dockertools: disable memory swap on Linux.

@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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 6, 2018
@dixudx
Copy link
Member

dixudx commented Feb 6, 2018

/assign @pires
/cc @kubernetes/sig-node-pr-reviews

@k8s-ci-robot k8s-ci-robot added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Feb 6, 2018
@dixudx
Copy link
Member

dixudx commented Feb 6, 2018

There is another place using the DefaultMemorySwap() is for sandbox.
Maybe setting the sandbox's MemorySwap to 0 is fine. I didn't change that.

MemorySwap is of no use if Memory is not set. Actually we could remove this for sandbox.

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 6, 2018
@ohmystack
Copy link
Contributor Author

/retest

@thrawn997
Copy link

Anything I can do to help with this one?

@ohmystack
Copy link
Contributor Author

@pires All tests have passed. Would you mind to review this PR?

Copy link
Contributor

@pires pires left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2018
@ohmystack
Copy link
Contributor Author

ohmystack commented Feb 16, 2018

/retest

@ohmystack
Copy link
Contributor Author

pinging @Random-Liu @dchen1107 @vishh for approval

@ohmystack
Copy link
Contributor Author

/retest

@ohmystack
Copy link
Contributor Author

/test all

According to docker docs, setting MemorySwap equals to Memory can
prevent docker containers from using any swap, instead of setting
MemorySwap to zero.
@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 18, 2018
@ohmystack
Copy link
Contributor Author

@pires Could you /lgtm again, please? I've just rebased to latest master to fix a test (not caused by my code) and didn't do any other changes.

Ping kubelet OWNERs to approve this. Thanks.
@Random-Liu @dchen1107 @derekwaynecarr @tallclair @vishh @yujuhong

@thrawn997
Copy link

Re-ping @pires @vishh

@pires
Copy link
Contributor

pires commented Feb 26, 2018

/lgtm

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

k8s-ci-robot commented Feb 26, 2018

@ohmystack: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kubeadm-gce-canary ee952cdebc2b1a5256436d0be754001c08bb5e04 link /test pull-kubernetes-e2e-kubeadm-gce-canary

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@yujuhong
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ohmystack, pires, yujuhong

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 Feb 26, 2018
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 50724, 59025, 59710, 59404, 59958). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 89e433f into kubernetes:master Feb 27, 2018
@thrawn997
Copy link

Is it possible to get this merged into a 1.9 release?

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants