Skip to content

Commit 5aca605

Browse files
upd
add example docker-compose
1 parent 4851ca4 commit 5aca605

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ docker run -d --restart=always \
124124
| KEEPALIVED_UNICAST_PEER | X | Y |
125125
| KEEPALIVED_VIRTUAL_IPADDRESS | X | Y |
126126

127-
## docker swarm see [keepalived-service.yml](./keepalived-service.yml)
127+
## Example
128+
129+
_docker swarm service see [keepalived-service.yml](./example/keepalived-service.yml)_
128130

129131
### deploy to swarm cluster
130132

@@ -134,3 +136,5 @@ docker run -d --restart=always \
134136
* `<node>` see cluster nodes `docker node ls`
135137
* `docker node update --label-add <label> <node>`
136138
* `docker stack deploy -c keepalived-service.yml keepalived`
139+
140+
_docker service see [docker-compose.yml](./example/docker-compose.yml)_

example/docker-compose.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
version: '3.9'
3+
4+
services:
5+
master:
6+
image: rootshellcoder/swarm-keepalived:latest
7+
environment:
8+
KEEPALIVED_UNICAST_SRC_IP: "172.16.5.4"
9+
KEEPALIVED_UNICAST_PEER: "172.16.5.5, 172.16.5.6"
10+
KEEPALIVED_VIRTUAL_IPADDRESS: "192.168.100.254, 192.168.10.254"
11+
KEEPALIVED_PRIORITY: "200"
12+
KEEPALIVED_INTERFACE: "eth0"
13+
network_mode: host
14+
restart: always
15+
cap_add:
16+
- NET_ADMIN
17+
- NET_BROADCAST
18+
- NET_RAW
File renamed without changes.

0 commit comments

Comments
 (0)