Documentation ¶
Index ¶
Constants ¶
const ( NONE = L4Type("NONE") // TCP type. TCP = L4Type("TCP") // UDP type. UDP = L4Type("UDP") )
Variables ¶
var ( // AllProtocols is the list of all supported L4 protocols AllProtocols = []L4Type{TCP, UDP} )
Functions ¶
This section is empty.
Types ¶
type FEPort ¶
FEPort represents a frontend port with its ID and the L4Addr's inheritance.
func (*FEPort) EqualsIgnoreID ¶
EqualsIgnoreID returns true if both L4Addr are considered equal without comparing its ID.
type L3n4Addr ¶
L3n4Addr is used to store, as an unique L3+L4 address in the KVStore.
func NewL3n4Addr ¶
NewL3n4Addr creates a new L3n4Addr.
func NewL3n4AddrFromBackendModel ¶
func NewL3n4AddrFromBackendModel(base *models.BackendAddress) (*L3n4Addr, error)
func NewL3n4AddrFromModel ¶
func NewL3n4AddrFromModel(base *models.FrontendAddress) (*L3n4Addr, error)
func (*L3n4Addr) GetModel ¶
func (a *L3n4Addr) GetModel() *models.FrontendAddress
func (*L3n4Addr) IsIPv6 ¶
IsIPv6 returns true if the IP address in the given L3n4Addr is IPv6 or not.
func (*L3n4Addr) String ¶
String returns the L3n4Addr in the "IPv4:Port" format for IPv4 and "[IPv6]:Port" format for IPv6.
func (*L3n4Addr) StringID ¶
StringID returns the L3n4Addr as string to be used for unique identification
func (*L3n4Addr) StringWithProtocol ¶
StringWithProtocol returns the L3n4Addr in the "IPv4:Port/Protocol" format for IPv4 and "[IPv6]:Port/Protocol" format for IPv6.
type L3n4AddrID ¶
L3n4AddrID is used to store, as an unique L3+L4 plus the assigned ID, in the KVStore.
func NewL3n4AddrID ¶
NewL3n4AddrID creates a new L3n4AddrID.
func (*L3n4AddrID) DeepCopy ¶
func (l *L3n4AddrID) DeepCopy() *L3n4AddrID
DeepCopy returns a DeepCopy of the given L3n4AddrID.
func (*L3n4AddrID) Equals ¶ added in v1.6.0
func (l *L3n4AddrID) Equals(o *L3n4AddrID) bool
Equals checks equality of both given addresses.
func (*L3n4AddrID) IsIPv6 ¶
func (l *L3n4AddrID) IsIPv6() bool
IsIPv6 returns true if the IP address in L3n4Addr's L3n4AddrID is IPv6 or not.
type L4Addr ¶
L4Addr is an abstraction for the backend port with a L4Type, usually tcp or udp, and the Port number.
type LBBackEnd ¶
LBBackEnd represents load balancer backend.
func NewLBBackEnd ¶
func NewLBBackEnd(id BackendID, protocol L4Type, ip net.IP, portNumber uint16, weight uint16) *LBBackEnd
NewLBBackEnd creates the LBBackEnd struct instance from given params.
func NewLBBackEndFromBackendModel ¶
func NewLBBackEndFromBackendModel(base *models.BackendAddress) (*LBBackEnd, error)
func (*LBBackEnd) GetBackendModel ¶
func (b *LBBackEnd) GetBackendModel() *models.BackendAddress
type LBSVC ¶
type LBSVC struct { Sha256 string FE L3n4AddrID BES []LBBackEnd NodePort bool }
LBSVC is essentially used for the REST API.
type LoadBalancer ¶
type LoadBalancer struct { BPFMapMU lock.RWMutex SVCMap SVCMap SVCMapID SVCMapID RevNATMap RevNATMap }
LoadBalancer is the internal representation of the loadbalancer in the local cilium daemon.
func NewLoadBalancer ¶
func NewLoadBalancer() *LoadBalancer
NewLoadBalancer returns a LoadBalancer with all maps initialized.
func (*LoadBalancer) AddService ¶
func (lb *LoadBalancer) AddService(svc LBSVC) bool
AddService adds a service to list of loadbalancers and returns true if created.
func (*LoadBalancer) DeleteService ¶
func (lb *LoadBalancer) DeleteService(svc *LBSVC)
DeleteService deletes svc from lb's SVCMap and SVCMapID.
type SVCMap ¶
SVCMap is a map of the daemon's services. The key is the sha256sum of the LBSVC's FE and the value the LBSVC.
func (SVCMap) AddFEnBE ¶
func (svcs SVCMap) AddFEnBE(fe *L3n4AddrID, be *LBBackEnd, beIndex int) *LBSVC
AddFEnBE adds the given 'fe' and 'be' to the SVCMap. If 'fe' exists and beIndex is 0, the new 'be' will be appended to the list of existing backends. If beIndex is bigger than the size of existing backends slice, it will be created a new array with size of beIndex and the new 'be' will be inserted on index beIndex-1 of that new array. All remaining be elements will be kept on the same index and, in case the new array is larger than the number of backends, some elements will be empty.