canonical / canonical/haproxy-operator

Peers discarded in HAProxy due to invalid configuration

Open
#326 1 comment 2 reactions 2 assignees Claimed by @Thanhphan1147 View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.