https://github.com/dyrnq/local-haproxy
local-haproxy
https://github.com/dyrnq/local-haproxy
haproxy haproxy-docker haproxy-sidecar local-haproxy sidecar-harproxy
Last synced: about 1 month ago
JSON representation
local-haproxy
- Host: GitHub
- URL: https://github.com/dyrnq/local-haproxy
- Owner: dyrnq
- Created: 2024-07-08T01:53:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-25T12:09:05.000Z (2 months ago)
- Last Synced: 2026-03-26T14:54:15.184Z (2 months ago)
- Topics: haproxy, haproxy-docker, haproxy-sidecar, local-haproxy, sidecar-harproxy
- Language: Shell
- Homepage: https://hub.docker.com/r/dyrnq/local-haproxy
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# local-haproxy
use `bash` and env generate `/usr/local/etc/haproxy/local.cfg` and append `-f /usr/local/etc/haproxy/local.cfg` to haproxy
## features
- keepalived-free
- update host `/etc/hosts` if set `FQDN` and `FQDN_IP`
- healthcheck
## envs
| name | describe | default |
|------------------------------|--------------------------------|------------------------------|
| IP | fronted ip | autodetect |
| IP_AUTODETECTION_METHOD | fronted ip autodetection | first-found |
| PORT | fronted port | 8443 |
| FRONTEND_NAME | fronted name | frontend_${PORT} |
| BACKEND_NAME | backend name | backend_${PORT} |
| MODE | mode | tcp |
| FRONTEND_MODE | fronted mode | ${MODE} |
| BACKEND_MODE | backend mode | ${MODE} |
| BALANCE | balance | roundrobin |
| ADV_CHECK | adv_check | httpchk |
| HTTP_CHECK | http_check | http-check expect status 200 |
| HTTPCHK_PARAMS | httpcheck_params | GET /livez |
| BACKEND_SERVER | backend_server comma separated | |
| FQDN_IP | fqdn_ip | autodetect |
| FQDN_IP_AUTODETECTION_METHOD | fqdn_ip autodetection | ${IP_AUTODETECTION_METHOD} |
| FQDN | fqdn | |
| HOSTS_FILE | hosts file path | /host/etc/hosts |
| VRRBOSE | verbose | |
## run
### docker
```bash
docker \
run \
-d \
--name local-haproxy \
--restart always \
--privileged \
--network host \
--env "IP_AUTODETECTION_METHOD=interface=eth1" \
--env "BACKEND_SERVER=192.168.55.111:6443 check check-ssl verify none,192.168.55.112:6443 check check-ssl verify none,192.168.55.113:6443 check check-ssl verify none" \
--env "FQDN=demo.local" \
--env "FQDN_IP_AUTODETECTION_METHOD=interface=eth1" \
--volume /etc/hosts:/host/etc/hosts:rw \
dyrnq/local-haproxy:latest
```
### kubernetes static-pod
```bash
cat > /etc/kubernetes/manifests/local-haproxy.yaml <