From 139384cb28f1033f81cb2efffc17de85bb290369 Mon Sep 17 00:00:00 2001 From: sangyun Date: Wed, 17 Jan 2024 18:36:31 +0900 Subject: [PATCH] update readme --- README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/README.md b/README.md index e69de29..d9da807 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,40 @@ +## Start Docker + +```sh +# build dockerfile +sudo docker build -t keepalived . + +# docker run +sudo docker run -d --rm \ +--cap-add=NET_ADMIN \ +--net=host \ +-e KEEPALIVED_ROUTER_ID=1 \ +-e KEEPALIVED_STATE=MASTER \ +-e KEEPALIVED_PRIORITY=100 \ +-e KEEPALIVED_PASSWORD=1111 \ +-e KEEPALIVED_INTERFACE=ovs_eth0 \ +-e KEEPALIVED_UNICAST_PEERS=192.168.0.100,192.168.0.246 \ +-e KEEPALIVED_VIRTUAL_IPS=192.168.0.180 \ +keepalived +``` + +## Start docker compose +```yml +version: '3.5' + +services: + keepalived: + build: . + environment: + KEEPALIVED_ROUTER_ID: 1 # [require] RouterID + KEEPALIVED_STATE: MASTER # Defualt State MASTER, BACKUP, default : BACKUP + KEEPALIVED_PRIORITY: 100 # priority, defualt : 1~199 random + KEEPALIVED_PASSWORD: 1111 # auth password + KEEPALIVED_INTERFACE: ovs_eth0 # [require] network interface in host + KEEPALIVED_UNICAST_PEERS: 192.168.0.100,192.168.0.246 # [require] peer clients, split comma + KEEPALIVED_VIRTUAL_IPS: 192.168.0.180 # [require] virtual ip, split comma + network_mode: host + cap_add: + - NET_ADMIN +``` +