canonical / canonical/haproxy-operator
Peers discarded in HAProxy due to invalid configuration
- Dominant language
- Python
- Stars
- 4
- Forks
- 12
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 22
Description
### Bug Description
While manually running the validity check for haproxy, i noticed that the peers in the peer section was being discarded:
```
ubuntu@juju-beefb2-0:~$ /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -c
[NOTICE] (22143) : haproxy version is 2.8.15-0ubuntu0.24.04.1
[NOTICE] (22143) : path to executable is /usr/sbin/haproxy
[WARNING] (22143) : config : parsing [/etc/haproxy/haproxy.cfg:73] : 'peer 10.68.79.144' : ignoring invalid peer definition (missing address:port)
[WARNING] (22143) : config : log format ignored for frontend 'prometheus' since it has no log address.
[WARNING] (22143) : config : Removing incomplete section 'peers haproxy_peers' (no peer named 'juju-beefb2-0').
Warnings were found.
Configuration file is valid
```
Looking at our haproxy_route template, this is the peer section:
```
peers haproxy_peers
{% for address in peer_units_address %}
peer {{ address }}
{% endfor %}
```
Whereas according to the HAProxy [documentation](https://docs.haproxy.org/2.4/configuration.html#3.5), Peers have to be defined like this:
```
peers mycluster
peer loadbalancer1 192.168.1.10:10000
peer loadbalancer2 192.168.1.11:10000
```
Peers are currently being discarded by HAProxy due to this.
### To Reproduce
.
### Environment
.
### Relevant log output
```shell
.
```
### Additional context
.
Contributor guide
Assessment
This issue has not been assessed yet.