Documentation
      ¶
    
    
  
    
      Index ¶
- Constants
 - func AddInfraEndpointRules(client *OVSEndpointClient, infraIP net.IPNet, hostPort string) error
 - func AddInfraVnetEndpoint(client *OVSEndpointClient) error
 - func AddSnatEndpoint(client *OVSEndpointClient) error
 - func AddSnatEndpointRules(client *OVSEndpointClient) error
 - func AddStaticRoute(ip string, interfaceName string) error
 - func ConfigureInfraVnetContainerInterface(client *OVSEndpointClient, infraIP net.IPNet) error
 - func ConfigureSnatContainerInterface(client *OVSEndpointClient) error
 - func ConstructEndpointID(containerID string, netNsPath string, ifName string) (string, string)
 - func DeleteInfraVnetEndpoint(client *OVSEndpointClient, epID string) error
 - func DeleteInfraVnetEndpointRules(client *OVSEndpointClient, ep *endpoint, hostPort string)
 - func DeleteSnatEndpoint(client *OVSEndpointClient) error
 - func DeleteSnatEndpointRules(client *OVSEndpointClient)
 - func GetPodNameWithoutSuffix(podName string) string
 - func MoveInfraEndpointToContainerNS(client *OVSEndpointClient, netnsPath string, nsID uintptr) error
 - func MoveSnatEndpointToContainerNS(client *OVSEndpointClient, netnsPath string, nsID uintptr) error
 - func NewInfraVnetClient(client *OVSEndpointClient, epID string)
 - func NewSnatClient(client *OVSEndpointClient, snatBridgeIP string, localIP string, ...)
 - func SetupInfraVnetContainerInterface(client *OVSEndpointClient) error
 - func SetupSnatContainerInterface(client *OVSEndpointClient) error
 - type DNSInfo
 - type EndpointClient
 - type EndpointInfo
 - type LinuxBridgeClient
 - func (client *LinuxBridgeClient) AddL2Rules(extIf *externalInterface) error
 - func (client *LinuxBridgeClient) CreateBridge() error
 - func (client *LinuxBridgeClient) DeleteBridge() error
 - func (client *LinuxBridgeClient) DeleteL2Rules(extIf *externalInterface)
 - func (client *LinuxBridgeClient) SetBridgeMasterToHostInterface() error
 - func (client *LinuxBridgeClient) SetHairpinOnHostInterface(enable bool) error
 
- type LinuxBridgeEndpointClient
 - func (client *LinuxBridgeEndpointClient) AddEndpointRules(epInfo *EndpointInfo) error
 - func (client *LinuxBridgeEndpointClient) AddEndpoints(epInfo *EndpointInfo) error
 - func (client *LinuxBridgeEndpointClient) ConfigureContainerInterfacesAndRoutes(epInfo *EndpointInfo) error
 - func (client *LinuxBridgeEndpointClient) DeleteEndpointRules(ep *endpoint)
 - func (client *LinuxBridgeEndpointClient) DeleteEndpoints(ep *endpoint) error
 - func (client *LinuxBridgeEndpointClient) MoveEndpointsToContainerNS(epInfo *EndpointInfo, nsID uintptr) error
 - func (client *LinuxBridgeEndpointClient) SetupContainerInterfaces(epInfo *EndpointInfo) error
 
- type Namespace
 - type NetworkClient
 - type NetworkInfo
 - type NetworkManager
 - type OVSEndpointClient
 - func (client *OVSEndpointClient) AddEndpointRules(epInfo *EndpointInfo) error
 - func (client *OVSEndpointClient) AddEndpoints(epInfo *EndpointInfo) error
 - func (client *OVSEndpointClient) ConfigureContainerInterfacesAndRoutes(epInfo *EndpointInfo) error
 - func (client *OVSEndpointClient) DeleteEndpointRules(ep *endpoint)
 - func (client *OVSEndpointClient) DeleteEndpoints(ep *endpoint) error
 - func (client *OVSEndpointClient) MoveEndpointsToContainerNS(epInfo *EndpointInfo, nsID uintptr) error
 - func (client *OVSEndpointClient) SetupContainerInterfaces(epInfo *EndpointInfo) error
 
- type OVSNetworkClient
 - func (client *OVSNetworkClient) AddL2Rules(extIf *externalInterface) error
 - func (client *OVSNetworkClient) CreateBridge() error
 - func (client *OVSNetworkClient) DeleteBridge() error
 - func (client *OVSNetworkClient) DeleteL2Rules(extIf *externalInterface)
 - func (client *OVSNetworkClient) SetBridgeMasterToHostInterface() error
 - func (client *OVSNetworkClient) SetHairpinOnHostInterface(enable bool) error
 
- type RouteInfo
 - type SubnetInfo
 - type TransparentEndpointClient
 - func (client *TransparentEndpointClient) AddEndpointRules(epInfo *EndpointInfo) error
 - func (client *TransparentEndpointClient) AddEndpoints(epInfo *EndpointInfo) error
 - func (client *TransparentEndpointClient) ConfigureContainerInterfacesAndRoutes(epInfo *EndpointInfo) error
 - func (client *TransparentEndpointClient) DeleteEndpointRules(ep *endpoint)
 - func (client *TransparentEndpointClient) DeleteEndpoints(ep *endpoint) error
 - func (client *TransparentEndpointClient) MoveEndpointsToContainerNS(epInfo *EndpointInfo, nsID uintptr) error
 - func (client *TransparentEndpointClient) SetupContainerInterfaces(epInfo *EndpointInfo) error
 
Constants ¶
      View Source
      
  
    const ( SnatBridgeIPKey = "snatBridgeIP" LocalIPKey = "localIP" InfraVnetIPKey = "infraVnetIP" OptVethName = "vethname" )
      View Source
      
  
    const ( FAKE_GW_IP = "169.254.1.1/32" DEFAULT_GW = "0.0.0.0/0" )
      View Source
      
  
    const (
	InfraVnet = 0
)
    
      View Source
      
  
const (
	VlanIDKey = "VlanID"
)
    Variables ¶
This section is empty.
Functions ¶
func AddInfraEndpointRules ¶ added in v1.0.12
func AddInfraEndpointRules(client *OVSEndpointClient, infraIP net.IPNet, hostPort string) error
func AddInfraVnetEndpoint ¶ added in v1.0.12
func AddInfraVnetEndpoint(client *OVSEndpointClient) error
func AddSnatEndpoint ¶ added in v1.0.12
func AddSnatEndpoint(client *OVSEndpointClient) error
func AddSnatEndpointRules ¶ added in v1.0.12
func AddSnatEndpointRules(client *OVSEndpointClient) error
func AddStaticRoute ¶ added in v1.0.12
func ConfigureInfraVnetContainerInterface ¶ added in v1.0.12
func ConfigureInfraVnetContainerInterface(client *OVSEndpointClient, infraIP net.IPNet) error
func ConfigureSnatContainerInterface ¶ added in v1.0.12
func ConfigureSnatContainerInterface(client *OVSEndpointClient) error
func ConstructEndpointID ¶ added in v1.0.4
func DeleteInfraVnetEndpoint ¶ added in v1.0.12
func DeleteInfraVnetEndpoint(client *OVSEndpointClient, epID string) error
func DeleteInfraVnetEndpointRules ¶ added in v1.0.12
func DeleteInfraVnetEndpointRules(client *OVSEndpointClient, ep *endpoint, hostPort string)
func DeleteSnatEndpoint ¶ added in v1.0.12
func DeleteSnatEndpoint(client *OVSEndpointClient) error
func DeleteSnatEndpointRules ¶ added in v1.0.24
func DeleteSnatEndpointRules(client *OVSEndpointClient)
func GetPodNameWithoutSuffix ¶ added in v1.0.18
func MoveInfraEndpointToContainerNS ¶ added in v1.0.12
func MoveInfraEndpointToContainerNS(client *OVSEndpointClient, netnsPath string, nsID uintptr) error
func MoveSnatEndpointToContainerNS ¶ added in v1.0.12
func MoveSnatEndpointToContainerNS(client *OVSEndpointClient, netnsPath string, nsID uintptr) error
func NewInfraVnetClient ¶ added in v1.0.12
func NewInfraVnetClient(client *OVSEndpointClient, epID string)
func NewSnatClient ¶ added in v1.0.12
func NewSnatClient(client *OVSEndpointClient, snatBridgeIP string, localIP string, epInfo *EndpointInfo)
func SetupInfraVnetContainerInterface ¶ added in v1.0.12
func SetupInfraVnetContainerInterface(client *OVSEndpointClient) error
func SetupSnatContainerInterface ¶ added in v1.0.12
func SetupSnatContainerInterface(client *OVSEndpointClient) error
Types ¶
type EndpointClient ¶ added in v1.0.8
type EndpointClient interface {
	AddEndpoints(epInfo *EndpointInfo) error
	AddEndpointRules(epInfo *EndpointInfo) error
	DeleteEndpointRules(ep *endpoint)
	MoveEndpointsToContainerNS(epInfo *EndpointInfo, nsID uintptr) error
	SetupContainerInterfaces(epInfo *EndpointInfo) error
	ConfigureContainerInterfacesAndRoutes(epInfo *EndpointInfo) error
	DeleteEndpoints(ep *endpoint) error
}
    type EndpointInfo ¶
type EndpointInfo struct {
	Id                       string
	ContainerID              string
	NetNsPath                string
	IfName                   string
	SandboxKey               string
	IfIndex                  int
	MacAddress               net.HardwareAddr
	DNS                      DNSInfo
	IPAddresses              []net.IPNet
	IPsToRouteViaHost        []string
	InfraVnetIP              net.IPNet
	Routes                   []RouteInfo
	Policies                 []policy.Policy
	Gateways                 []net.IP
	EnableSnatOnHost         bool
	EnableInfraVnet          bool
	EnableMultiTenancy       bool
	EnableSnatForDns         bool
	AllowInboundFromHostToNC bool
	AllowInboundFromNCToHost bool
	NetworkContainerID       string
	PODName                  string
	PODNameSpace             string
	Data                     map[string]interface{}
	InfraVnetAddressSpace    string
	SkipHotAttachEp          bool
}
    EndpointInfo contains read-only information about an endpoint.
type LinuxBridgeClient ¶ added in v1.0.8
type LinuxBridgeClient struct {
	// contains filtered or unexported fields
}
    func NewLinuxBridgeClient ¶ added in v1.0.8
func NewLinuxBridgeClient(bridgeName string, hostInterfaceName string, mode string) *LinuxBridgeClient
func (*LinuxBridgeClient) AddL2Rules ¶ added in v1.0.8
func (client *LinuxBridgeClient) AddL2Rules(extIf *externalInterface) error
func (*LinuxBridgeClient) CreateBridge ¶ added in v1.0.8
func (client *LinuxBridgeClient) CreateBridge() error
func (*LinuxBridgeClient) DeleteBridge ¶ added in v1.0.8
func (client *LinuxBridgeClient) DeleteBridge() error
func (*LinuxBridgeClient) DeleteL2Rules ¶ added in v1.0.8
func (client *LinuxBridgeClient) DeleteL2Rules(extIf *externalInterface)
func (*LinuxBridgeClient) SetBridgeMasterToHostInterface ¶ added in v1.0.8
func (client *LinuxBridgeClient) SetBridgeMasterToHostInterface() error
func (*LinuxBridgeClient) SetHairpinOnHostInterface ¶ added in v1.0.8
func (client *LinuxBridgeClient) SetHairpinOnHostInterface(enable bool) error
type LinuxBridgeEndpointClient ¶ added in v1.0.8
type LinuxBridgeEndpointClient struct {
	// contains filtered or unexported fields
}
    func NewLinuxBridgeEndpointClient ¶ added in v1.0.8
func NewLinuxBridgeEndpointClient( extIf *externalInterface, hostVethName string, containerVethName string, mode string, ) *LinuxBridgeEndpointClient
func (*LinuxBridgeEndpointClient) AddEndpointRules ¶ added in v1.0.8
func (client *LinuxBridgeEndpointClient) AddEndpointRules(epInfo *EndpointInfo) error
func (*LinuxBridgeEndpointClient) AddEndpoints ¶ added in v1.0.8
func (client *LinuxBridgeEndpointClient) AddEndpoints(epInfo *EndpointInfo) error
func (*LinuxBridgeEndpointClient) ConfigureContainerInterfacesAndRoutes ¶ added in v1.0.8
func (client *LinuxBridgeEndpointClient) ConfigureContainerInterfacesAndRoutes(epInfo *EndpointInfo) error
func (*LinuxBridgeEndpointClient) DeleteEndpointRules ¶ added in v1.0.8
func (client *LinuxBridgeEndpointClient) DeleteEndpointRules(ep *endpoint)
func (*LinuxBridgeEndpointClient) DeleteEndpoints ¶ added in v1.0.8
func (client *LinuxBridgeEndpointClient) DeleteEndpoints(ep *endpoint) error
func (*LinuxBridgeEndpointClient) MoveEndpointsToContainerNS ¶ added in v1.0.8
func (client *LinuxBridgeEndpointClient) MoveEndpointsToContainerNS(epInfo *EndpointInfo, nsID uintptr) error
func (*LinuxBridgeEndpointClient) SetupContainerInterfaces ¶ added in v1.0.8
func (client *LinuxBridgeEndpointClient) SetupContainerInterfaces(epInfo *EndpointInfo) error
type Namespace ¶
type Namespace struct {
	// contains filtered or unexported fields
}
    Namespace represents a network namespace.
func GetCurrentThreadNamespace ¶
GetCurrentThreadNamespace returns the caller thread's current namespace.
func OpenNamespace ¶
OpenNamespace creates a new namespace object for the given netns path.
type NetworkClient ¶ added in v1.0.8
type NetworkInfo ¶
type NetworkInfo struct {
	MasterIfName                  string
	Id                            string
	Mode                          string
	Subnets                       []SubnetInfo
	DNS                           DNSInfo
	Policies                      []policy.Policy
	BridgeName                    string
	EnableSnatOnHost              bool
	NetNs                         string
	Options                       map[string]interface{}
	DisableHairpinOnHostInterface bool
}
    NetworkInfo contains read-only information about a container network.
type NetworkManager ¶
type NetworkManager interface {
	Initialize(config *common.PluginConfig) error
	Uninitialize()
	AddExternalInterface(ifName string, subnet string) error
	CreateNetwork(nwInfo *NetworkInfo) error
	DeleteNetwork(networkId string) error
	GetNetworkInfo(networkId string) (*NetworkInfo, error)
	CreateEndpoint(networkId string, epInfo *EndpointInfo) error
	DeleteEndpoint(networkId string, endpointId string) error
	GetEndpointInfo(networkId string, endpointId string) (*EndpointInfo, error)
	GetEndpointInfoBasedOnPODDetails(networkId string, podName string, podNameSpace string, doExactMatchForPodName bool) (*EndpointInfo, error)
	AttachEndpoint(networkId string, endpointId string, sandboxKey string) (*endpoint, error)
	DetachEndpoint(networkId string, endpointId string) error
	UpdateEndpoint(networkId string, existingEpInfo *EndpointInfo, targetEpInfo *EndpointInfo) error
	GetNumberOfEndpoints(ifName string, networkId string) int
}
    NetworkManager API.
func NewNetworkManager ¶
func NewNetworkManager() (NetworkManager, error)
Creates a new network manager.
type OVSEndpointClient ¶ added in v1.0.8
type OVSEndpointClient struct {
	// contains filtered or unexported fields
}
    func NewOVSEndpointClient ¶ added in v1.0.8
func NewOVSEndpointClient( nw *network, epInfo *EndpointInfo, hostVethName string, containerVethName string, vlanid int, localIP string) *OVSEndpointClient
func (*OVSEndpointClient) AddEndpointRules ¶ added in v1.0.8
func (client *OVSEndpointClient) AddEndpointRules(epInfo *EndpointInfo) error
func (*OVSEndpointClient) AddEndpoints ¶ added in v1.0.8
func (client *OVSEndpointClient) AddEndpoints(epInfo *EndpointInfo) error
func (*OVSEndpointClient) ConfigureContainerInterfacesAndRoutes ¶ added in v1.0.8
func (client *OVSEndpointClient) ConfigureContainerInterfacesAndRoutes(epInfo *EndpointInfo) error
func (*OVSEndpointClient) DeleteEndpointRules ¶ added in v1.0.8
func (client *OVSEndpointClient) DeleteEndpointRules(ep *endpoint)
func (*OVSEndpointClient) DeleteEndpoints ¶ added in v1.0.8
func (client *OVSEndpointClient) DeleteEndpoints(ep *endpoint) error
func (*OVSEndpointClient) MoveEndpointsToContainerNS ¶ added in v1.0.8
func (client *OVSEndpointClient) MoveEndpointsToContainerNS(epInfo *EndpointInfo, nsID uintptr) error
func (*OVSEndpointClient) SetupContainerInterfaces ¶ added in v1.0.8
func (client *OVSEndpointClient) SetupContainerInterfaces(epInfo *EndpointInfo) error
type OVSNetworkClient ¶ added in v1.0.8
type OVSNetworkClient struct {
	// contains filtered or unexported fields
}
    func NewOVSClient ¶ added in v1.0.8
func NewOVSClient(bridgeName, hostInterfaceName string) *OVSNetworkClient
func (*OVSNetworkClient) AddL2Rules ¶ added in v1.0.8
func (client *OVSNetworkClient) AddL2Rules(extIf *externalInterface) error
func (*OVSNetworkClient) CreateBridge ¶ added in v1.0.8
func (client *OVSNetworkClient) CreateBridge() error
func (*OVSNetworkClient) DeleteBridge ¶ added in v1.0.8
func (client *OVSNetworkClient) DeleteBridge() error
func (*OVSNetworkClient) DeleteL2Rules ¶ added in v1.0.8
func (client *OVSNetworkClient) DeleteL2Rules(extIf *externalInterface)
func (*OVSNetworkClient) SetBridgeMasterToHostInterface ¶ added in v1.0.8
func (client *OVSNetworkClient) SetBridgeMasterToHostInterface() error
func (*OVSNetworkClient) SetHairpinOnHostInterface ¶ added in v1.0.8
func (client *OVSNetworkClient) SetHairpinOnHostInterface(enable bool) error
type SubnetInfo ¶
SubnetInfo contains subnet information for a container network.
type TransparentEndpointClient ¶ added in v1.0.16
type TransparentEndpointClient struct {
	// contains filtered or unexported fields
}
    func NewTransparentEndpointClient ¶ added in v1.0.16
func NewTransparentEndpointClient( extIf *externalInterface, hostVethName string, containerVethName string, mode string, ) *TransparentEndpointClient
func (*TransparentEndpointClient) AddEndpointRules ¶ added in v1.0.16
func (client *TransparentEndpointClient) AddEndpointRules(epInfo *EndpointInfo) error
func (*TransparentEndpointClient) AddEndpoints ¶ added in v1.0.16
func (client *TransparentEndpointClient) AddEndpoints(epInfo *EndpointInfo) error
func (*TransparentEndpointClient) ConfigureContainerInterfacesAndRoutes ¶ added in v1.0.16
func (client *TransparentEndpointClient) ConfigureContainerInterfacesAndRoutes(epInfo *EndpointInfo) error
func (*TransparentEndpointClient) DeleteEndpointRules ¶ added in v1.0.16
func (client *TransparentEndpointClient) DeleteEndpointRules(ep *endpoint)
func (*TransparentEndpointClient) DeleteEndpoints ¶ added in v1.0.16
func (client *TransparentEndpointClient) DeleteEndpoints(ep *endpoint) error
func (*TransparentEndpointClient) MoveEndpointsToContainerNS ¶ added in v1.0.16
func (client *TransparentEndpointClient) MoveEndpointsToContainerNS(epInfo *EndpointInfo, nsID uintptr) error
func (*TransparentEndpointClient) SetupContainerInterfaces ¶ added in v1.0.16
func (client *TransparentEndpointClient) SetupContainerInterfaces(epInfo *EndpointInfo) error
      
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.