osixia/keepalived

By osixia

Updated 4 months ago

Keepalived container image with dynamic configuration and hot reload 🐳🛟🌴

Image
Networking
44

1M+

osixia/keepalived repository overview

osixia/keepalived 🐳🛟🌴

Keepalived container image for VRRP high availability and VIP failover with dynamic configuration and hot reload.

osixia/keepalived logo.

⚡ Quickstart

This image requires the ip_vs kernel module to be loaded on the host (modprobe ip_vs).
It must be run with the following Docker options:

docker run --cap-add=NET_ADMIN --cap-add=NET_RAW --cap-add=NET_BROADCAST --network=host osixia/keepalived

Using your own Keepalived configuration

This image ships with a Keepalived configuration template that can be customized using environment variables for quick bootstrapping.

You can also provide your own keepalived.conf by mounting it at the path defined by KEEPALIVED_CONF (default: /etc/keepalived/keepalived.conf):

docker run --volume /data/my-keepalived.conf:/etc/keepalived/keepalived.conf osixia/keepalived

Passing command-line arguments to Keepalived

The osixia/keepalived container allows you to pass additional command-line arguments directly to the keepalived binary.

Arguments specified after -- are forwarded to the keepalived process inside the container:

docker run osixia/keepalived -- --dont-release-ipvs

Debugging

To debug the container manually, you can start it with an interactive shell.

The --log-level debug --bash options from osixia/baseimage enables debug logging and launches an interactive shell.

If Keepalived keeps crashing, you can add --skip-process to start the container without launching service processes.

docker run -it osixia/keepalived --log-level debug --bash
docker run -it osixia/keepalived --skip-process --log-level debug --bash

You can also enable Keepalived debugging options:

docker run osixia/keepalived -- --log-detail --dump-conf

To see all available command-line options:

docker run --rm osixia/keepalived --help # osixia/baseimage options
docker run --rm osixia/keepalived -x keepalived -- --help # keepalived command-line options

🔤 Environment Variables

VariableDescriptionDefault
KEEPALIVED_CONFPath to the Keepalived configuration file/etc/keepalived/keepalived.conf
KEEPALIVED_CONF_TEMPLATEPath to the configuration template used to generate keepalived.conf/container/services/keepalived-conf/assets/confs/keepalived.conf.template
KEEPALIVED_CONF_RELOAD_SCRIPTScript executed when configuration changes are detected/container/services/keepalived-conf/assets/scripts/reload.sh
KEEPALIVED_INTERFACENetwork interface used by VRRPeth0
KEEPALIVED_STATEInitial VRRP state (MASTER or BACKUP)BACKUP
KEEPALIVED_ROUTER_IDVRRP router ID51
KEEPALIVED_PRIORITYVRRP priority of the node150
KEEPALIVED_UNICAST_PEERSList of peer nodes used for VRRP unicast communication192.168.1.10 192.168.1.11
KEEPALIVED_VIRTUAL_IPSVirtual IP addresses managed by Keepalived192.168.1.231 192.168.1.232
KEEPALIVED_PASSWORDVRRP authentication passwordd0cker
KEEPALIVED_NOTIFY_SCRIPTScript executed when Keepalived state changes/container/services/keepalived/assets/scripts/notify.sh

📄 Documentation

See full documentation and complete features list on osixia/keepalived documentation.

This image is based on osixia/baseimage.

⭐ Source Code

Browse source code and contribute to this project on GitHub.

Tag summary

Content type

Image

Digest

sha256:190269186

Size

17.1 MB

Last updated

4 months ago

docker pull osixia/keepalived:2