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

feature: add hostNetwork to the podSpec #1944

Merged
merged 4 commits into from
Dec 14, 2023

Conversation

tanujd11
Copy link
Member

What type of PR is this?

Feature

What this PR does / why we need it:

added hostNetwork to the podSpec

Which issue(s) this PR fixes:

Fixes #1928

@tanujd11 tanujd11 requested a review from a team as a code owner October 10, 2023 07:17
Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (176823c) 64.37% compared to head (a3e066e) 64.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1944      +/-   ##
==========================================
- Coverage   64.37%   64.33%   -0.04%     
==========================================
  Files         112      112              
  Lines       15877    15879       +2     
==========================================
- Hits        10221    10216       -5     
- Misses       5007     5013       +6     
- Partials      649      650       +1     

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

Signed-off-by: tanujd11 <[email protected]>
@tanujd11
Copy link
Member Author

/retest

@zirain
Copy link
Member

zirain commented Oct 11, 2023

Before adding this, I want to clearify the use case. The use of HostNetwork is discouraged.

@arkodg arkodg marked this pull request as draft October 13, 2023 22:09
Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale label Nov 13, 2023
@fanux
Copy link

fanux commented Dec 12, 2023

@zirain Although the use of hostnetwork is not encouraged, it is an exception in the scenario of gateways. Firstly, gateways need to expose ports such as 80 and 443, and hostnetwork is very convenient for this. Moreover, a gateway may be shared by many applications, so there will be no port conflicts. Therefore, even in a production environment, it is very convenient to use it in this way. Otherwise, it would be necessary to rely on external load balancing to expose ports 80 and 443, which would greatly increase the complexity for users, especially in situations where there is no external load balancing.

@github-actions github-actions bot removed the stale label Dec 12, 2023
@Xunzhuo Xunzhuo changed the title Feature: Add hostNetwork to the podSpec feature: add hostNetwork to the podSpec Dec 14, 2023
Copy link

@github-actions github-actions bot temporarily deployed to pull request December 14, 2023 11:08 Inactive
@Xunzhuo Xunzhuo marked this pull request as ready for review December 14, 2023 11:24
Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

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

Re-activate this issue. @fanux and his team come to me and provided me some contexts on this request, their team tries to put EG into production, but this is a blocker for them.

In their scenarios, I think this is reasonable and this would be also a common request when deploying single EG with mergeGateways enabled in a cluster, which means there will be only one single envoyproxy instance, and will be no listeners conflicts. AND in private cloud clusters, there offen will be no loadbalancer implementations, if the envoyproxy needs to expose http-80/https-443, this cannot be worked easily, which needs some changes to kubernetes.

So I am +1 for it.

@Xunzhuo Xunzhuo requested review from a team December 14, 2023 11:31
Copy link
Member

@qicz qicz left a comment

Choose a reason for hiding this comment

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

LGTM

@qicz qicz merged commit 9aebfdc into envoyproxy:main Dec 14, 2023
19 checks passed
@arkodg
Copy link
Contributor

arkodg commented Dec 18, 2023

Im still not convinced this is a good idea, the project supports multiple ways to setup a gateway in non LoadBalancer mode

  • ClusterIP
  • NodePort
  • External IP (using gateway.spec.addresses)

Setting up hostNetwork is not going to be enough and not going to work out of the box if trying to access the deployment directly, because of the custom service to container port mapping for privileged ports, this is not a bug, but a design decision, since the container port is an internal implementation and all traffic must be routed to the deployment via the service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hostNetwork support
7 participants