Coder Social home page Coder Social logo

Comments (4)

brandond avatar brandond commented on August 19, 2024

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.

from k3s.

simonfoilen avatar simonfoilen commented on August 19, 2024

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:

  • documentation is imcomplete/unclear
  • documentation has a bug
  • or the implementation has a bug

Could you give me some pointers if that is just a documentation issue?

thanks

from k3s.

simonfoilen avatar simonfoilen commented on August 19, 2024

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:

  • disable traefik
  • install traefik myself with
    • 2 services:
      • traefik-tor1_1 : with svccontroller.k3s.cattle.io/lbpool=tor1_1
      • traefik-fra1_1 : with svccontroller.k3s.cattle.io/lbpool=fra1_1
    • 2 Ingress classes
      • traefik-tor1_1
      • traefik-fra1_1
  • Then, I will be able to set on my Ingress the ingressClassName for the right load-balancer pool to use.

You might consider automatically doing that. For instance, when svccontroller.k3s.cattle.io/enablelb=true, you could split traefik like that.
What do you think?

from k3s.

brandond avatar brandond commented on August 19, 2024

if we check the "traefik" service that k3s installs, its LoadBalancer part doesn't have a svccontroller.k3s.cattle.io/lbpool

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 svccontroller.k3s.cattle.io/enablelb=true and do nothing else; nodes that don't have that label will not be used for servicelb.

If you want more fine grained control, you could:

  1. Label the node you want the ingress to use with svccontroller.k3s.cattle.io/lbpool=traefik and svccontroller.k3s.cattle.io/enablelb=true
  2. Add a HelmChartConfig to add this same label to the traefik service, as described at https://docs.k3s.io/helm#customizing-packaged-components-with-helmchartconfig
    apiVersion: helm.cattle.io/v1
    kind: HelmChartConfig
    metadata:
      name: traefik
      namespace: kube-system
    spec:
      valuesContent: |-
        service:
          labels:
            svccontroller.k3s.cattle.io/lbpool: traefik

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.

from k3s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.