Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PluginMain ¶ added in v1.19.0
func PluginMain(opts ...Option)
PluginMain is the main entry point for the Cilium CNI plugin.
Types ¶
type Cmd ¶
type Cmd struct {
// contains filtered or unexported fields
}
Cmd provides methods for the CNI ADD, DEL and CHECK commands.
func (*Cmd) Check ¶
Check implements the cni CHECK verb. It ensures that the interface is configured correctly
Currently, it verifies that - endpoint exists in the agent and is healthy - the interface in the container is sane
func (*Cmd) Del ¶
Del is invoked on CNI DEL
Note: ENI specific attributes do not need to be released as the ENIs and ENI IPs can be reused and are not released until the node terminates.
func (*Cmd) Status ¶ added in v1.18.0
Status implements the cni STATUS verb. Currently, it
- checks cilium-cni connectivity with cilium-agent using healthz endpoint
- If cilium-cni depends on delegated plugins (host-local, azure etc) for IPAM, cilium-cni invokes the STATUS API of the delegated plugins and passes the result back.
type OnConfigReady ¶ added in v1.19.0
type OnConfigReady interface {
OnConfigReady(args *skel.CmdArgs, cniArgs *types.ArgsSpec, conf *models.DaemonConfigurationStatus) error
}
OnConfigReady is invoked at the beginning of [(*Cmd).Add], right after the CNI network configuration, CNI arguments and the Cilium agent configuration were loaded. It may be used to sets up internal state of the hook.
type OnIPAMReady ¶ added in v1.19.0
type OnIPAMReady interface {
OnIPAMReady(ipam *models.IPAMResponse) error
}
OnIPAMReady is invoked after IPAM configuration was validated. It may be used to derive further endpoint configuration related to IPAM.
type OnInterfaceConfigReady ¶ added in v1.19.0
type OnInterfaceConfigReady interface {
OnInterfaceConfigReady(cmd *CmdState, ep *models.EndpointChangeRequest, res *cniTypesV1.Result) error
}
OnInterfaceConfigReady is invoked right before the pod's network interface pair is configured and the endpoint creation request is sent to the daemon. It may be used to modify the endpoint creation request, the command state and the CNI result accumulated so far.
type OnLinkConfigReady ¶ added in v1.19.0
type OnLinkConfigReady interface {
OnLinkConfigReady(linkConfig *connector.LinkConfig) error
}
OnLinkConfigReady is invoked before the datapath connectors are called to create the pod's network links (i.e. veth or netkit pairs). It may be used to further modify the link configuration.
type Option ¶
type Option func(cmd *Cmd)
Option allows the customization of the Cmd implementation
func WithOnConfigReady ¶ added in v1.19.0
func WithOnConfigReady(f OnConfigReady) Option
WithOnConfigReady adds a new callback to be invoked after the CNI network configuration, CNI arguments and the Cilium agent configuration were loaded.
func WithOnIPAMReady ¶ added in v1.19.0
func WithOnIPAMReady(f OnIPAMReady) Option
WithOnIPAMReady adds a new callback to be invoked after IPAM configuration was validated.
func WithOnInterfaceConfigReady ¶ added in v1.19.0
func WithOnInterfaceConfigReady(f OnInterfaceConfigReady) Option
WithOnInterfaceConfigReady adds a new callback to be invoked before the pod's network interface pair is configured.
func WithOnLinkConfigReady ¶ added in v1.19.0
func WithOnLinkConfigReady(f OnLinkConfigReady) Option
WithOnLinkConfigReady adds a new callback to be invoked before the datapath connectors are called to create the pod's network links.
func WithVersion ¶ added in v1.19.0
WithVersion overrides the version reported by the CNI plugin binary in its about string.