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

T6246: improve haproxy http check configuration #3338

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

nvollmar
Copy link
Contributor

Change Summary

Improve upon issues raised in backport PR #3332

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T6246

Related PR(s)

#3325
#3332

Component(s) name

load-balancing

Proposed changes

Improve

How to test

set load-balancing reverse-proxy service front port 4433
set load-balancing reverse-proxy service front backend bk-01

set load-balancing reverse-proxy backend bk-01 mode tcp
set load-balancing reverse-proxy backend bk-01 server s01 address 192.0.2.11
set load-balancing reverse-proxy backend bk-01 server s01 port 4438


set load-balancing reverse-proxy backend bk-01 http-check method get
set load-balancing reverse-proxy backend bk-01 http-check uri /health

set load-balancing reverse-proxy backend bk-01 http-check expect status 200

Should result in a config /run/haproxy/haproxy.cfg

# Frontend
frontend front
    bind :::4433 v4v6  
    default_backend bk-01


# Backend
backend bk-01
    option httpchk
    http-check send meth GET uri /health
    http-check expect status 200
    balance roundrobin
    mode tcp
    server s01 192.0.2.11:4438 

Smoketest result

$ /usr/libexec/vyos/tests/smoke/cli/test_load-balancing_reverse-proxy.py
test_01_lb_reverse_proxy_domain (__main__.TestLoadBalancingReverseProxy.test_01_lb_reverse_proxy_domain) ... ok
test_02_lb_reverse_proxy_cert_not_exists (__main__.TestLoadBalancingReverseProxy.test_02_lb_reverse_proxy_cert_not_exists) ... 
PKI does not contain any certificates!


Certificate "cert" not found in configuration!

ok
test_03_lb_reverse_proxy_ca_not_exists (__main__.TestLoadBalancingReverseProxy.test_03_lb_reverse_proxy_ca_not_exists) ... ok
test_04_lb_reverse_proxy_backend_ssl_no_verify (__main__.TestLoadBalancingReverseProxy.test_04_lb_reverse_proxy_backend_ssl_no_verify) ... 
backend bk-01 cannot have both ssl options no-verify and ca-certificate
set!

ok
test_05_lb_reverse_proxy_backend_http_check (__main__.TestLoadBalancingReverseProxy.test_05_lb_reverse_proxy_backend_http_check) ... ok

----------------------------------------------------------------------
Ran 5 tests in 82.459s

OK

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team April 20, 2024 21:09
@c-po c-po merged commit 6331040 into vyos:current Apr 21, 2024
7 of 8 checks passed
@nvollmar nvollmar deleted the haproxy-http-check branch April 22, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants