controller

package
v1.11.16 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 67 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INIT_ROUTE_TABLE = "init"
	POD_EIP_ADD      = "eip-add"
	POD_DNAT_ADD     = "dnat-add"
	ATTACHMENT_NAME  = "lb-svc-attachment"
	ATTACHMENT_NS    = "kube-system"
)
View Source
const (
	CorednsContainerName = "coredns"
	CorednsLabelKey      = "k8s-app"
	CorednsTemplateDep   = "coredns-template.yaml"
	InitRouteImage       = "kubeovn/vpc-nat-gateway:v1.11.10"
)

Variables

View Source
var (
	VpcNatCmVersion   = ""
	NAT_GW_CREATED_AT = ""
)
View Source
var (
	// external underlay vlan macvlan network attachment definition provider
	MACVLAN_NAD_PROVIDER = fmt.Sprintf("%s.%s", util.VpcExternalNet, ATTACHMENT_NS)
)

Functions

func InitClientGoMetrics added in v1.7.0

func InitClientGoMetrics()

func InitWorkQueueMetrics added in v1.7.0

func InitWorkQueueMetrics()

func NewSlrInfo added in v1.11.0

func NewSlrInfo(slr *kubeovnv1.SwitchLBRule) *slrInfo

func PodNameToEipName added in v1.11.0

func PodNameToEipName(name, namespace string) string

Types

type Configuration

type Configuration struct {
	BindAddress          string
	OvnNbAddr            string
	OvnSbAddr            string
	OvnTimeout           int
	CustCrdRetryMaxDelay int
	CustCrdRetryMinDelay int
	KubeConfigFile       string
	KubeRestConfig       *rest.Config

	KubeClient      kubernetes.Interface
	KubeOvnClient   clientset.Interface
	AttachNetClient attachnetclientset.Interface
	KubevirtClient  kubecli.KubevirtClient

	// with no timeout
	KubeFactoryClient    kubernetes.Interface
	KubeOvnFactoryClient clientset.Interface

	DefaultLogicalSwitch      string
	DefaultCIDR               string
	DefaultGateway            string
	DefaultExcludeIps         string
	DefaultGatewayCheck       bool
	DefaultLogicalGateway     bool
	DefaultU2OInterconnection bool

	ClusterRouter     string
	NodeSwitch        string
	NodeSwitchCIDR    string
	NodeSwitchGateway string

	ServiceClusterIPRange string

	ClusterTcpLoadBalancer         string
	ClusterUdpLoadBalancer         string
	ClusterSctpLoadBalancer        string
	ClusterTcpSessionLoadBalancer  string
	ClusterUdpSessionLoadBalancer  string
	ClusterSctpSessionLoadBalancer string

	PodName      string
	PodNamespace string
	PodNicType   string

	PodDefaultFipType string

	WorkerNum       int
	PprofPort       int
	EnablePprof     bool
	NodePgProbeTime int

	NetworkType             string
	DefaultProviderName     string
	DefaultHostInterface    string
	DefaultExchangeLinkName bool
	DefaultVlanName         string
	DefaultVlanID           int
	LsDnatModDlDst          bool
	LsCtSkipDstLportIPs     bool

	EnableLb          bool
	EnableNP          bool
	EnableEipSnat     bool
	EnableExternalVpc bool
	EnableEcmp        bool
	EnableKeepVmIP    bool
	EnableLbSvc       bool
	EnableMetrics     bool

	ExternalGatewaySwitch   string
	ExternalGatewayConfigNS string
	ExternalGatewayNet      string
	ExternalGatewayVlanID   int

	GCInterval      int
	InspectInterval int
}

Configuration is the controller conf

func ParseFlags

func ParseFlags() (*Configuration, error)

ParseFlags parses cmd args then init kubeclient and conf TODO: validate configuration

type Controller

type Controller struct {
	UpdateSwitchLBRuleQueue workqueue.RateLimitingInterface
	// contains filtered or unexported fields
}

Controller is kube-ovn main controller that watch ns/pod/node/svc/ep and operate ovn

func NewController

func NewController(config *Configuration) *Controller

NewController returns a new ovn controller

func (*Controller) CheckGatewayReady added in v1.7.0

func (c *Controller) CheckGatewayReady()

func (*Controller) CheckNodePortGroup added in v1.8.0

func (c *Controller) CheckNodePortGroup()

func (*Controller) GenVpcLoadBalancer added in v1.8.0

func (c *Controller) GenVpcLoadBalancer(vpcKey string) *VpcLoadBalancer

func (*Controller) GetEip added in v1.10.0

func (c *Controller) GetEip(eipName string) (*kubeovnv1.IptablesEIP, error)

func (*Controller) GetGwBySubnet added in v1.11.0

func (c *Controller) GetGwBySubnet(name string) (string, string, error)

func (*Controller) GetOvnEip added in v1.11.0

func (c *Controller) GetOvnEip(eipName string) (*kubeovnv1.OvnEip, error)

func (*Controller) InitDefaultVpc added in v1.7.0

func (c *Controller) InitDefaultVpc() error

func (*Controller) InitIPAM added in v1.7.0

func (c *Controller) InitIPAM() error

func (*Controller) InitOVN added in v1.7.0

func (c *Controller) InitOVN() error

func (*Controller) Run

func (c *Controller) Run(ctx context.Context)

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type NamedPort added in v1.11.2

type NamedPort struct {
	// contains filtered or unexported fields
}

func NewNamedPort added in v1.11.2

func NewNamedPort() *NamedPort

func (*NamedPort) AddNamedPortByPod added in v1.11.2

func (n *NamedPort) AddNamedPortByPod(pod *v1.Pod)

func (*NamedPort) DeleteNamedPortByPod added in v1.11.2

func (n *NamedPort) DeleteNamedPortByPod(pod *v1.Pod)

func (*NamedPort) GetNamedPortByNs added in v1.11.2

func (n *NamedPort) GetNamedPortByNs(namespace string) map[string]*util.NamedPortInfo

type VpcLoadBalancer added in v1.8.0

type VpcLoadBalancer struct {
	TcpLoadBalancer      string
	TcpSessLoadBalancer  string
	UdpLoadBalancer      string
	UdpSessLoadBalancer  string
	SctpLoadBalancer     string
	SctpSessLoadBalancer string
}

Jump to

Keyboard shortcuts

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