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

Support configuring loadBalancerIP in envoy svc #2017

Merged
merged 3 commits into from
Oct 20, 2023

Conversation

arkodg
Copy link
Contributor

@arkodg arkodg commented Oct 19, 2023

Fixes: #1841

@arkodg arkodg requested a review from a team as a code owner October 19, 2023 18:03
@arkodg arkodg requested review from a team, qicz, LanceEa and chauhanshubham and removed request for a team October 19, 2023 18:04
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #2017 (3834fe2) into main (ffd5418) will decrease coverage by 0.12%.
The diff coverage is 70.00%.

@@            Coverage Diff             @@
##             main    #2017      +/-   ##
==========================================
- Coverage   65.78%   65.66%   -0.12%     
==========================================
  Files          93       93              
  Lines       13589    13599      +10     
==========================================
- Hits         8939     8930       -9     
- Misses       4104     4119      +15     
- Partials      546      550       +4     
Files Coverage Δ
...nal/infrastructure/kubernetes/resource/resource.go 96.66% <100.00%> (+0.17%) ⬆️
api/v1alpha1/validation/envoyproxy_validate.go 73.50% <57.14%> (-0.80%) ⬇️

... and 2 files with indirect coverage changes

// LoadBalancerIP defines the IP Address of the underlying load balancer service. This field
// may be ignored if the load balancer provider does not support this feature.
// This field has been Deprecated, but it is still used for set the IP Address in some cloud
// providers such as GCP.
Copy link
Contributor

Choose a reason for hiding this comment

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

it's deprecated, maybe use annotations to support this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not possible for GCP, the linked issue has all the details:)

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for clearify.

Copy link
Contributor

Choose a reason for hiding this comment

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

what will happen if someone config this by mistake on non-GCP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#1841 (comment)
has the details, looks like all still support it except AWS and I'm unsure what happens when it is set, any idea @LanceEa ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @LanceEa can you please review the API doc string in this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

My guess is either it is ignored or like GCP the admission controller would reject the fields it doesn't support.

Copy link
Contributor

Choose a reason for hiding this comment

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

What I'm thinking is should EG auto-detect cloud provider, and reject/ignore this field if it's non-GCP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zirain in the process of improving user experience, we will end up making it worse because this field is still supported in Azure and some AWS controllers, so im a -1 on any auto detect cloud logic

Copy link
Contributor

Choose a reason for hiding this comment

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

@arkodg - I agree. At that point I think we would be over engineering it and would end up with more pain maintaining it. Instead I think leaning on documentation is a better approach.

@arkodg arkodg requested review from zirain and LanceEa October 19, 2023 20:05
zirain
zirain previously approved these changes Oct 20, 2023
errs = append(errs, fmt.Errorf("loadBalancerIP can only be set for %v type", egv1a1.ServiceTypeLoadBalancer))
}

if net.ParseIP(*serviceLoadBalancerIP) == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker for me but ParseIP will also parse an IPV6 address successfully so it could be nice to give the user earlier feedback.

But realistically most users setting this field have read the Kubernetes docs or can at least search them easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for flagging this, adding a check to only allow ipv4

Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Arko Dasgupta <[email protected]>
@arkodg arkodg merged commit 930592c into envoyproxy:main Oct 20, 2023
18 checks passed
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.

Allow to set Service LoadBalancer IP
4 participants