Documentation ¶
Index ¶
- Constants
- Variables
- func KubePodsToPodInfoByIP(pods []corev1.Pod) (map[string]PodInfo, error)
- type AttachContainerToNetworkResponse
- type ConfigureContainerNetworkingRequest
- type CreateHnsNetworkRequest
- type CreateHostNCApipaEndpointRequest
- type CreateHostNCApipaEndpointResponse
- type CreateNetworkContainerRequest
- type CreateNetworkContainerResponse
- type CreateNetworkRequest
- type DeleteHnsNetworkRequest
- type DeleteHostNCApipaEndpointRequest
- type DeleteHostNCApipaEndpointResponse
- type DeleteNetworkContainerRequest
- type DeleteNetworkContainerResponse
- type DeleteNetworkRequest
- type DetachContainerFromNetworkResponse
- type EndpointRequest
- type GetAllNetworkContainersResponse
- type GetHomeAzResponse
- type GetIPAddressStateResponse
- type GetIPAddressStatusResponse
- type GetIPAddressesRequest
- type GetIPAddressesResponse
- type GetInterfaceForContainerRequest
- type GetInterfaceForContainerResponse
- type GetNetworkContainerRequest
- type GetNetworkContainerResponse
- type GetNetworkContainerStatusRequest
- type GetNetworkContainerStatusResponse
- type GetPodContextResponse
- type HTTPService
- type HomeAzResponse
- type HostIPInfo
- type HostLocalIPAddressResponse
- type IPAMPoolMonitor
- type IPAddressState
- type IPAddressesUtilizationResponse
- type IPConfigRequest
- type IPConfigResponse
- type IPConfigsHandlerFunc
- type IPConfigsHandlerMiddleware
- type IPConfigsRequest
- type IPConfigsResponse
- type IPConfiguration
- type IPConfigurationStatus
- func (i *IPConfigurationStatus) Equals(o IPConfigurationStatus) bool
- func (i *IPConfigurationStatus) GetState() types.IPState
- func (i IPConfigurationStatus) MarshalJSON() ([]byte, error)
- func (i *IPConfigurationStatus) SetState(s types.IPState)
- func (i IPConfigurationStatus) String() string
- func (i *IPConfigurationStatus) UnmarshalJSON(b []byte) error
- func (i *IPConfigurationStatus) WithStateMiddleware(fs ...stateMiddlewareFunc)
- type IPSubnet
- type IpamPoolMonitorStateSnapshot
- type KubernetesPodInfo
- type MacPool
- type MultiTenancyInfo
- type NICType
- type NetworkContainerParameters
- type NetworkContainerRequestPolicies
- type NetworkInterface
- type NetworkInterfaceInfo
- type NmAgentSupportedApisRequest
- type NmAgentSupportedApisResponse
- type NodeConfiguration
- type NodeInfoResponse
- type NodeRegisterRequest
- type NumOfCPUCoresResponse
- type OptionMap
- type OverlayConfiguration
- type PodInfo
- type PodInfoByIPProvider
- type PodInfoByIPProviderFunc
- type PodIpInfo
- type PostNetworkContainersRequest
- type PostNetworkContainersResponse
- type PublishNetworkContainerRequest
- type PublishNetworkContainerResponse
- type ReleaseIPAddressRequest
- type ReserveIPAddressRequest
- type ReserveIPAddressResponse
- type Response
- type Route
- type SecondaryIPConfig
- type Service
- func (service *Service) AddListener(config *common.ServiceConfig) error
- func (service *Service) Initialize(config *common.ServiceConfig) error
- func (service *Service) ParseOptions(options OptionMap) OptionMap
- func (service *Service) SendErrorResponse(w http.ResponseWriter, errMsg error)
- func (service *Service) StartListener(config *common.ServiceConfig) error
- func (service *Service) Uninitialize()
- type SetEnvironmentRequest
- type SetOrchestratorTypeRequest
- type Subnet
- type SubnetInfo
- type UnpublishNetworkContainerRequest
- type UnpublishNetworkContainerResponse
- type ValidAclPolicySetting
Constants ¶
const ( SetOrchestratorType = "/network/setorchestratortype" GetHomeAz = "/homeaz" CreateOrUpdateNetworkContainer = "/network/createorupdatenetworkcontainer" DeleteNetworkContainer = "/network/deletenetworkcontainer" PublishNetworkContainer = "/network/publishnetworkcontainer" UnpublishNetworkContainer = "/network/unpublishnetworkcontainer" GetInterfaceForContainer = "/network/getinterfaceforcontainer" GetNetworkContainerByOrchestratorContext = "/network/getnetworkcontainerbyorchestratorcontext" GetAllNetworkContainers = "/network/getAllNetworkContainers" NetworkContainersURLPath = "/network/networkcontainers" AttachContainerToNetwork = "/network/attachcontainertonetwork" DetachContainerFromNetwork = "/network/detachcontainerfromnetwork" RequestIPConfig = "/network/requestipconfig" RequestIPConfigs = "/network/requestipconfigs" ReleaseIPConfig = "/network/releaseipconfig" ReleaseIPConfigs = "/network/releaseipconfigs" PathDebugIPAddresses = "/debug/ipaddresses" PathDebugPodContext = "/debug/podcontext" PathDebugRestData = "/debug/restdata" NumberOfCPUCores = NumberOfCPUCoresPath NMAgentSupportedAPIs = NmAgentSupportedApisPath EndpointAPI = EndpointPath )
Container Network Service DNC Contract
const ( AzureContainerInstance = "AzureContainerInstance" WebApps = "WebApps" Docker = "Docker" Basic = "Basic" JobObject = "JobObject" COW = "COW" // Container on Windows BackendNICNC = "BackendNICNC" )
NetworkContainer Types
const ( Kubernetes = "Kubernetes" ServiceFabric = "ServiceFabric" Batch = "Batch" DBforPostgreSQL = "DBforPostgreSQL" AzureFirstParty = "AzureFirstParty" KubernetesCRD = "KubernetesCRD" )
Orchestrator Types
const ( Vlan = "Vlan" Vxlan = "Vxlan" )
Encap Types
const ( Direct = "Direct" Managed = "Managed" CRD = "CRD" MultiTenantCRD = "MultiTenantCRD" )
ChannelMode :- CNS channel modes
const ( KubernetesPodInfoScheme podInfoScheme = iota InterfaceIDPodInfoScheme InfraIDPodInfoScheme )
const ( ActionTypeAllow string = "Allow" ActionTypeBlock string = "Block" DirectionTypeIn string = "In" DirectionTypeOut string = "Out" )
const ( SetEnvironmentPath = "/network/environment" CreateNetworkPath = "/network/create" DeleteNetworkPath = "/network/delete" CreateHnsNetworkPath = "/network/hns/create" DeleteHnsNetworkPath = "/network/hns/delete" ReserveIPAddressPath = "/network/ip/reserve" ReleaseIPAddressPath = "/network/ip/release" GetHostLocalIPPath = "/network/ip/hostlocal" GetIPAddressUtilizationPath = "/network/ip/utilization" GetUnhealthyIPAddressesPath = "/network/ipaddresses/unhealthy" GetHealthReportPath = "/network/health" NumberOfCPUCoresPath = "/hostcpucores" CreateHostNCApipaEndpointPath = "/network/createhostncapipaendpoint" DeleteHostNCApipaEndpointPath = "/network/deletehostncapipaendpoint" NmAgentSupportedApisPath = "/network/nmagentsupportedapis" V1Prefix = "/v0.1" V2Prefix = "/v0.2" EndpointPath = "/network/endpoints/" )
Container Network Service remote API Contract
const (
SwiftPrefix = "Swift_"
)
NetworkContainer Prefixes
Variables ¶
var ErrDuplicateIP = errors.New("duplicate IP detected in CNS initialization")
ErrDuplicateIP indicates that a duplicate IP has been detected during a reconcile.
var ErrInvalidNCID = errors.New("invalid NetworkContainerID")
var GlobalPodInfoScheme podInfoScheme
Functions ¶
Types ¶
type AttachContainerToNetworkResponse ¶
type AttachContainerToNetworkResponse struct {
Response Response
}
AttachContainerToNetworkResponse specifies response of attaching network container to network.
type ConfigureContainerNetworkingRequest ¶
ConfigureContainerNetworkingRequest - specifies request to attach/detach container to network.
type CreateHnsNetworkRequest ¶
type CreateHnsNetworkRequest struct { NetworkName string NetworkType string NetworkAdapterName string `json:",omitempty"` SourceMac string `json:",omitempty"` Policies []json.RawMessage `json:",omitempty"` MacPools []MacPool `json:",omitempty"` Subnets []SubnetInfo DNSSuffix string `json:",omitempty"` DNSServerList string `json:",omitempty"` DNSServerCompartment uint32 `json:",omitempty"` ManagementIP string `json:",omitempty"` AutomaticDNS bool `json:",omitempty"` }
CreateHnsNetworkRequest describes request to create the HNS network.
type CreateHostNCApipaEndpointRequest ¶
type CreateHostNCApipaEndpointRequest struct {
NetworkContainerID string
}
CreateHostNCApipaEndpointRequest describes request for create apipa endpoint for host container connectivity for the given network container
type CreateHostNCApipaEndpointResponse ¶
CreateHostNCApipaEndpointResponse describes response for create apipa endpoint request for host container connectivity.
type CreateNetworkContainerRequest ¶
type CreateNetworkContainerRequest struct { HostPrimaryIP string Version string NetworkContainerType string NetworkContainerid string // Mandatory input. PrimaryInterfaceIdentifier string // Primary CA. AuthorizationToken string LocalIPConfiguration IPConfiguration OrchestratorContext json.RawMessage IPConfiguration IPConfiguration SecondaryIPConfigs map[string]SecondaryIPConfig // uuid is key MultiTenancyInfo MultiTenancyInfo CnetAddressSpace []IPSubnet // To setup SNAT (should include service endpoint vips). Routes []Route AllowHostToNCCommunication bool AllowNCToHostCommunication bool EndpointPolicies []NetworkContainerRequestPolicies NCStatus v1alpha.NCStatus NetworkInterfaceInfo NetworkInterfaceInfo //nolint // introducing new field for backendnic, to be used later by cni code }
CreateNetworkContainerRequest specifies request to create a network container or network isolation boundary.
func (*CreateNetworkContainerRequest) String ¶
func (req *CreateNetworkContainerRequest) String() string
CreateNetworkContainerRequest implements fmt.Stringer for logging
func (*CreateNetworkContainerRequest) Validate ¶
func (req *CreateNetworkContainerRequest) Validate() error
type CreateNetworkContainerResponse ¶
type CreateNetworkContainerResponse struct {
Response Response
}
CreateNetworkContainerResponse specifies response of creating a network container.
type CreateNetworkRequest ¶
type CreateNetworkRequest struct { NetworkName string OverlayConfiguration OverlayConfiguration Options map[string]interface{} }
CreateNetworkRequest describes request to create the network.
type DeleteHnsNetworkRequest ¶
type DeleteHnsNetworkRequest struct {
NetworkName string
}
DeleteHnsNetworkRequest describes request to delete the HNS network.
type DeleteHostNCApipaEndpointRequest ¶
type DeleteHostNCApipaEndpointRequest struct {
NetworkContainerID string
}
DeleteHostNCApipaEndpointRequest describes request for deleting apipa endpoint created for host NC connectivity.
type DeleteHostNCApipaEndpointResponse ¶
type DeleteHostNCApipaEndpointResponse struct {
Response Response
}
DeleteHostNCApipaEndpointResponse describes response for delete host NC apipa endpoint request.
type DeleteNetworkContainerRequest ¶
type DeleteNetworkContainerRequest struct {
NetworkContainerid string
}
DeleteNetworkContainerRequest specifies the details about the request to delete a specific network container.
type DeleteNetworkContainerResponse ¶
type DeleteNetworkContainerResponse struct {
Response Response
}
DeleteNetworkContainerResponse describes the response to delete a specific network container.
type DeleteNetworkRequest ¶
type DeleteNetworkRequest struct {
NetworkName string
}
DeleteNetworkRequest describes request to delete the network.
type DetachContainerFromNetworkResponse ¶
type DetachContainerFromNetworkResponse struct {
Response Response
}
DetachContainerFromNetworkResponse specifies response of detaching network container from network.
type EndpointRequest ¶ added in v1.5.17
type EndpointRequest struct { HnsEndpointID string `json:"hnsEndpointID"` HostVethName string `json:"hostVethName"` InterfaceName string `json:"InterfaceName"` }
Used by EndpointHandler API to update endpoint state.
type GetAllNetworkContainersResponse ¶
type GetAllNetworkContainersResponse struct { NetworkContainers []GetNetworkContainerResponse Response Response }
GetAllNetworkContainersResponse specifies response of retrieving all NCs from CNS during the process of NC refresh association.
type GetHomeAzResponse ¶
type GetHomeAzResponse struct { Response Response `json:"response"` HomeAzResponse HomeAzResponse `json:"homeAzResponse"` }
type GetIPAddressStateResponse ¶
type GetIPAddressStateResponse struct { IPAddresses []IPAddressState Response Response }
GetIPAddressStateResponse is used in CNS IPAM mode as a response to get IP address state
type GetIPAddressStatusResponse ¶
type GetIPAddressStatusResponse struct { IPConfigurationStatus []IPConfigurationStatus Response Response }
GetIPAddressStatusResponse is used in CNS IPAM mode as a response to get IP address, state and Pod info
type GetIPAddressesRequest ¶
GetIPAddressesRequest is used in CNS IPAM mode to get the states of IPConfigs The IPConfigStateFilter is a slice of IPs to fetch from CNS that match those states
type GetIPAddressesResponse ¶
GetIPAddressesResponse describes response containing requested ip addresses.
type GetInterfaceForContainerRequest ¶
type GetInterfaceForContainerRequest struct {
NetworkContainerID string
}
GetInterfaceForContainerRequest specifies the container ID for which interface needs to be identified.
type GetInterfaceForContainerResponse ¶
type GetInterfaceForContainerResponse struct { NetworkContainerVersion string NetworkInterface NetworkInterface CnetAddressSpace []IPSubnet DNSServers []string Response Response }
GetInterfaceForContainerResponse specifies the interface for a given container ID.
type GetNetworkContainerRequest ¶
type GetNetworkContainerRequest struct { NetworkContainerid string OrchestratorContext json.RawMessage }
GetNetworkContainerRequest specifies the details about the request to retrieve a specific network container.
type GetNetworkContainerResponse ¶
type GetNetworkContainerResponse struct { NetworkContainerID string IPConfiguration IPConfiguration Routes []Route CnetAddressSpace []IPSubnet MultiTenancyInfo MultiTenancyInfo PrimaryInterfaceIdentifier string LocalIPConfiguration IPConfiguration Response Response AllowHostToNCCommunication bool AllowNCToHostCommunication bool NetworkInterfaceInfo NetworkInterfaceInfo }
GetNetworkContainerResponse describes the response to retrieve a specific network container.
type GetNetworkContainerStatusRequest ¶
type GetNetworkContainerStatusRequest struct {
NetworkContainerid string
}
GetNetworkContainerStatusRequest specifies the details about the request to retrieve status of a specific network container.
type GetNetworkContainerStatusResponse ¶
type GetNetworkContainerStatusResponse struct { NetworkContainerid string Version string AzureHostVersion string Response Response }
GetNetworkContainerStatusResponse specifies response of retrieving a network container status.
type GetPodContextResponse ¶
type GetPodContextResponse struct { PodContext map[string][]string // Can have multiple Pod IP UUIDs in the case of dualstack Response Response }
GetPodContextResponse is used in CNS Client debug mode to get mapping of Orchestrator Context to Pod IP UUIDs
type HTTPService ¶
type HTTPService interface { common.ServiceAPI SendNCSnapShotPeriodically(context.Context, int) SetNodeOrchestrator(*SetOrchestratorTypeRequest) SyncNodeStatus(string, string, string, json.RawMessage) (types.ResponseCode, string) GetPendingProgramIPConfigs() []IPConfigurationStatus GetAvailableIPConfigs() []IPConfigurationStatus GetAssignedIPConfigs() []IPConfigurationStatus GetPendingReleaseIPConfigs() []IPConfigurationStatus GetPodIPConfigState() map[string]IPConfigurationStatus MarkIPAsPendingRelease(numberToMark int) (map[string]IPConfigurationStatus, error) AttachIPConfigsHandlerMiddleware(IPConfigsHandlerMiddleware) MarkNIPsPendingRelease(n int) (map[string]IPConfigurationStatus, error) }
HTTPService describes the min API interface that every service should have.
type HomeAzResponse ¶
type HostIPInfo ¶
type HostLocalIPAddressResponse ¶
HostLocalIPAddressResponse describes reponse that returns the host local IP Address.
type IPAMPoolMonitor ¶
type IPAMPoolMonitor interface { Start(ctx context.Context) error Update(nnc *v1alpha.NodeNetworkConfig) error GetStateSnapshot() IpamPoolMonitorStateSnapshot }
IpamPoolMonitorStateSnapshot struct to expose state values for IPAMPoolMonitor struct
type IPAddressState ¶
IPAddressState Only used in the GetIPConfig API to return IPs that match a filter
type IPAddressesUtilizationResponse ¶
type IPAddressesUtilizationResponse struct { Response Response Available int Reserved int Unhealthy int }
IPAddressesUtilizationResponse describes response for ip address utilization.
type IPConfigRequest ¶
type IPConfigResponse ¶
IPConfigResponse is used in CNS IPAM mode as a response to CNI ADD
type IPConfigsHandlerFunc ¶ added in v1.5.19
type IPConfigsHandlerFunc func(context.Context, IPConfigsRequest) (*IPConfigsResponse, error)
IPConfigsHandlerFunc
type IPConfigsHandlerMiddleware ¶ added in v1.5.19
type IPConfigsHandlerMiddleware interface {
IPConfigsRequestHandlerWrapper(defaultHandler IPConfigsHandlerFunc, failureHandler IPConfigsHandlerFunc) IPConfigsHandlerFunc
}
IPConfigsHandlerMiddleware
type IPConfigsRequest ¶
type IPConfigsRequest struct { DesiredIPAddresses []string `json:"desiredIPAddresses"` PodInterfaceID string `json:"podInterfaceID"` InfraContainerID string `json:"infraContainerID"` OrchestratorContext json.RawMessage `json:"orchestratorContext"` Ifname string `json:"ifname"` // Used by delegated IPAM SecondaryInterfacesExist bool `json:"secondaryInterfacesExist"` // will be set by SWIFT v2 validator func }
Same as IPConfigRequest except that DesiredIPAddresses is passed in as a slice
type IPConfigsResponse ¶
type IPConfigsResponse struct { PodIPInfo []PodIpInfo `json:"podIPInfo"` Response Response `json:"response"` }
IPConfigsResponse is used in CNS IPAM mode to return a slice of IP configs as a response to CNI ADD
type IPConfiguration ¶
IPConfiguration contains details about ip config to provision in the VM.
type IPConfigurationStatus ¶
type IPConfigurationStatus struct { ID string // uuid IPAddress string LastStateTransition time.Time NCID string PodInfo PodInfo // contains filtered or unexported fields }
This is used for KubernetesCRD orchestrator Type where NC has multiple ips. This struct captures the state for SecondaryIPs associated to a given NC
func (*IPConfigurationStatus) Equals ¶
func (i *IPConfigurationStatus) Equals(o IPConfigurationStatus) bool
Equals compares a subset of the IPConfigurationStatus fields since a direct DeepEquals or otherwise complete comparison of two IPConfigurationStatus objects compares internal state details that don't impact their functional equality.
func (*IPConfigurationStatus) GetState ¶
func (i *IPConfigurationStatus) GetState() types.IPState
func (IPConfigurationStatus) MarshalJSON ¶
func (i IPConfigurationStatus) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshaller for IPConfigurationStatus that is capable of marshalling the private fields in the struct. The default marshaller can't see private fields by default, so we alias the type through a struct that has public fields for the original struct's private fields, embed the original struct in an anonymous struct as the alias type, and then let the default marshaller do its magic.
func (*IPConfigurationStatus) SetState ¶
func (i *IPConfigurationStatus) SetState(s types.IPState)
func (IPConfigurationStatus) String ¶
func (i IPConfigurationStatus) String() string
func (*IPConfigurationStatus) UnmarshalJSON ¶
func (i *IPConfigurationStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON is a custom unmarshaller for IPConfigurationStatus that is capable of unmarshalling to interface type `PodInfo` contained in the struct. Without this custom unmarshaller, the default unmarshaller can't deserialize the json data in to that interface type.
func (*IPConfigurationStatus) WithStateMiddleware ¶
func (i *IPConfigurationStatus) WithStateMiddleware(fs ...stateMiddlewareFunc)
type IpamPoolMonitorStateSnapshot ¶
type IpamPoolMonitorStateSnapshot struct { MinimumFreeIps int64 MaximumFreeIps int64 UpdatingIpsNotInUseCount int64 CachedNNC v1alpha.NodeNetworkConfig }
type KubernetesPodInfo ¶
type MacPool ¶
MacPool is assoicated with HNS network and represents a list of macaddresses available to the network
type MultiTenancyInfo ¶
type MultiTenancyInfo struct { EncapType string ID int // This can be vlanid, vxlanid, gre-key etc. (depends on EnacapType). }
MultiTenancyInfo contains encap type and id.
type NICType ¶
type NICType string
const ( InfraNIC NICType = "InfraNIC" // DelegatedVMNIC are projected from VM to container network namespace DelegatedVMNIC NICType = "DelegatedVMNIC" // BackendNIC are used for infiniband NICs on a VM BackendNIC NICType = "BackendNIC" // NodeNetworkInterfaceAccelnetFrontendNIC is a type of front-end nic that offers accelerated networking performance NodeNetworkInterfaceAccelnetFrontendNIC NICType = "FrontendNIC_Accelnet" // TODO: These two const are currently unused due to version compatibility with DNC. DelegatedVMNIC and NodeNetworkInterfaceBackendNIC should be renamed to align with the naming convention with DNC // NodeNetworkInterfaceFrontendNIC is the new name for DelegatedVMNIC NodeNetworkInterfaceFrontendNIC NICType = "FrontendNIC" // NodeNetworkInterfaceBackendNIC is the new name for BackendNIC NodeNetworkInterfaceBackendNIC NICType = "BackendNIC" )
NIC Types
type NetworkContainerParameters ¶
type NetworkContainerParameters struct { NCID string AuthToken string AssociatedInterfaceID string }
NetworkContainerParameters parameters available in network container operations
type NetworkContainerRequestPolicies ¶
type NetworkContainerRequestPolicies struct { Type string EndpointType string Settings json.RawMessage }
NetworkContainerRequestPolicies - specifies policies associated with create network request
func (*NetworkContainerRequestPolicies) Validate ¶
func (networkContainerRequestPolicy *NetworkContainerRequestPolicies) Validate() error
Validate - Validates network container request policies
type NetworkInterface ¶
NetworkInterface specifies the information that can be used to uniquely identify an interface.
type NetworkInterfaceInfo ¶
type NmAgentSupportedApisRequest ¶
type NmAgentSupportedApisRequest struct {
GetNmAgentSupportedApisURL string
}
type NodeConfiguration ¶
NodeConfiguration describes confguration for a node in overlay network.
type NodeInfoResponse ¶
type NodeInfoResponse struct {
NetworkContainers []CreateNetworkContainerRequest
}
NodeInfoResponse - Struct to hold the node info response.
type NodeRegisterRequest ¶
NodeRegisterRequest - Struct to hold the node register request.
type NumOfCPUCoresResponse ¶
NumOfCPUCoresResponse describes num of cpu cores present on host.
type OptionMap ¶
type OptionMap map[string]interface{}
OptionMap describes generic options that can be passed to CNS.
type OverlayConfiguration ¶
type OverlayConfiguration struct { NodeCount int LocalNodeIP string OverlaySubent Subnet NodeConfig []NodeConfiguration }
OverlayConfiguration describes configuration for all the nodes that are part of overlay.
type PodInfo ¶
type PodInfo interface { // InfraContainerID the CRI infra container for the pod namespace. InfraContainerID() string // InterfaceID a short hash of the infra container and the primary network // interface of the pod net ns. InterfaceID() string // Key is a unique string representation of the PodInfo. Key() string // Name is the orchestrator pod name. Name() string // Namespace is the orchestrator pod namespace. Namespace() string // OrchestratorContext is a JSON KubernetesPodInfo OrchestratorContext() (json.RawMessage, error) // Equals implements a functional equals for PodInfos Equals(PodInfo) bool // String implements string for logging PodInfos String() string // SecondaryInterfacesExist returns true if there exist a secondary interface for this pod SecondaryInterfacesExist() bool }
PodInfo represents the object that we are providing network for.
func NewPodInfo ¶
NewPodInfo returns an implementation of PodInfo that returns the passed configuration for their namesake functions.
func NewPodInfoFromIPConfigsRequest ¶
func NewPodInfoFromIPConfigsRequest(req IPConfigsRequest) (PodInfo, error)
NewPodInfoFromIPConfigsRequest builds and returns an implementation of PodInfo from the provided IPConfigsRequest.
func UnmarshalPodInfo ¶
UnmarshalPodInfo wraps json.Unmarshal to return an implementation of PodInfo.
type PodInfoByIPProvider ¶
PodInfoByIPProvider to be implemented by initializers which provide a map of PodInfos by IP.
type PodInfoByIPProviderFunc ¶
PodInfoByIPProviderFunc functional type which implements PodInfoByIPProvider. Allows one-off functional implementations of the PodInfoByIPProvider interface when a custom type definition is not necessary.
func (PodInfoByIPProviderFunc) PodInfoByIP ¶
func (f PodInfoByIPProviderFunc) PodInfoByIP() (map[string]PodInfo, error)
PodInfoByIP implements PodInfoByIPProvider on PodInfByIPProviderFunc.
type PodIpInfo ¶
type PodIpInfo struct { PodIPConfig IPSubnet NetworkContainerPrimaryIPConfig IPConfiguration HostPrimaryIPInfo HostIPInfo NICType NICType InterfaceName string // MacAddress of interface MacAddress string // SkipDefaultRoutes is true if default routes should not be added on interface SkipDefaultRoutes bool // Routes to configure on interface Routes []Route }
type PostNetworkContainersRequest ¶
type PostNetworkContainersRequest struct {
CreateNetworkContainerRequests []CreateNetworkContainerRequest
}
PostNetworkContainersRequest specifies the request of creating all NCs that are sent from DNC.
func (*PostNetworkContainersRequest) Validate ¶
func (req *PostNetworkContainersRequest) Validate() error
type PostNetworkContainersResponse ¶
type PostNetworkContainersResponse struct {
Response Response
}
PostNetworkContainersResponse specifies response of creating all NCs that are sent from DNC.
type PublishNetworkContainerRequest ¶
type PublishNetworkContainerRequest struct { NetworkID string NetworkContainerID string JoinNetworkURL string CreateNetworkContainerURL string CreateNetworkContainerRequestBody []byte }
PublishNetworkContainerRequest specifies request to publish network container via NMAgent.
func (PublishNetworkContainerRequest) String ¶
func (p PublishNetworkContainerRequest) String() string
type PublishNetworkContainerResponse ¶
type PublishNetworkContainerResponse struct { Response Response PublishErrorStr string PublishStatusCode int PublishResponseBody []byte }
PublishNetworkContainerResponse specifies the response to publish network container request.
func (PublishNetworkContainerResponse) String ¶
func (p PublishNetworkContainerResponse) String() string
type ReleaseIPAddressRequest ¶
type ReleaseIPAddressRequest struct {
ReservationID string
}
ReleaseIPAddressRequest describes request to release an IP Address.
type ReserveIPAddressRequest ¶
type ReserveIPAddressRequest struct {
ReservationID string
}
ReserveIPAddressRequest describes request to reserve an IP Address
type ReserveIPAddressResponse ¶
ReserveIPAddressResponse describes response to reserve an IP address.
type Response ¶
type Response struct { ReturnCode types.ResponseCode Message string }
Response describes generic response from CNS.
type SecondaryIPConfig ¶
type SecondaryIPConfig struct { IPAddress string // NCVersion will help in determining whether IP is in pending programming or available when reconciling. NCVersion int }
SecondaryIPConfig contains IP info of SecondaryIP
type Service ¶
Service defines Container Networking Service.
func NewService ¶
func NewService(name, version, channelMode string, store store.KeyValueStore) (*Service, error)
NewService creates a new Service object.
func (*Service) AddListener ¶ added in v1.5.29
func (service *Service) AddListener(config *common.ServiceConfig) error
func (*Service) Initialize ¶
func (service *Service) Initialize(config *common.ServiceConfig) error
Initialize initializes the service and starts the listener.
func (*Service) ParseOptions ¶
ParseOptions returns generic options from a libnetwork request.
func (*Service) SendErrorResponse ¶
func (service *Service) SendErrorResponse(w http.ResponseWriter, errMsg error)
SendErrorResponse sends and logs an error response.
func (*Service) StartListener ¶
func (service *Service) StartListener(config *common.ServiceConfig) error
func (*Service) Uninitialize ¶
func (service *Service) Uninitialize()
Uninitialize cleans up the plugin.
type SetEnvironmentRequest ¶
SetEnvironmentRequest describes the Request to set the environment in CNS.
type SetOrchestratorTypeRequest ¶
type SetOrchestratorTypeRequest struct { OrchestratorType string DncPartitionKey string NodeID string }
SetOrchestratorTypeRequest specifies the orchestrator type for the node.
type SubnetInfo ¶
type SubnetInfo struct { AddressPrefix string GatewayAddress string Policies []json.RawMessage `json:",omitempty"` }
SubnetInfo is assoicated with HNS network and represents a list of subnets available to the network
type UnpublishNetworkContainerRequest ¶
type UnpublishNetworkContainerRequest struct { NetworkID string NetworkContainerID string JoinNetworkURL string DeleteNetworkContainerURL string DeleteNetworkContainerRequestBody []byte }
UnpublishNetworkContainerRequest specifies request to unpublish network container via NMAgent.
func (UnpublishNetworkContainerRequest) String ¶
func (u UnpublishNetworkContainerRequest) String() string
type UnpublishNetworkContainerResponse ¶
type UnpublishNetworkContainerResponse struct { Response Response UnpublishErrorStr string UnpublishStatusCode int UnpublishResponseBody []byte }
UnpublishNetworkContainerResponse specifies the response to unpublish network container request.
func (UnpublishNetworkContainerResponse) String ¶
func (u UnpublishNetworkContainerResponse) String() string
type ValidAclPolicySetting ¶
type ValidAclPolicySetting struct { Protocols string `json:","` Action string `json:","` Direction string `json:","` LocalAddresses string `json:","` RemoteAddresses string `json:","` LocalPorts string `json:","` RemotePorts string `json:","` RuleType string `json:","` Priority uint16 `json:","` }
ValidAclPolicySetting - Used to validate ACL policy
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
grpc
|
|
kubecontroller
|
|
mockclients
Package mockclients is a generated GoMock package.
|
Package mockclients is a generated GoMock package. |