-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Add support for an internal load balancer along with an external one #5717
Add support for an internal load balancer along with an external one #5717
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Welcome @lgg42! |
Hi @lgg42. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
"I signed it" |
/assign @ChiefAlexander |
/ok-to-test |
This is looking good. Please squash your commits. https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#6-squashing |
Signed-off-by: Luis Garnica Guilarte <luisgarnica42@gmail.com>
5040db5
to
398f548
Compare
Squash done. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ChiefAlexander, lgg42 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 |
Thank you! for letting this PR go through so quickly 🙌 |
Signed-off-by: Luis Garnica Guilarte luisgarnica42@gmail.com
What this PR does / why we need it:
My team and people from other companies have found uses cases where they have a DNS in split-view configuration and need two ingress to handle internal and external requests for the same deployment. A way for doing this is having a second nginx ignress controller with a different class name like "nginx-internal" which handles these internal connections. This requires like mentioned to have two separate controllers and also two ingress objects per deployment.
With this method (which is proven to work and is being used in production by several people) an identical load balancer to the existing external is deployed with the same ingress controller, but the last one having annotations for being an internal load balancer.
By default ingress objects created will point to the external load balancer address. But if within the private network (AWS VPC, etc..) a host URL can be resolved to the internal load balancer address, the existing ingress controller will handle this request.
Example: (suppose an AWS VPC with Route53 split-view setup)
After chart deployment two LoadBalancers are created:
And we also create a sample app with an ingress object:
In Route53 we set a record in the public zone
Then in the private zone
If doing a request to
guestbook-app.domain.tld
from outside the VPC, the external LoadBalancer will handle it. While if making the request to the same domain within the VPC the internal LoadBalancer will handle it, But in both cases hitting the same and single nginx ingress controller.Example of DNS resolution with the previous setup
outside the VPC
within the VPC
Types of changes
Which issue/s this PR fixes
None.
How Has This Been Tested?
Environment: AWS EKS 1.16 cluster
Tests:
lint:
helm lint .
template:
helm template .
andhelm template . -f custom-values.yaml
custom-values.yaml enabled/configured the new funcionality.
First, the chart was deployed with default values. A sample app was deployed and the default external ingress worked OK.
After that, the new functionality was enabled and configured in values file and the release was upgraded with:
helm upgrade ingress-nginx charts/ingress-nginx -i --atomic --cleanup-on-fail --namespace kube-system --version 2.4.0 -f values/ingress.yaml
It created the new internal load balancer. I tested first the external load balancer → still working OK.
Then I tested the internal load balancer with the approach described in "What this PR does / why we need it"
Then I modified again the values file for disabling the new funcionality and did the same
helm upgrade
as before → The internal load balancer was taken out of service and the external load balancer kept working OK.Checklist: