Skip to content
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

HAproxy bindings #201

Open
alexarefev opened this issue Jul 15, 2022 · 2 comments
Open

HAproxy bindings #201

alexarefev opened this issue Jul 15, 2022 · 2 comments
Labels
assessed Issue is assessed and confirmed. RC if found improvement New feature or request

Comments

@alexarefev
Copy link
Collaborator

alexarefev commented Jul 15, 2022

Currently, HAProxy as a dedicated balancer (the balancer node does not has any other roles except the balancer) has the following bindings for frontends:

frontend https
    bind                :::443
    bind                0.0.0.0:443
...
frontend http
    bind                :::80
    bind                0.0.0.0:80

Current configuration does not cover any possible cases. For instance, the balancer may have more than one physical network interface and additional interface should not be listened by HAproxy.

@koryaga
Copy link
Contributor

koryaga commented Sep 8, 2022

@theboringstuff pls assess

@theboringstuff
Copy link
Collaborator

theboringstuff commented Sep 8, 2022

I think we are just lacking feature which would allow us to flexibly specify which interfaces haproxy should bind.
It is assumed that haproxy should listen to at least assigned vrrp ips, but in practice it listens all interfaces on dedicated lb.

I suggest that we do not break backward compatibility. If we want to make binding more flexible, we could introduce additional optional parameters, like:

# For each vrrp_ips
bindLoadBalancer: true    # Default: true. If true, vrrp_ip belonging to LB node will be added to bindings. Maintenance mode is controlled additionally.

# For load balancer
bindAll: true     # Default: true for dedicated LB, false in other case. If true - bind to all interfaces, except maintenance mode.
bindCustom:    # Default: nil. Additional user-defined IPs to bind to. 
  - node: lb-1
    bindings:
    - ip: 1.1.1.1
    - ip: 2.2.2.2
  - node: lb-2
    bindings:
    - ip: 3.3.3.3
    - ip: 4.4.4.4

So basically algorithm is following, for each LB node:

  1. If bindAll==true - just bind 0.0.0.0, except maintenance mode
  2. If bindAll==false
    1. For assigned vrrp ips check bindLoadBalancer param. Add to bindings if true (considering maintenance mode params).
    2. If bindCustom!=nil - add custom to bindings.
    3. If bindings are empty - fail. Otherwise use bindings.

@koryaga koryaga added the improvement New feature or request label Sep 9, 2022
@koryaga koryaga added the assessed Issue is assessed and confirmed. RC if found label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assessed Issue is assessed and confirmed. RC if found improvement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants