https://github.com/lhns/docker-swarm-keepalived
Operator for keepalived on docker swarm
https://github.com/lhns/docker-swarm-keepalived
docker failover ha keepalived metallb swarm vrrp
Last synced: 7 months ago
JSON representation
Operator for keepalived on docker swarm
- Host: GitHub
- URL: https://github.com/lhns/docker-swarm-keepalived
- Owner: lhns
- License: apache-2.0
- Created: 2021-01-09T02:42:50.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-02T17:20:23.000Z (almost 2 years ago)
- Last Synced: 2024-02-14T21:57:37.075Z (over 1 year ago)
- Topics: docker, failover, ha, keepalived, metallb, swarm, vrrp
- Language: Shell
- Homepage: https://hub.docker.com/r/lolhens/keepalived-swarm
- Size: 42 KB
- Stars: 19
- Watchers: 3
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-swarm-keepalived
[](https://github.com/lhns/docker-swarm-keepalived/actions?query=workflow%3Abuild)
[](https://hub.docker.com/r/lolhens/keepalived-swarm)
[](https://hub.docker.com/r/lolhens/keepalived-swarm)
[](https://hub.docker.com/r/lolhens/keepalived-swarm)
[](https://www.apache.org/licenses/LICENSE-2.0)Operator for [keepalived](https://github.com/acassen/keepalived) on docker swarm.
Uses [osixia/docker-keepalived](https://github.com/osixia/docker-keepalived).
## Usage
- Enable the "ip_vs" kernel module if not enabled
```sh
lsmod | grep -P '^ip_vs\s' || (echo "modprobe ip_vs" >> /etc/modules && modprobe ip_vs)
```
- Set a different priority for each node
```sh
docker node update node1 --label-add KEEPALIVED_PRIORITY=100
docker node update node2 --label-add KEEPALIVED_PRIORITY=101
docker node update node3 --label-add KEEPALIVED_PRIORITY=102
```
- Deploy the stack## Docker images
https://github.com/lhns/docker-swarm-keepalived/pkgs/container/keepalived-swarm
## Docker Stack
```yml
version: '3.8'services:
keepalived:
image: ghcr.io/lhns/keepalived-swarm
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- host
deploy:
mode: global
placement:
constraints: [node.role == manager]
environment:
KEEPALIVED_VIRTUAL_IPS: "192.168.1.231, 192.168.1.232"networks:
host:
external: true
name: host
```## Helpful Links
- https://github.com/acassen/keepalived
- https://github.com/osixia/docker-keepalived
- https://geek-cookbook.funkypenguin.co.nz/ha-docker-swarm/keepalived/## License
This project uses the Apache 2.0 License. See the file called LICENSE.