Hello. I was wondering if someone can help me as I’m a bit stuck. I am testing out the AWS EC2 Service discovery feature with the Data Plane API. I’ll put my configurations for both the /etc/haproxy/dataplaneapi.yml
file and the Service Discovery configuration below.
dataplaneapi.yml
config_version: 2
name: i-04568442dd67098c5
dataplaneapi:
host: 0.0.0.0
port: 5555
advertised:
api_address: ""
api_port: 0
scheme:
- http
userlist:
userlist: dataplaneapi
transaction:
transaction_dir: /var/lib/dataplaneapi/transactions
backups_number: 10
backups_dir: /var/lib/dataplaneapi/backups
resources:
maps_dir: /etc/haproxy/maps
ssl_certs_dir: /etc/haproxy/ssl
general_storage_dir: /etc/haproxy/general
spoe_dir: /etc/haproxy/spoe
haproxy:
config_file: /etc/haproxy/haproxy.cfg
haproxy_bin: /usr/sbin/haproxy
reload:
reload_delay: 5
service_name: haproxy
reload_strategy: systemd
log_targets:
- log_to: file
log_file: /var/log/dataplaneapi.log
log_level: info
log_types:
- access
- app
Service Discovery configuration
[
{
"description": "Production Environment",
"enabled": true,
"id": "e551c0e9-3796-4dd3-b33d-962c7c74e508",
"ipv4_address": "private",
"name": "ttek-prod",
"region": "eu-west-1",
"retry_timeout": 10,
"server_slots_base": 10,
"server_slots_growth_increment": 5,
"server_slots_growth_type": "exponential"
}
]
From my understanding, having unused slots should mean reloads won’t happen as often but what I am finding is that any time I add a new server to my ASG, HAProxy is reloading automatically once it sees the new server. I have a total of 10 slots available per backend (as 10 is set for server_slots_base
) and I’m only trying to add a 2nd server which I wasn’t expecting would result in a reload given my configuration. When I add a new server to my ASG, HAProxy reloads and it adds the server IP under the backend in the haproxy.cfg
file as well.
Not sure if I have something mis-configured, or maybe I’ve just misunderstood how this worked. I read in HAProxy documentation that the runtime API was meant to minimize reloads during AWS EC2 Auto scaling events. Thank you.