Documentation
¶
Index ¶
Constants ¶
const CNIAdd command = "ADD"
CNIAdd is the command representing add operation for a new pod
const CNIDel command = "DEL"
CNIDel is the command representing delete operation on a pod that is to be torn down
const CNIUpdate command = "UPDATE"
CNIUpdate is the command representing update operation for an existing pod
Variables ¶
This section is empty.
Functions ¶
func HandleCNIRequest ¶
func HandleCNIRequest(request *PodRequest) ([]byte, error)
HandleCNIRequest is the callback for all the requests coming to the cniserver after being procesed into PodRequest objects Argument '*PodRequest' encapsulates all the necessary information Return value is the actual bytes to be sent back without further processing.
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is the structure to hold the endpoint information and the corresponding functions to use it
func NewCNIPlugin ¶
NewCNIPlugin creates the internal Plugin object
type PodRequest ¶
type PodRequest struct {
// The CNI command of the operation
Command command
// kubernetes namespace name
PodNamespace string
// kubernetes pod name
PodName string
// kubernetes container ID
SandboxID string
// kernel network namespace path
Netns string
// Interface name to be configured
IfName string
// CNI conf obtained from stdin conf
CNIConf *types.NetConf
// Channel for returning the operation result to the Server
Result chan *PodResult
}
PodRequest structure built from Request which is passed to the handler function given to the Server at creation time
func (*PodRequest) ConfigureInterface ¶
func (pr *PodRequest) ConfigureInterface(namespace string, podName string, macAddress string, ipAddress string, gatewayIP string, mtu int, ingress, egress int64) ([]*current.Interface, error)
ConfigureInterface sets up the container interface
func (*PodRequest) PlatformSpecificCleanup ¶
func (pr *PodRequest) PlatformSpecificCleanup() error
PlatformSpecificCleanup deletes the OVS port
type PodResult ¶
type PodResult struct {
// Response to be returned to the OVN CNI plugin on success
Response []byte
// Error to be returned to the OVN CNI plugin on failure
Err error
}
PodResult of a PodRequest sent through the PodRequest's Result channel.
type Request ¶
type Request struct {
// CNI environment variables, like CNI_COMMAND and CNI_NETNS
Env map[string]string `json:"env,omitempty"`
// CNI configuration passed via stdin to the CNI plugin
Config []byte `json:"config,omitempty"`
}
Request sent to the Server by the OVN CNI plugin
type Server ¶
Server object that listens for JSON-marshaled Request objects on a private root-only Unix domain socket.
func NewCNIServer ¶
NewCNIServer creates and returns a new Server object which will listen on a socket in the given path