NodePortLB support in kubernetes gateway provider#12175
Open
jorisvergeer wants to merge 6 commits intotraefik:masterfrom
Open
NodePortLB support in kubernetes gateway provider#12175jorisvergeer wants to merge 6 commits intotraefik:masterfrom
jorisvergeer wants to merge 6 commits intotraefik:masterfrom
Conversation
| uniqAddresses := map[string]struct{}{} | ||
| var backendServers []backendAddress | ||
|
|
||
| for _, node := range nodes { |
Contributor
There was a problem hiding this comment.
If externalTrafficPolicy is Local then you shouldn't include all nodes?
Contributor
Author
Contributor
|
Hey @jorisvergeer, Thank you for your contribution. We've set the status to "design-review" to allow us to check the PR and ensure there is no deep impact on Traefik before moving forward. We'll keep you updated once the analysis is done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds NodePort Load Balancing capabilities to the kubernetes gateway provider. Similar to how this is implemented in kubernetes CRD provider and kubernetes Ingress provider.
Motivation
I run traefik outside my cluster on its own instance, because i have some services running outside Kubernetes and some inside.
Therefore back in the early days of traefik 2.10/3.0 I implemented NodePort loadbalancing #10278.
Now that the gateway api is widely available, i kind of prefer that way to defining routes. If only traefik supported NodePort load balancing in the gateway provider.... well... now it does.
More
Additional Notes
After the #10278 PR there was an issue with RBAC to access node resources (Issue #10937). I updated the RBAC for the gateway api, added a note in the documentation migration page and added an option to disable the lookup of node resources altogether (disabling nodeport load balancing)
I understand the RBAC in k8s, but i don't know the full extent what the links are between each part RBAC role, binding and traefik. So, I'd like a second pair of eyes to have a look at this to not have the same or similar issue this time.
To consider
To mitigate the additional access to node resources, this feature might also be an opt in (providers.kubernetesgateway.enablenodeportlb), but this would be different than the other implementations of nodePort load balancing.