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

forbid sysctls for pod sharing the respective namespaces with the host #118705

Merged
merged 4 commits into from
Oct 28, 2023

Conversation

pacoxu
Copy link
Member

@pacoxu pacoxu commented Jun 16, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #118702
@cheese39 meet in #72593 (comment)

Special notes for your reviewer:

If a pod with a such case is already created, the pod should be rejected by kubelet in SysctlForbiden status.

  • Users should delete those pods.

Validation only fails when creating a pod or updating a pod pod without the forbid sysctls. If the pod already has forbid sysctls, the update will not fail.

Does this PR introduce a user-facing change?

forbid sysctls for pod sharing the respective namespaces with the host when creating and update pod without such sysctls

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. 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. area/kubelet sig/apps Categorizes an issue or PR as relevant to SIG Apps. 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 Jun 16, 2023
@pacoxu pacoxu marked this pull request as draft June 16, 2023 08:22
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 16, 2023
@pacoxu pacoxu marked this pull request as ready for review June 16, 2023 08:53
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 16, 2023
@pacoxu
Copy link
Member Author

pacoxu commented Jun 16, 2023

I will rebase after #118707 is merged.

@bart0sh bart0sh added this to Triage in SIG Node PR Triage Jun 16, 2023
@bart0sh
Copy link
Contributor

bart0sh commented Jun 20, 2023

/triage accepted
/priority important-soon

@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 Jun 20, 2023
@bart0sh bart0sh moved this from Triage to Needs Reviewer in SIG Node PR Triage Jun 20, 2023
@pacoxu
Copy link
Member Author

pacoxu commented Jul 11, 2023

/cc @liggitt @thockin
as this is something similar to the known bad value.

@pacoxu pacoxu force-pushed the hostnet-sysctl-rejects branch 4 times, most recently from c98fb4c to 79d5fdf Compare October 26, 2023 03:47
@thockin
Copy link
Member

thockin commented Oct 26, 2023

Thanks!

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 2a0e335318e163b90c985829ce8c6a0996c7a57d

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pacoxu, thockin

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 26, 2023
@@ -6,6 +6,7 @@ go 1.20

require (
github.com/google/go-cmp v0.5.9
github.com/stretchr/testify v1.8.3
Copy link
Member Author

@pacoxu pacoxu Oct 27, 2023

Choose a reason for hiding this comment

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

Rebase for this updated.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 27, 2023
@dims dims added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2023
@thockin
Copy link
Member

thockin commented Oct 27, 2023

Still conflict

@pacoxu
Copy link
Member Author

pacoxu commented Oct 27, 2023

Rebased

The needs-rebase label is still there 🤣

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2023
@mengjiao-liu
Copy link
Member

/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 28, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 587df6799fefa87173e696ea0b2663b57f107d34

@k8s-ci-robot k8s-ci-robot merged commit 57c7b66 into kubernetes:master Oct 28, 2023
14 checks passed
SIG Node PR Triage automation moved this from Needs Reviewer to Done Oct 28, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Oct 28, 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/dependency Issues or PRs related to dependency changes 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/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

HostNet Pod with sysctl changing ip_local_port_range should be refused by apiserver
7 participants