Managed Kubernetes services such as Google or IBM Cloud will provide an external load balancer. Since our Kubernetes environment is standalone, we do not have an external load balancer; we install and use keepalived as a load balancer.
The keepalived load balancer depends on the ip_vs kernel module to be loaded. Follow these steps:
- Make sure that the ip_vs kernel module is loaded:
$ sudo lsmod | grep ^ip_vs
ip_vs_wlc 12519 0
ip_vs 145497 2 ip_vs_wlc
- If the preceding does not show any output, load the module:
$ sudo ipvsadm -ln
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
- Run sudo lsmod | grep ^ip_vs to make sure that the module is loaded.
- Add ip_vs to the module list so that it is loaded automatically on reboot:
$ echo "ip_vs" | sudo...