Ingress is going on all the nodes #10437
-
Environmental Info:
Node(s) CPU architecture, OS, and Version:
Cluster Configuration:
In 2 different datacenters. Describe the bug: Steps To Reproduce: Common variables:
My K3S server config:
My K3S agent config:
I tried this https://docs.k3s.io/networking/networking-services#controlling-servicelb-node-selection . My nodes have different labels:
Then, I wasn't sure which label and on which Kind of resource to place it, so I applied both labels:
on resources:
Expected behavior: That checking the ingresses would show only 1 address service it like:
Actual behavior: Checking the ingresses, the 2 nodes are still serving it:
Additional context / logs:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
The ingress is exposed via a loadbalancer. the default loadbalancer for k3s is servicelb, which is documented here: https://docs.k3s.io/networking/networking-services#service-load-balancer The docs cover limiting which nodes the loadbalancer uses. |
Beta Was this translation helpful? Give feedback.
-
yes that is the documentation I said I was following. I tried putting the labels everywhere without success (as I explained) I have no clue what is missing right now. So, there is one problem:
Could you give me some pointers if that is just a documentation issue? thanks |
Beta Was this translation helpful? Give feedback.
-
I downloaded K3S's code and it looks like the problem is that the k3s code is only selecting nodes for LoadBalancer So, in other words, that cannot work. It seems I would need to:
You might consider automatically doing that. For instance, when |
Beta Was this translation helpful? Give feedback.
-
It is easy enough to do that for yourself, if that's something you want. Most people don't. If you just wanted the ingress to only use a single node, you could just only label that node with If you want more fine grained control, you could:
If you want to be able to use different ingress classes for different nodes then yes, that will take much more customization and likely multiple installations of the traefik ingress controller, each bound to its own service and lbpool. |
Beta Was this translation helpful? Give feedback.
I downloaded K3S's code and it looks like the problem is that the k3s code is only selecting nodes for LoadBalancer
and if we check the "traefik" service that k3s installs, its LoadBalancer part doesn't have a
svccontroller.k3s.cattle.io/lbpool
(so it picks all nodes).So, in other words, that cannot work.
It seems I would need to:
svccontroller.k3s.cattle.io/lbpool=tor1_1
svccontroller.k3s.cattle.io/lbpool=fra1_1
Ingress
theingressClassName
for the right load-balancer pool to use.You might consid…