You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://imagelayers.io/?images=osixia/keepalived:latest'Get your own badge on imagelayers.io')
3
+
[](https://imagelayers.io/?images=osixia/keepalived:latest'Get your own badge on imagelayers.io') | Latest release: 0.2.0 - Keepalived 1.2.19 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/keepalived/)
4
4
5
5
A docker image to run Keepalived.
6
6
> [keepalived.org](http://keepalived.org/)
7
7
8
+
-[Quick start](#quick-start)
9
+
-[Beginner Guide](#beginner-guide)
10
+
- [Use your own Backup Manager config](#use-your-own-backup-manager-config)
11
+
- [Debug](#debug)
12
+
-[Environment Variables](#environment-variables)
13
+
- [Set your own environment variables](#set-your-own-environment-variables)
14
+
- [Use command line argument](#use-command-line-argument)
15
+
- [Link environment file](#link-environment-file)
16
+
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
- [Make your own keepalived image](#make-your-own-keepalived-image)
20
+
- [Tests](#tests)
21
+
- [Under the hood: osixia/light-baseimage](#under-the-hood-osixialight-baseimage)
22
+
-[Changelog](#changelog)
23
+
8
24
## Quick start
9
25
10
26
This image require the kernel module ip_vs loaded on the host (`modprobe ip_vs`) and need to be run with : --cap-add=NET_ADMIN --net=host
11
27
12
-
docker run --cap-add=NET_ADMIN --net=host -d osixia/keepalived
28
+
docker run --cap-add=NET_ADMIN --net=host -d osixia/keepalived:0.2.0
29
+
30
+
## Beginner Guide
31
+
32
+
### Use your own Keepalived config
33
+
This image comes with a keepalived config file that can be easily customized via environment variables for a quick bootstrap,
34
+
but setting your own keepalived.conf is possible. 2 options:
35
+
36
+
- Link your config file at run time to `/container/service/keepalived/assets/keepalived.conf` :
37
+
38
+
docker run --volume /data/my-keepalived.conf:/container/service/keepalived/assets/keepalived.conf --detach osixia/keepalived:0.2.0
39
+
40
+
- Add your config file by extending or cloning this image, please refer to the [Advanced User Guide](#advanced-user-guide)
41
+
42
+
### Debug
43
+
44
+
The container default log level is **info**.
45
+
Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
46
+
47
+
Example command to run the container in `debug` mode:
48
+
49
+
docker run --detach osixia/keepalived:0.2.0 --loglevel debug
50
+
51
+
See all command line options:
52
+
53
+
docker run osixia/keepalived:0.2.0 --help
54
+
13
55
14
56
## Environment Variables
15
57
16
-
Environement variables defaults are set in **image/env.yaml**. You can modify environment variable values directly in this file and rebuild the image ([see manual build](#manual-build)). You can also override those values at run time with -e argument or by setting your own env.yaml file as a docker volume to `/container/environment/env.yaml`. See examples below.
58
+
Environment variables defaults are set in **image/environment/default.yaml**
59
+
60
+
See how to [set your own environment variables](#set-your-own-environment-variables)
61
+
17
62
18
63
-**KEEPALIVED_INTERFACE**: Keepalived network interface. Defaults to `eth0`
19
64
-**KEEPALIVED_PASSWORD**: Keepalived password. Defaults to `d0cker`
@@ -23,35 +68,76 @@ Environement variables defaults are set in **image/env.yaml**. You can modify en
23
68
- 192.168.1.10
24
69
- 192.168.1.11
25
70
26
-
If you want to set this variable at docker run command convert the yaml in python:
71
+
If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python:
27
72
28
-
docker run -e KEEPALIVED_UNICAST_PEERS="[192.168.1.10', '192.168.1.11']" -d osixia/phpldapadmin
73
+
docker run --env KEEPALIVED_UNICAST_PEERS="#PYTHON2BASH:['192.168.1.10', '192.168.1.11']" --detach osixia/keepalived:0.2.0
29
74
30
75
To convert yaml to python online : http://yaml-online-parser.appspot.com/
31
76
32
77
33
-
-**KEEPALIVED_VIRTUAL_IPS**Add a read only user. Defaults to :
78
+
-**KEEPALIVED_VIRTUAL_IPS**Keepalived virtual IPs. Defaults to :
34
79
35
80
- 192.168.1.231
36
81
- 192.168.1.232
37
82
38
-
If you want to set this variable at docker run command convert the yaml in python, see above.
83
+
If you want to set this variable at docker run command convert the yaml in python, see above.
39
84
40
85
-**KEEPALIVED_NOTIFY** Script to execute when node state change. Defaults to `/container/service/keepalived/assets/notify.sh`
41
86
87
+
-**KEEPALIVED_COMMAND_LINE_ARGUMENTS** Keepalived command line arguments; Defaults to `--log-detail --dump-conf`
88
+
42
89
### Set environment variables at run time :
43
90
44
91
Environment variable can be set directly by adding the -e argument in the command line, for example :
45
92
46
-
docker run -e KEEPALIVED_INTERFACE="eno1" -e KEEPALIVED_PASSWORD="password!" \
47
-
-e KEEPALIVED_PRIORITY="100" -d osixia/keepalived
93
+
docker run --env KEEPALIVED_INTERFACE="eno1" --env KEEPALIVED_PASSWORD="password!" \
For example if your environment file is in : /data/environment/my-env.yaml
113
+
114
+
docker run --volume /data/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
115
+
--detach osixia/keepalived:0.2.0
116
+
117
+
Take care to link your environment file to `/container/environment/XX-somedir` (with XX < 99 so they will be processed before default environment files) and not directly to `/container/environment` because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).
118
+
119
+
#### Make your own image or extend this image
120
+
121
+
This is the best solution if you have a private registry. Please refer to the [Advanced User Guide](#advanced-user-guide) just below.
122
+
123
+
## Advanced User Guide
124
+
125
+
### Extend osixia/keepalived:0.2.0 image
126
+
127
+
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
0 commit comments