Help us shape the future of Go! Take the 2026 Go Developer Survey

plugin

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CalicoDefaultInterfacePrefix = "cali"
)

Variables

View Source
var Calico = &CalicoConfig{}
View Source
var Flannel = &FlannelConfig{}

Functions

This section is empty.

Types

type BasePluginNode

type BasePluginNode struct {
	*model.NetNode
	IPCache          *k8s.IPCache
	SimplePluginNode SimplePluginNode
}

func (*BasePluginNode) Receive

func (b *BasePluginNode) Receive(upstream *model.Link) (trans []model.Transmission, err error)

func (*BasePluginNode) Send

func (b *BasePluginNode) Send(dst model.Endpoint, protocol model.Protocol) (trans []model.Transmission, err error)

type CalicoConfig

type CalicoConfig struct {
	HostMTU    int
	PodMTU     int
	IPIPPodMTU int
	Interface  string
}

func (*CalicoConfig) BindFlags

func (c *CalicoConfig) BindFlags(fs *pflag.FlagSet)

func (*CalicoConfig) Validate

func (c *CalicoConfig) Validate() error

type CalicoNetworkMode

type CalicoNetworkMode string
const (
	CalicoNetworkModelBGP  CalicoNetworkMode = "BGP"
	CalicoNetworkModeIPIP  CalicoNetworkMode = "IPIP"
	CalicoNetworkModeVXLan CalicoNetworkMode = "VXLan"

	CalicoTunnelInterface = "tunl0"
)

type CalicoPluginOptions

type CalicoPluginOptions struct {
	InfraShim        network.InfraShim
	HostMTU          int
	PodMTU           int
	IPIPPodMTU       int
	ServiceProcessor service.Processor
	Interface        string
}

type FlannelBackendType

type FlannelBackendType string
const (
	FlannelBackendTypeHostGW FlannelBackendType = "host-gw"
	FlannelBackendTypeVxlan  FlannelBackendType = "vxlan"
	FlannelBackendTypeAlloc  FlannelBackendType = "alloc"
)

type FlannelConfig

type FlannelConfig struct {
	BackendType string
	Bridge      string
	PodMTU      int
	IPMasq      bool
	Interface   string
}

func (*FlannelConfig) BindFlags

func (f *FlannelConfig) BindFlags(fs *pflag.FlagSet)

func (*FlannelConfig) Validate

func (f *FlannelConfig) Validate() error

type FlannelPluginOptions

type FlannelPluginOptions struct {
	InfraShim        network.InfraShim
	Bridge           string
	Interface        string
	PodMTU           int
	IPMasq           bool
	ClusterCIDR      *net.IPNet
	CNIMode          FlannelBackendType
	ServiceProcessor service.Processor
}

type GenericNetNode

type GenericNetNode struct {
	NetNode *model.NetNode
}

func (*GenericNetNode) Receive

func (n *GenericNetNode) Receive(upstream *model.Link) ([]model.Transmission, error)

func (*GenericNetNode) Send

type NetworkPolicyHandler

type NetworkPolicyHandler interface {
	CheckNetworkPolicy(src, dst model.Endpoint, protocol model.Protocol) ([]model.Suspicion, error)
}

func NewNetworkPolicy

func NewNetworkPolicy(serviceAddrSkipCidrRule bool, inClusterAddrEmitCidrRule bool, ipCache *k8s.IPCache, k8sCli *clientset.Clientset, service service.Processor) (NetworkPolicyHandler, error)

type Plugin

type Plugin interface {
	CreatePod(pod *k8s.Pod) (model.NetNodeAction, error)
	CreateNode(node *k8s.NodeInfo) (model.NetNodeAction, error)
}

func NewCalicoPlugin

func NewCalicoPlugin(ctx *ctx.Context, serviceProcessor service.Processor, infraShim network.InfraShim) (Plugin, error)

func NewCalicoPluginWithOptions

func NewCalicoPluginWithOptions(ctx *ctx.Context, options *CalicoPluginOptions) (Plugin, error)

func NewFlannelPlugin

func NewFlannelPlugin(ctx *ctx.Context, serviceProcessor service.Processor, infraShim network.InfraShim) (Plugin, error)

func NewFlannelPluginWithOptions

func NewFlannelPluginWithOptions(ctx *ctx.Context, options *FlannelPluginOptions) (Plugin, error)

type SimplePluginNode

type SimplePluginNode interface {
	ToPod(upstream *model.Link, dst model.Endpoint, protocol model.Protocol, pod *v1.Pod) ([]model.Transmission, error)
	ToHost(upstream *model.Link, dst model.Endpoint, protocol model.Protocol, node *v1.Node) ([]model.Transmission, error)
	ToService(upstream *model.Link, dst model.Endpoint, protocol model.Protocol, service *v1.Service) ([]model.Transmission, error)
	ToExternal(upstream *model.Link, dst model.Endpoint, protocol model.Protocol) ([]model.Transmission, error)
	Serve(upstream *model.Link, dst model.Endpoint, protocol model.Protocol) ([]model.Transmission, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL