package ipvs
import "k8s.io/kubernetes/pkg/proxy/ipvs/util"
Index ¶
- Constants
- func IsRsGracefulTerminationNeeded(proto string) bool
- type Interface
- type Protocol
- type RealServer
- type ServiceFlags
- type VirtualServer
Constants ¶
const ( // FlagPersistent specify IPVS service session affinity FlagPersistent = 0x1 // FlagHashed specify IPVS service hash flag FlagHashed = 0x2 // FlagSourceHash enables IPVS service hashing on source port and source IP FlagSourceHash = 0x10 )
Functions ¶
func IsRsGracefulTerminationNeeded ¶
IsRsGracefulTerminationNeeded returns true if protocol requires graceful termination for the stale connections
Types ¶
type Interface ¶
type Interface interface { // Flush clears all virtual servers in system. return occurred error immediately. Flush() error // AddVirtualServer creates the specified virtual server. AddVirtualServer(*VirtualServer) error // UpdateVirtualServer updates an already existing virtual server. If the virtual server does not exist, return error. UpdateVirtualServer(*VirtualServer) error // DeleteVirtualServer deletes the specified virtual server. If the virtual server does not exist, return error. DeleteVirtualServer(*VirtualServer) error // Given a partial virtual server, GetVirtualServer will return the specified virtual server information in the system. GetVirtualServer(*VirtualServer) (*VirtualServer, error) // GetVirtualServers lists all virtual servers in the system. GetVirtualServers() ([]*VirtualServer, error) // AddRealServer creates the specified real server for the specified virtual server. AddRealServer(*VirtualServer, *RealServer) error // GetRealServers returns all real servers for the specified virtual server. GetRealServers(*VirtualServer) ([]*RealServer, error) // DeleteRealServer deletes the specified real server from the specified virtual server. DeleteRealServer(*VirtualServer, *RealServer) error // UpdateRealServer updates the specified real server from the specified virtual server. UpdateRealServer(*VirtualServer, *RealServer) error // ConfigureTimeouts is the equivalent to running "ipvsadm --set" to configure tcp, tcpfin and udp timeouts ConfigureTimeouts(time.Duration, time.Duration, time.Duration) error }
Interface is an injectable interface for running ipvs commands. Implementations must be goroutine-safe.
func New ¶
func New() Interface
New returns a new Interface which will call ipvs APIs.
type Protocol ¶
type Protocol uint16
Protocol is the IPVS service protocol type
type RealServer ¶
RealServer is an user-oriented definition of an IPVS real server in its entirety.
func (*RealServer) Equal ¶
func (rs *RealServer) Equal(other *RealServer) bool
Equal check the equality of real server. We don't use struct == since it doesn't work because of slice.
func (*RealServer) String ¶
func (rs *RealServer) String() string
type ServiceFlags ¶
type ServiceFlags uint32
ServiceFlags is used to specify session affinity, ip hash etc.
type VirtualServer ¶
type VirtualServer struct { Address net.IP Protocol string Port uint16 Scheduler string Flags ServiceFlags Timeout uint32 }
VirtualServer is an user-oriented definition of an IPVS virtual server in its entirety.
func (*VirtualServer) Equal ¶
func (svc *VirtualServer) Equal(other *VirtualServer) bool
Equal check the equality of virtual server. We don't use struct == since it doesn't work because of slice.
func (*VirtualServer) String ¶
func (svc *VirtualServer) String() string
Source Files ¶
doc.go ipvs.go ipvs_linux.go
Directories ¶
Path | Synopsis |
---|---|
pkg/proxy/ipvs/util/testing |
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 3 hours ago –
Tools for package owners.