Documentation
¶
Overview ¶
Package server is the package that contains thick pluigin's server libraries.
Index ¶
Constants ¶
const ( // DefaultMultusDaemonConfigFile is the Default path of the config file DefaultMultusDaemonConfigFile = "/etc/cni/net.d/multus.d/daemon-config.json" // DefaultMultusRunDir specifies default RunDir for multus DefaultMultusRunDir = "/run/multus/" // DefaultCertDuration specifies default duration for certs in per-node-certs config DefaultCertDuration = 10 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func FilesystemPreRequirements ¶
FilesystemPreRequirements ensures the target `rundir` features the correct permissions.
Types ¶
type ChrootExec ¶
type ChrootExec struct { Stderr io.Writer version.PluginDecoder // contains filtered or unexported fields }
ChrootExec implements invoke.Exec to execute CNI with chroot
func (*ChrootExec) ExecPlugin ¶
func (e *ChrootExec) ExecPlugin(ctx context.Context, pluginPath string, stdinData []byte, environ []string) ([]byte, error)
ExecPlugin executes CNI plugin with given environment/stdin data.
func (*ChrootExec) FindInPath ¶
func (e *ChrootExec) FindInPath(plugin string, paths []string) (string, error)
FindInPath try to find CNI plugin based on given path
type ControllerNetConf ¶
type ControllerNetConf struct { ChrootDir string `json:"chrootDir,omitempty"` LogFile string `json:"logFile"` LogLevel string `json:"logLevel"` LogToStderr bool `json:"logToStderr,omitempty"` PerNodeCertificate *PerNodeCertificate `json:"perNodeCertificate,omitempty"` MetricsPort *int `json:"metricsPort,omitempty"` // Option to point to the path of the unix domain socket through which the // multus client / server communicate. SocketDir string `json:"socketDir"` ConfigFileContents []byte `json:"-"` }
ControllerNetConf for the controller cni configuration
func LoadDaemonNetConf ¶
func LoadDaemonNetConf(config []byte) (*ControllerNetConf, error)
LoadDaemonNetConf loads the configuration for the multus daemon
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics represents server's metrics.
type PerNodeCertificate ¶ added in v4.1.0
type PerNodeCertificate struct { Enabled bool `json:"enabled,omitempty"` BootstrapKubeconfig string `json:"bootstrapKubeconfig,omitempty"` CertDir string `json:"certDir,omitempty"` CertDuration string `json:"certDuration,omitempty"` }
PerNodeCertificate for auto certificate generation for per node
type Server ¶
Server represents an HTTP server listening to a unix socket. It will handle the CNI shim requests issued when a pod is added / removed.
func NewCNIServer ¶
func NewCNIServer(daemonConfig *ControllerNetConf, serverConfig []byte, ignoreReadinessIndicator bool) (*Server, error)
NewCNIServer creates and returns a new Server object which will listen on a socket in the given path
func (*Server) HandleCNIRequest ¶
func (s *Server) HandleCNIRequest(cmd string, k8sArgs *types.K8sArgs, cniCmdArgs *skel.CmdArgs) ([]byte, error)
HandleCNIRequest is the CNI server handler function; it is invoked whenever a CNI request is processed.
func (*Server) HandleDelegateRequest ¶
func (s *Server) HandleDelegateRequest(cmd string, k8sArgs *types.K8sArgs, cniCmdArgs *skel.CmdArgs, interfaceAttributes *api.DelegateInterfaceAttributes) ([]byte, error)
HandleDelegateRequest is the CNI server handler function; it is invoked whenever a CNI request is processed as delegate CNI request.
Directories
¶
Path | Synopsis |
---|---|
Package api is the package that contains thick pluigin's server apis.
|
Package api is the package that contains thick pluigin's server apis. |
Package config is the package that contains the libraries that operates CNI config files
|
Package config is the package that contains the libraries that operates CNI config files |