diff --git a/keepalived/docker-compose.yml b/keepalived/docker-compose.yml index ef594f2..2d7d28a 100644 --- a/keepalived/docker-compose.yml +++ b/keepalived/docker-compose.yml @@ -4,34 +4,19 @@ services: container_name: keepalived restart: unless-stopped network_mode: host - # Privileged is often required to manipulate Host Network Interfaces - privileged: true - # capabilities are good, but 'privileged' is safer for network manipulation in LXC cap_add: - NET_ADMIN - NET_BROADCAST - NET_RAW volumes: - # Inject the check script + # 1. Mount the Check Script Folder - /docker/keepalived/checks:/checks + # 2. Mount the Config File (The Nuclear Option) + - /docker/keepalived/config:/config environment: - - KEEPALIVED_INTERFACE=eth0 - - KEEPALIVED_ROUTER_ID=51 - - KEEPALIVED_VIRTUAL_IPS=172.16.201.250 # Your VIP - - KEEPALIVED_PASSWORD=${DNS_ADMIN_PASSWORD} - - # MASTER/BACKUP Logic (Using Variables) - # On PVE2: Set KEEPALIVED_STATE=MASTER, PRIORITY=101 - # On PVE1: Set KEEPALIVED_STATE=BACKUP, PRIORITY=100 - - KEEPALIVED_STATE=${KEEPALIVED_STATE} - - KEEPALIVED_PRIORITY=${KEEPALIVED_PRIORITY} - - KEEPALIVED_UNICAST_PEERS=${KEEPALIVED_UNICAST_PEERS} - - # The Magic Check: Monitors Komodo! - - KEEPALIVED_CHECK_SCRIPT=/checks/check_komodo.sh - - KEEPALIVED_CHECK_INTERVAL=2 - - KEEPALIVED_CHECK_RISE=1 - - KEEPALIVED_CHECK_FALL=2 - - KEEPALIVED_CHECK_WEIGHT=-5 \ No newline at end of file + # We still need this to tell the container where to look + - KEEPALIVED_CONFIG=/config/keepalived.conf + # We can remove all the other KEEPALIVED_* variables now! + # (They are handled inside the file) \ No newline at end of file