Documentation ¶
Index ¶
- Constants
- func GetEndpointID(args *cniSkel.CmdArgs) string
- func SetCustomDimensions(cniMetric *telemetry.AIMetric, nwCfg *cni.NetworkConfig, err error)
- type AzureIPAMInvoker
- type AzureNetIOShim
- type CNSIPAMInvoker
- type IPAMAddConfig
- type IPAMAddResult
- type IPAMInvoker
- type IPv4ResultInfo
- type MockIpamInvoker
- type MockMultitenancy
- func (m *MockMultitenancy) DetermineSnatFeatureOnHost(snatFile, nmAgentSupportedApisURL string) (snatDNS, snatHost bool, err error)
- func (m *MockMultitenancy) GetContainerNetworkConfiguration(ctx context.Context, nwCfg *cni.NetworkConfig, podName string, ...) (*cns.GetNetworkContainerResponse, net.IPNet, error)
- func (m *MockMultitenancy) Init(cnsclient cnsclient, netnetioshim netioshim)
- func (m *MockMultitenancy) SetupRoutingForMultitenancy(nwCfg *cni.NetworkConfig, cnsNetworkConfig *cns.GetNetworkContainerResponse, ...)
- type Multitenancy
- func (m *Multitenancy) DetermineSnatFeatureOnHost(snatFile, nmAgentSupportedApisURL string) (snatForDNS, snatOnHost bool, err error)
- func (m *Multitenancy) GetContainerNetworkConfiguration(ctx context.Context, nwCfg *cni.NetworkConfig, podName, podNamespace string) (*cns.GetNetworkContainerResponse, net.IPNet, error)
- func (m *Multitenancy) Init(cnsclient cnsclient, netioshim netioshim)
- func (m *Multitenancy) SetupRoutingForMultitenancy(nwCfg *cni.NetworkConfig, cnsNetworkConfig *cns.GetNetworkContainerResponse, ...)
- type MultitenancyClient
- type NetPlugin
- func (plugin *NetPlugin) Add(args *cniSkel.CmdArgs) error
- func (plugin *NetPlugin) Delete(args *cniSkel.CmdArgs) error
- func (plugin *NetPlugin) Get(args *cniSkel.CmdArgs) error
- func (plugin *NetPlugin) GetAllEndpointState(networkid string) (*api.AzureCNIState, error)
- func (plugin *NetPlugin) SetCNIReport(report *telemetry.CNIReport, tb *telemetry.TelemetryBuffer)
- func (plugin *NetPlugin) Start(config *common.PluginConfig) error
- func (plugin *NetPlugin) Stop()
- func (plugin *NetPlugin) Update(args *cniSkel.CmdArgs) error
- type NnsClient
- type PolicyArgs
Constants ¶
const ( CNI_ADD = "ADD" CNI_DEL = "DEL" CNI_UPDATE = "UPDATE" )
CNI Operation Types
Variables ¶
This section is empty.
Functions ¶
func GetEndpointID ¶
GetEndpointID returns a unique endpoint ID based on the CNI args.
func SetCustomDimensions ¶
func SetCustomDimensions(cniMetric *telemetry.AIMetric, nwCfg *cni.NetworkConfig, err error)
Types ¶
type AzureIPAMInvoker ¶
type AzureIPAMInvoker struct {
// contains filtered or unexported fields
}
func NewAzureIpamInvoker ¶
func NewAzureIpamInvoker(plugin *NetPlugin, nwInfo *network.NetworkInfo) *AzureIPAMInvoker
Create an IPAM instance every time a CNI action is called.
func (*AzureIPAMInvoker) Add ¶
func (invoker *AzureIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, error)
type AzureNetIOShim ¶
type AzureNetIOShim struct{}
func (AzureNetIOShim) GetInterfaceSubnetWithSpecificIP ¶
func (a AzureNetIOShim) GetInterfaceSubnetWithSpecificIP(ipAddr string) *net.IPNet
type CNSIPAMInvoker ¶
type CNSIPAMInvoker struct {
// contains filtered or unexported fields
}
func NewCNSInvoker ¶
func NewCNSInvoker(podName, namespace string, cnsClient cnsclient, executionMode util.ExecutionMode, ipamMode util.IpamMode) *CNSIPAMInvoker
func (*CNSIPAMInvoker) Add ¶
func (invoker *CNSIPAMInvoker) Add(addConfig IPAMAddConfig) (IPAMAddResult, error)
Add uses the requestipconfig API in cns, and returns ipv4 and a nil ipv6 as CNS doesn't support IPv6 yet
type IPAMAddConfig ¶
type IPAMAddConfig struct {
// contains filtered or unexported fields
}
type IPAMAddResult ¶
type IPAMAddResult struct {
// contains filtered or unexported fields
}
type IPAMInvoker ¶
type IPAMInvoker interface { // Add returns two results, one IPv4, the other IPv6. Add(IPAMAddConfig) (IPAMAddResult, error) // Delete calls to the invoker source, and returns error. Returning an error here will fail the CNI Delete call. Delete(address *net.IPNet, nwCfg *cni.NetworkConfig, args *cniSkel.CmdArgs, options map[string]interface{}) error }
IPAMInvoker is used by the azure-vnet CNI plugin to call different sources for IPAM. This interface can be used to call into external binaries, like the azure-vnet-ipam binary, or simply act as a client to an external ipam, such as azure-cns.
type IPv4ResultInfo ¶ added in v1.1.8
type IPv4ResultInfo struct {
// contains filtered or unexported fields
}
type MockIpamInvoker ¶
type MockIpamInvoker struct {
// contains filtered or unexported fields
}
func NewMockIpamInvoker ¶
func NewMockIpamInvoker(ipv6, v4Fail, v6Fail bool) *MockIpamInvoker
func (*MockIpamInvoker) Add ¶
func (invoker *MockIpamInvoker) Add(opt IPAMAddConfig) (ipamAddResult IPAMAddResult, err error)
type MockMultitenancy ¶
type MockMultitenancy struct {
// contains filtered or unexported fields
}
func NewMockMultitenancy ¶
func NewMockMultitenancy(fail bool) *MockMultitenancy
func (*MockMultitenancy) DetermineSnatFeatureOnHost ¶
func (m *MockMultitenancy) DetermineSnatFeatureOnHost(snatFile, nmAgentSupportedApisURL string) (snatDNS, snatHost bool, err error)
func (*MockMultitenancy) GetContainerNetworkConfiguration ¶ added in v1.4.13
func (m *MockMultitenancy) GetContainerNetworkConfiguration( ctx context.Context, nwCfg *cni.NetworkConfig, podName string, podNamespace string, ) (*cns.GetNetworkContainerResponse, net.IPNet, error)
func (*MockMultitenancy) Init ¶
func (m *MockMultitenancy) Init(cnsclient cnsclient, netnetioshim netioshim)
func (*MockMultitenancy) SetupRoutingForMultitenancy ¶
func (m *MockMultitenancy) SetupRoutingForMultitenancy( nwCfg *cni.NetworkConfig, cnsNetworkConfig *cns.GetNetworkContainerResponse, azIpamResult *current.Result, epInfo *network.EndpointInfo, result *current.Result)
type Multitenancy ¶
type Multitenancy struct {
// contains filtered or unexported fields
}
func (*Multitenancy) DetermineSnatFeatureOnHost ¶
func (m *Multitenancy) DetermineSnatFeatureOnHost(snatFile, nmAgentSupportedApisURL string) (snatForDNS, snatOnHost bool, err error)
DetermineSnatFeatureOnHost - Temporary function to determine whether we need to disable SNAT due to NMAgent support
func (*Multitenancy) GetContainerNetworkConfiguration ¶ added in v1.4.13
func (m *Multitenancy) GetContainerNetworkConfiguration( ctx context.Context, nwCfg *cni.NetworkConfig, podName, podNamespace string, ) (*cns.GetNetworkContainerResponse, net.IPNet, error)
func (*Multitenancy) Init ¶
func (m *Multitenancy) Init(cnsclient cnsclient, netioshim netioshim)
func (*Multitenancy) SetupRoutingForMultitenancy ¶
func (m *Multitenancy) SetupRoutingForMultitenancy( nwCfg *cni.NetworkConfig, cnsNetworkConfig *cns.GetNetworkContainerResponse, azIpamResult *cniTypesCurr.Result, epInfo *network.EndpointInfo, result *cniTypesCurr.Result, )
type MultitenancyClient ¶
type MultitenancyClient interface { SetupRoutingForMultitenancy( nwCfg *cni.NetworkConfig, cnsNetworkConfig *cns.GetNetworkContainerResponse, azIpamResult *cniTypesCurr.Result, epInfo *network.EndpointInfo, result *cniTypesCurr.Result) DetermineSnatFeatureOnHost( snatFile string, nmAgentSupportedApisURL string) (bool, bool, error) GetContainerNetworkConfiguration( ctx context.Context, nwCfg *cni.NetworkConfig, podName string, podNamespace string) (*cns.GetNetworkContainerResponse, net.IPNet, error) Init(cnsclient cnsclient, netioshim netioshim) }
MultitenancyClient interface
type NetPlugin ¶
NetPlugin represents the CNI network plugin.
func NewPlugin ¶
func NewPlugin(name string, config *common.PluginConfig, client NnsClient, multitenancyClient MultitenancyClient, ) (*NetPlugin, error)
NewPlugin creates a new NetPlugin object.
func (*NetPlugin) GetAllEndpointState ¶
func (plugin *NetPlugin) GetAllEndpointState(networkid string) (*api.AzureCNIState, error)
func (*NetPlugin) SetCNIReport ¶
func (plugin *NetPlugin) SetCNIReport(report *telemetry.CNIReport, tb *telemetry.TelemetryBuffer)
type NnsClient ¶
type NnsClient interface { // Do network port programming for the pod via node network service. // podName - name of the pod as received from containerD // nwNamesapce - network namespace name as received from containerD AddContainerNetworking(ctx context.Context, podName, nwNamespace string) (*nnscontracts.ConfigureContainerNetworkingResponse, error) // Undo or delete network port programming for the pod via node network service. // podName - name of the pod as received from containerD // nwNamesapce - network namespace name as received from containerD DeleteContainerNetworking(ctx context.Context, podName, nwNamespace string) (*nnscontracts.ConfigureContainerNetworkingResponse, error) }
client for node network service
type PolicyArgs ¶
type PolicyArgs struct {
// contains filtered or unexported fields
}