-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Pass k8s Service
data through to the TCP balancer script.
#3615
Pass k8s Service
data through to the TCP balancer script.
#3615
Conversation
Fixes broken L4 ExternalName services. Details --------- The `tcp_udp_balancer.lua` script checks if the property `backend.service.spec["type"]` equals "ExternalName". If so, the script does a DNS lookup on the name in order to configure the backend configuration. However, before this commit, the k8s `Service` data was _not_ set on the `Backend` struct passed into the `tcp_udp_balancer.lua` script and therefore the ExternalName check always returned false. This commit fixes the issue by setting the `Service` field on the `Backend` struct. This also requires adding a new field to the `L4Backend` struct first, so that it's available to set on the `Backend`.
f7a4558
to
f0173f0
Compare
internal/ingress/controller/nginx.go
Outdated
@@ -829,6 +830,7 @@ func configureDynamically(pcfg *ingress.Configuration, port int, isDynamicCertif | |||
Name: key, | |||
Endpoints: ep.Endpoints, | |||
Port: intstr.FromInt(ep.Port), | |||
Service: ep.Service, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check https://github.com/kubernetes/ingress-nginx/pull/3615/files#diff-cde3fffe2425ad7efaa8add1d05ae2c0R784. We should not send a full service object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the callout @ElvinEfendi. I've addressed this in the latest commit.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ElvinEfendi, kppullin 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 |
Thanks @kppullin ! Would be more complete to create an e2e test for this to make sure ExternalName works in stream mode. |
What this PR does / why we need it:
Fixes broken L4 ExternalName services.
The
tcp_udp_balancer.lua
script checks if the propertybackend.service.spec["type"]
equals"ExternalName"
. If so,the script does a DNS lookup on the name in order to configure
the backend configuration.
However, before this commit, the k8s
Service
data wasnot set on the
Backend
struct passed into thetcp_udp_balancer.lua
script and therefore the
ExternalName
check always returned false.This commit fixes the issue by setting the
Service
field onthe
Backend
struct. This also requires adding a new field to theL4Backend
struct, so that it's available to set on theBackend
.