Documentation
¶
Overview ¶
Package api is the package that contains thick pluigin's server apis.
Index ¶
- Constants
- func CheckAPIReadyNow(socketPath string) error
- func CmdAdd(args *skel.CmdArgs) error
- func CmdCheck(args *skel.CmdArgs) error
- func CmdDel(args *skel.CmdArgs) error
- func CmdGC(args *skel.CmdArgs) error
- func CmdStatus(args *skel.CmdArgs) error
- func DoCNI(url string, req interface{}, socketPath string) ([]byte, error)
- func GetAPIEndpoint(endpoint string) string
- func SocketPath(rundir string) string
- func WaitUntilAPIReady(socketPath string) error
- type DelegateInterfaceAttributes
- type Request
- type Response
- type ShimNetConf
Constants ¶
const ( // APIReadyPollDuration specifies duration for API readiness check polling APIReadyPollDuration = 100 * time.Millisecond // APIReadyPollTimeout specifies timeout for API readiness check polling APIReadyPollTimeout = 60000 * time.Millisecond // MultusCNIAPIEndpoint is an endpoint for multus CNI request (for multus-shim) MultusCNIAPIEndpoint = "/cni" // MultusDelegateAPIEndpoint is an endpoint for multus delegate request (for hotplug) MultusDelegateAPIEndpoint = "/delegate" // MultusHealthAPIEndpoint is an endpoint API clients can query to know if they can communicate w/ multus server MultusHealthAPIEndpoint = "/healthz" // MultusReadyAPIEndpoint is like health, but starts returning status 500 once a sig-term is received. MultusReadyAPIEndpoint = "/readyz" )
Variables ¶
This section is empty.
Functions ¶
func CheckAPIReadyNow ¶ added in v4.1.0
CheckAPIReadyNow checks API readiness once
func DoCNI ¶
DoCNI sends a CNI request to the CNI server via JSON + HTTP over a root-owned unix socket, and returns the result
func GetAPIEndpoint ¶
GetAPIEndpoint returns endpoint URL for multus-daemon
func SocketPath ¶
SocketPath returns the path of the multus CNI socket
func WaitUntilAPIReady ¶ added in v4.1.0
WaitUntilAPIReady checks API readiness
Types ¶
type DelegateInterfaceAttributes ¶
type DelegateInterfaceAttributes struct {
// IPRequest contains an optional requested IP address for this network
// attachment
IPRequest []string `json:"ips,omitempty"`
// MacRequest contains an optional requested MAC address for this
// network attachment
MacRequest string `json:"mac,omitempty"`
// CNIArgs contains additional CNI arguments for the network interface
CNIArgs *map[string]interface{} `json:"cni-args"`
}
DelegateInterfaceAttributes annotates delegate request for additional config
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"`
// Annotation for Delegate request
InterfaceAttributes *DelegateInterfaceAttributes `json:"interfaceAttributes,omitempty"`
}
Request sent to the Server by the multus-shim
func CreateDelegateRequest ¶
func CreateDelegateRequest(cniCommand, cniContainerID, cniNetNS, cniIFName, podNamespace, podName, podUID string, cniConfig []byte, interfaceAttributes *DelegateInterfaceAttributes) *Request
CreateDelegateRequest creates Request for delegate API request
type Response ¶
Response represents the response (computed in the CNI server) for ADD / DEL / CHECK for a Pod.
type ShimNetConf ¶
type ShimNetConf struct {
CNIVersion string `json:"cniVersion,omitempty"`
MultusSocketDir string `json:"daemonSocketDir"`
LogFile string `json:"logFile,omitempty"`
LogLevel string `json:"logLevel,omitempty"`
LogToStderr bool `json:"logToStderr,omitempty"`
}
ShimNetConf for the SHIM cni config file written in json