An open API service indexing awesome lists of open source software.

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

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 <