Skip to main content

keepalived (keepalived)

Holds the virtual IP of an HAProxy pair with VRRP: the address moves to the standby host when HAProxy or its host fails.

Generated from catalog/services/keepalived.yaml: do not edit by hand.

Summary​

Version2.4.3
Useinstall and configure
Layerinfrastructure (shown apart)
CategoryNetwork
Installation methodspackage
External connectionno
Sandbox onlyno

Licence​

SPDX identifierGPL-2.0-or-later
Licence policylicence exception
Licence exceptionLEX-005 (pending, awaiting the client)
Platform componentkeepalived

Packages and artifacts​

A package the project of the service publishes (its image, its binary archive, its Python or OS package) carries the licence of the service; a third-party package carries the licence written on its row, read from the official upstream metadata.

KindPackageVersionLicenceDetails
OS packagekeepalivedversion of the configured repositoryGPL-2.0-or-laterRHEL family (dnf)
OS packagecurlversion of the configured repositoryGPL-2.0-or-laterRHEL family (dnf)
OS packagekeepalivedversion of the configured repositoryGPL-2.0-or-laterDebian family (apt)
OS packagecurlversion of the configured repositoryGPL-2.0-or-laterDebian family (apt)

Supported systems and architectures​

MethodOperating systemsArchitectures
packageRHEL family (dnf), Debian family (apt)x86_64, aarch64 (not restricted by the descriptor)

Certified host systems: RHEL 8/9/10, Rocky Linux 8/9/10, AlmaLinux 8/9/10, Oracle Linux 8/9, CentOS Stream 9/10, Ubuntu 22.04/24.04, Debian 12, Arch Linux (rolling). The host preflight accepts these systems (other releases of a known family give a warning, end of life releases are refused) and the x86_64 and aarch64 architectures.

Prerequisites​

Host​

  • an operating system of the families rhel, debian, arch (blocking, os).

Programs the commands and checks of the service start on the host, outside the managed roots: add them to allowed_commands of the agent (see Security of the Navin agent), else the agent refuses them with command_not_allowed: /usr/bin/pgrep, /usr/sbin/ip.

Network and ports​

None.

Kernel parameters​

ParameterValue
net.ipv4.ip_nonlocal_bind1

Services and connections needed​

Details and resolution: see Dependencies.

Installation methods and modes​

MethodDefaultWhat the method uses
packageyesthe OS packages of the descriptor, installed by the package manager of the host

Components​

ComponentKindInstallation methodsPorts
keepalived (keepalived)masterpackage-

Pair (pair) (default)​

Two hosts, the first is the master.

What the mode deploys:

ComponentPlacement
keepalivedmin 2, max 2

Install this service​

The install wizard of the Navin Manager plans, validates and runs the installation; you need the services:install permission on the cluster.

  1. Open the wizard. In Clusters, choose the row action Install services of the target cluster. The wizard opens on its first step, Service.

  2. Choose the service. On the Service step, select keepalived. The card shows the licence GPL-2.0-or-later and the dependencies the installation needs.

  3. Choose the hosts and the mode. On the Hosts step, tick the hosts, then choose the Mode: pair (default). Each mode deploys the components listed in Installation methods and modes.

  4. Bind the dependencies. On the Bindings step, choose for each dependency (haproxy) Install with the platform or Use an existing connection; an optional dependency can stay on No binding.

  5. Configure. On the Configure step, review the parameters (see Configuration parameters); the required ones are virtual_ip. Passwords left empty with a generated default are generated and sealed by the Manager.

  6. Review and install. On the Install step the Manager validates the plan and shows the installation order; when it says "The plan is valid. Ready to install.", choose Install. A highly available mode is installed only when its HA checks pass.

  7. Verify. The operation ends when the health checks of every instance pass (see Health checks); the service then shows as running in Services.

High availability​

Clusternative (native)
High availabilitynative (native)
Failovervirtual IP (vip)
Replicationnone (none)
QuorumVRRP (vrrp)
Discoverystatic (static)
Entry pointvirtual IP (vip)
Official documentationhttps://keepalived.readthedocs.io/en/latest/
Cluster status commandshow_vip

Topology per mode​

ModesHighest catalog levelDistributionQuorum componentFault domainsDescription
pairha (ha)active-passive (active-passive)-2Two hosts in VRRP: the master holds the virtual IP, the backup takes it over when the master stops answering.

Notes​

  • Both hosts must be on the same layer 2 network (or allow unicast VRRP) and the virtual IP must be reserved.

Configuration parameters​

VRRP​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Virtual IP (virtual_ip)string-^\d{1,3}(\.\d{1,3}){3}/\d{1,2}$yesnonoVirtual address with its prefix, for example 10.0.0.100/24.
Interface (interface)stringeth0-nononoNetwork interface that carries the virtual IP. (scope host)
Virtual router id (virtual_router_id)int51min 1, max 255nononoVRRP id, unique on the network segment.
VRRP password (auth_pass)passwordgenerated-noyesnoShared password of the pair (first 8 characters are used by VRRP).
HAProxy health port (haproxy_stats_port)port8404-nononoPort of the HAProxy /health endpoint tracked by the VRRP script, used only without the haproxy binding (the bound port wins).
HAProxy health over TLS (haproxy_tls)boolfalse-nonoyesSet it when the tracked HAProxy serves its statistics port over TLS (tls_enabled of haproxy): the VRRP script then probes https on the host name and verifies the certificate with the Manager CA. Used only without the haproxy binding (the bound scheme wins).

Dependencies​

For each active dependency the Manager takes the first of: the binding chosen in the wizard; a service of the same installation that provides it; a service already installed in the cluster; the only connection of the expected type. Otherwise an optional dependency stays unbound, and a required one is added to the installation in its default mode (the column below names the catalog service added).

BindingProvided byConnection typeEndpointOptionalWhen nothing is boundDescription
haproxyhaproxy-statsyesstays unbound (optional)HAProxy tracked by the VRRP script: the port and the scheme (http or https) of its stats endpoint come from it; haproxy_stats_port and haproxy_tls are used only without this binding.

Commands​

CommandComponentTargetDescription
Show the addresses (show_vip)keepalivedevery hostShows which host holds the virtual IP.

Health checks​

Liveness (per instance)​

ComponentCheckDetails
keepalived/usr/bin/pgrep -f keepalived.*{{ paths.etc }}/keepalived.conf10 retries; interval 2 s; timeout 3 s

Preflight checks​

CheckTypeMeaningSeverityComponents
osos {}an operating system of the families rhel, debian, archblockingevery component

Uninstall​

Paths removed when the data is purged: {{ paths.log }}.

Upstream documentation​