Documentation ¶
Index ¶
- Constants
- func CNIGateway() (string, error)
- func CreateCNINetwork(ctx context.Context, cni gocni.CNI, task containerd.Task, ...) (*gocni.CNIResult, error)
- func DeleteCNINetwork(ctx context.Context, cni gocni.CNI, client *containerd.Client, name string) error
- func GetIPAddress(container string, PID uint32) (string, error)
- func InitNetwork() (gocni.CNI, error)
Constants ¶
View Source
const ( // CNIBinDir describes the directory where the CNI binaries are stored CNIBinDir = "/opt/cni/bin" // CNIConfDir describes the directory where the CNI plugin's configuration is stored CNIConfDir = "/etc/cni/net.d" // NetNSPathFmt gives the path to the a process network namespace, given the pid NetNSPathFmt = "/proc/%d/ns/net" // CNIDataDir is the directory CNI stores allocated IP for containers CNIDataDir = "/var/run/cni" )
Variables ¶
This section is empty.
Functions ¶
func CNIGateway ¶
CNIGateway returns the gateway for default subnet
func CreateCNINetwork ¶
func CreateCNINetwork(ctx context.Context, cni gocni.CNI, task containerd.Task, labels map[string]string) (*gocni.CNIResult, error)
CreateCNINetwork creates a CNI network interface and attaches it to the context
func DeleteCNINetwork ¶
func DeleteCNINetwork(ctx context.Context, cni gocni.CNI, client *containerd.Client, name string) error
DeleteCNINetwork deletes a CNI network based on task ID and Pid
func GetIPAddress ¶
GetIPAddress returns the IP address from container based on container name and PID
func InitNetwork ¶
InitNetwork writes configlist file and initializes CNI network
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.