mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/kube-vip/kube-vip.git
synced 2026-09-20 08:03:47 +08:00
* feat(lease): record VIP ownership in lease annotations Encode the instance name, address protocol and an ordered VIP list on the Kubernetes lease so a restarting instance can tell which tagged addresses it still owns. Only the current holder publishes the annotation. Signed-off-by: Marcel Fest <marcel.fest@telekom.de> Signed-off-by: Cellebyte <marcel.fest@live.de> Signed-off-by: Marcel Fest <marcel.fest@telekom.de> * fix: flip flop on ordering when reading and writing the annotation Signed-off-by: Marcel Fest <marcel.fest@telekom.de> * fix: address feedback from review Signed-off-by: Marcel Fest <marcel.fest@telekom.de> --------- Signed-off-by: Marcel Fest <marcel.fest@telekom.de> Signed-off-by: Cellebyte <marcel.fest@live.de>
98 lines
3.5 KiB
Go
98 lines
3.5 KiB
Go
package kubevip
|
|
|
|
const (
|
|
// Hardware address of the host that has the VIP
|
|
HwAddrKey = "kube-vip.io/hwaddr"
|
|
|
|
// The IP address that is requested
|
|
RequestedIP = "kube-vip.io/requestedIP"
|
|
|
|
// The host that has the VIP
|
|
VipHost = "kube-vip.io/vipHost"
|
|
|
|
// Enable Egress on a service
|
|
Egress = "kube-vip.io/egress"
|
|
|
|
// Enable internal Egress
|
|
EgressInternal = "kube-vip.io/egress-internal"
|
|
|
|
// Egress should be IPv6
|
|
EgressIPv6 = "kube-vip.io/egress-ipv6"
|
|
|
|
// Ports that traffic is allowed to access from the egress VIP
|
|
EgressDestinationPorts = "kube-vip.io/egress-destination-ports"
|
|
|
|
// Allowed incoming ports to the VIP
|
|
EgressSourcePorts = "kube-vip.io/egress-source-ports"
|
|
|
|
// Allowed networks for the Egress to be enabled for
|
|
EgressAllowedNetworks = "kube-vip.io/egress-allowed-networks"
|
|
|
|
// Networks that we wont Egress for
|
|
EgressDeniedNetworks = "kube-vip.io/egress-denied-networks"
|
|
|
|
// EgressNoInternalTraffic, when enabled will prevent any internal traffic from being SNATed to the egress VIP, even if the internal SNAT rule is enabled
|
|
EgressNoInternalTraffic = "kube-vip.io/egress-no-internal-traffic"
|
|
|
|
// EgressDetectAPIServer, this will attempt to detect the API server and add it to the allowed networks for egress
|
|
EgressDetectAPIServer = "kube-vip.io/egress-detect-api-server"
|
|
|
|
// The current active endpoint(pod) for the Egress VIP
|
|
ActiveEndpoint = "kube-vip.io/active-endpoint"
|
|
|
|
// The current active endpoint(pod) for the Egress VIP (v6)
|
|
ActiveEndpointIPv6 = "kube-vip.io/active-endpoint-ipv6"
|
|
|
|
// The nftables egress table base name that owns this Service's SNAT chain
|
|
EgressNftablesTable = "kube-vip.io/egress-nftables-table"
|
|
|
|
// Flush the conntrack rules (remove existing sessions) once Egress is configured
|
|
FlushContrack = "kube-vip.io/flush-conntrack"
|
|
|
|
// Configure LoadBalancer IPs instead of relying on a controller
|
|
LoadbalancerIPAnnotation = "kube-vip.io/loadbalancerIPs"
|
|
|
|
// Ignore the LoadBalancer Service
|
|
LoadbalancerIgnore = "kube-vip.io/ignore"
|
|
|
|
// Used to configure DHCP with a Hostname
|
|
LoadbalancerHostname = "kube-vip.io/loadbalancerHostname"
|
|
|
|
// Define an interface name to bind the address of the LoadBalancer to
|
|
ServiceInterface = "kube-vip.io/serviceInterface"
|
|
|
|
// Specify VLAN subinterface for service (e.g. eth0.200)
|
|
ServiceVlan = "kube-vip.io/serviceVLAN"
|
|
|
|
ServiceSecurityIgnore = "kube-vip.io/ignore-service-security"
|
|
|
|
// Enable UPNP on a Service
|
|
UpnpEnabled = "kube-vip.io/forwardUPNP"
|
|
|
|
// Set the UPNP lease duration for a specific service using duration format (e.g., "30s", "1h")
|
|
UpnpLeaseDuration = "kube-vip.io/upnp-lease-duration"
|
|
|
|
RPFilter = "kube-vip.io/rp_filter" // Set the return path filter for a specific service interface
|
|
|
|
// Name of the service lease object
|
|
ServiceLease = "kube-vip.io/leaseName"
|
|
|
|
// Versioned kube-vip ownership metadata stored on Kubernetes election Leases
|
|
LeaseVIPs = "kube-vip.io/lease-vips"
|
|
|
|
// Forces kube-vip to use per service election for this particular service
|
|
ForcePerServiceElection = "kube-vip.io/forcePerServiceElection"
|
|
|
|
// Allow service reconciliation even when no endpoints are present (Cluster policy only)
|
|
AllowReconcileWithoutEndpoints = "kube-vip.io/allow-reconcile-without-endpoints"
|
|
|
|
// Enable DDNS for the service
|
|
ServiceDDNS = "kube-vip.io/ddns"
|
|
|
|
// Forces kube-vip to use the specified veth interface when DHCP is being used for a service
|
|
MacvlanName = "kube-vip.io/macvlanName"
|
|
|
|
// Set the BROADCAST flag in DHCP DISCOVER/REQUEST packets
|
|
DHCPBroadcast = "kube-vip.io/dhcp-broadcast"
|
|
)
|