Closed rnz closed 3 years ago
Due to the nature of containers, and their designed separation from the host system, it is simply not possible to load a kernel module from within a container. The solution is for you to load the kernel module(s) required by keepalived prior to starting keepalived in the container. Probably the simplest way to do this if you want it done permanently is to add a file such as keepalived.conf
in /etc/modprobe.d
and specify the required modules.
The modules that keepalived currently attempts to load if they are not currently loaded are xt_set and ip_vs (although I suspect it should also load the ip_tables module too if it is not loaded, and possibly the nf_tables module - I will need to check these).
BTW the version of keepalived you are using is extremely old, and there have been thousands of improvements since v1.3.2. The current version is v2.2.1.
@pqarmitage modules already preloaded on host:
# lsmod | grep xt_set
xt_set 16384 94
ip_set 40960 2 xt_set,ip_set_hash_net
x_tables 40960 21 ebtables,ip6table_filter,xt_conntrack,iptable_filter,xt_multiport,xt_tcpudp,ipt_MASQUERADE,xt_addrtype,xt_CHECKSUM,xt_physdev,xt_nat,xt_ipvs,xt_comment,xt_set,ip6_tables,ipt_REJECT,ip_tables,ip6t_REJECT,iptable_mangle,xt_REDIRECT,xt_mark
On all hosts in proxmox cluster:
# egrep -v '^#|^$' /etc/modules
bonding
overlay
ip_vs
ip_vs_dh
ip_vs_ftp
ip_vs_lblc
ip_vs_lblcr
ip_vs_lc
ip_vs_nq
ip_vs_rr
ip_vs_sed
ip_vs_sh
ip_vs_wlc
ip_vs_wrr
xfrm_user
nf_nat
br_netfilter
xt_conntrack
xt_set
Same problem is present in docker containers or in kubernetes containers.
Problem is not solved and need more attention.
I hadn't remembered, since v1.3.2 is so old, but I have changed the code around loading the xt_set module since v1.3.2 more than once. So far as I can see, you need keepalived v2.0.20 or later, but since you will presumably have to build the code yourself, you will be best off using the latest version, v2.2.1.
Describe the bug keepalived doesn't work inside LXC container
To Reproduce create lxc container (debian 9 on debian 9 host) inside lxc container install keepalived look logs
Expected behavior keepalived start and work
Keepalived version
Distro (please complete the following information):
Details of any containerisation or hosted service (e.g. AWS) Proxmox 5.4
Configuration file:
System Log entries