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

feat: improve hostNetwork mode of NodePool by adding NodeAffinity to pods with specified annotation (#1935) #1959

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

huangchenzhao
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

A mutating webhook is introduced in yurt-manager component for adding NodeAffinity to pods with annotation["apps.openyurt.io/exclude-host-network-pool"] = true. The NodeAffinity indicates that the pods don't want to be scheduled to nodes in hostNetwork mode NodePool.

Users should add annotation ["apps.openyurt.io/exclude-host-network-pool"] = true manually to pods if they don't want to run pods on edge nodes in hostNetwork mode nodepool.

Which issue(s) this PR fixes:

Fixes #1935

Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 68.88889% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 52.37%. Comparing base (34b14cc) to head (44ad71e).
Report is 1 commits behind head on master.

Files Patch % Lines
...kg/yurtmanager/webhook/pod/v1alpha1/pod_handler.go 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1959      +/-   ##
==========================================
- Coverage   52.41%   52.37%   -0.04%     
==========================================
  Files         173      174       +1     
  Lines       21015    20972      -43     
==========================================
- Hits        11014    10985      -29     
+ Misses       9051     9039      -12     
+ Partials      950      948       -2     
Flag Coverage Δ
unittests 52.37% <68.88%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@huangchenzhao
Copy link
Member Author

/rerun

@rambohe-ch
Copy link
Member

@huangchenzhao filter hostnetworkpropagation also should be removed.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@huangchenzhao
Copy link
Member Author

@huangchenzhao filter hostnetworkpropagation also should be removed.

removed

@rambohe-ch rambohe-ch added approved approved lgtm lgtm labels Mar 13, 2024
@rambohe-ch
Copy link
Member

/lgtm

@rambohe-ch rambohe-ch merged commit 273e8df into openyurtio:master Mar 13, 2024
13 checks passed
vie-serendipity pushed a commit to vie-serendipity/openyurt that referenced this pull request Mar 20, 2024
zyjhtangtang pushed a commit to zyjhtangtang/openyurt that referenced this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved lgtm lgtm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request]improve hostNetwork mode of NodePool
2 participants