KeepalivedInstance
Scope: Cluster
Version: v1alpha1
The custom resource for configuring keepalived clusters.
Each KeepalivedInstance custom resource defines a single keepalived cluster.
metadata.name — the name of the cluster (used in pod names).
- objectspec
Required value
- objectspec.nodeSelector
Required value
Defines the
nodeSelectorparameter for keepalived pods.Format: the standard
nodeSelectorlist. Instance pods inherit this field as is. - array of objectsspec.tolerations
Defines
tolerationsfor keepalived pods.Format: the standard toleration list. Instance pods inherit this field as is.
- stringspec.tolerations.effect
Defines the taint’s effect this toleration is associated with (it matches any effect if empty).
Allowed values:
NoSchedule,PreferNoSchedule,NoExecute - stringspec.tolerations.key
Defines the taint’s key this toleration is associated with (it matches any key if empty).
If the key is omitted (emplty), then
operatormust be set toExists(which means it matches anyvalueandkey). - stringspec.tolerations.operator
Defines how the key and its value are linked — whether the key must be
Equalto the value or can have any value.Setting it to
Existsis equivalent to the value having any value so that the pod with the specified toleration can match the corresponding taint.Default:
EqualAllowed values:
Exists,Equal - integerspec.tolerations.tolerationSeconds
Specifies the period (in seconds) that the scheduler waits before evicting a Pod from a node if the toleration no longer matches the taint (only applicable to the
NoExecuteeffect, otherwise ignored).If the parameter is not set, the Pod will not be evicted from the node if the toleration no longer matches the taint. If the parameter is set to zero (or negative), the Pod will be evicted immediately if the toleration no longer matches the taint.
The default is: not set.
- stringspec.tolerations.value
The value that the toleration must match.
Must be empty if the operator parameter is set to
Exists.
- array of objectsspec.vrrpInstances
Required value
A list of VRRP instances in the keepalived cluster. Essentially, it is a list of address groups that migrate between servers simultaneously and cannot work separately.
Do not confuse
vrrpInstancewithKeepalivedInstance.vrrpInstanceis a component ofKeepalivedInstance.The
keepalivedmodule configures VRRP instances so that all addresses (all groups) are evenly distributed across all servers (instead of gathering together on the same node).- integerspec.vrrpInstances.id
Required value
A unique cluster-wide identifier of a VRRP group.
Do not use the same ID in different
KeepalivedInstanceinstances unless you have a perfect reason to do so.Allowed values:
1 <= X <= 255 - objectspec.vrrpInstances.interface
Required value
Defines the strategy of detecting interface for the service VRRP traffic on the node.
- stringspec.vrrpInstances.interface.detectionStrategy
You can select one of the following three interface detecting strategis:
Name— set the interface name explicitly using thespec.vrrpInstances[].interface.nameparameter. In this case, all nodes must have the same interface that serves the correct network (e.g., eth0).NetworkAddress— find an interface with an IP from this subnet on the node and use it.DefaultRoute— use the interface for the default route on the node (254 “main” in the table).
- stringspec.vrrpInstances.interface.name
The name of the interface for the service VRRP traffic if the
NamedetectionStrategyis used.A mandatory parameter if
detectionStrategy=Name. - stringspec.vrrpInstances.interface.networkAddress
The address of the subnet to use for determining an interface if
detectionStrategy=NetworkAddress.A mandatory parameter if
detectionStrategy=NetworkAddress.Pattern:
^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}$Example:
networkAddress: 192.168.42.0/24
- booleanspec.vrrpInstances.preempt
Defines if the IP is passed to a node after its recovery from a failure.
It makes sense not to pass the IP if you have just one
vrrpInstanceto preserve connections. If you have a lot of groups and a lot of traffic, it is better to pass it to prevent the concentration of all groups on one node.The default is —
true, that is, the IP will passed to a node after its recovery. - array of objectsspec.vrrpInstances.virtualIPAddresses
Required value
A list of IP addresses that will “jump” between the servers in tandem
- stringspec.vrrpInstances.virtualIPAddresses.address
Required value
One of the group addresses.
Pattern:
^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}$Example:
address: 192.168.42.15/32 - objectspec.vrrpInstances.virtualIPAddresses.interface
Not required value.
An interface for binding a virtual IP address on a node (similar to
spec.vrrpInstances[].interface).If omitted, the main service interface defined in
spec.vrrpInstances[].interfacewill be used.- stringspec.vrrpInstances.virtualIPAddresses.interface.detectionStrategy
You can select one of the following three interface detecting strategis ti bind an IP address:
Name— set the interface name explicitly using thespec.vrrpInstances[].virtualIPAddresses[].interface.nameparameter. In this case, all nodes must have the same interface that serves the correct network (e.g., eth0).NetworkAddress— find an interface with an IP from this subnet on the node and use it.DefaultRoute— use the interface for the default route on the node (254 “main” in the table).
- stringspec.vrrpInstances.virtualIPAddresses.interface.name
A name of the interface to bind a virtual IP address if
virtualIPaddresses[].detectionStrategy=Nameis used.A mandatory parameter if
virtualIPaddresses[].detectionStrategy=Name. - stringspec.vrrpInstances.virtualIPAddresses.interface.networkAddress
The address of the subnet to use for determining an interface if
virtualIPaddresses[].detectionStrategy=NetworkAddress.A mandatory parameter if
virtualIPaddresses[].detectionStrategy=NetworkAddress.Pattern:
^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/[0-9]{1,2}$Example:
networkAddress: 192.168.42.0/24