controller

package
v1.12.24 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CorednsContainerName = "coredns"
	CorednsLabelKey      = "k8s-app"
	CorednsTemplateDep   = "coredns-template.yaml"
)
View Source
const (
	QoSAdd = "qos-add"
	QoSDel = "qos-del"
)

Variables

View Source
var (
	VpcNatCmVersion = ""
)

Functions

func Run added in v1.12.0

func Run(ctx context.Context, config *Configuration)

Run creates and runs a new ovn controller

Types

type Configuration

type Configuration struct {
	OvnNbAddr              string
	OvnSbAddr              string
	OvnTimeout             int
	OvsDbConnectTimeout    int
	OvsDbInactivityTimeout 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

	WorkerNum       int
	PprofPort       int32
	EnablePprof     bool
	SecureServing   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

	BfdMinTx      int
	BfdMinRx      int
	BfdDetectMult int

	NodeLocalDNSIP string
}

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 {
	OVNNbClient ovs.NbClient
	OVNSbClient ovs.SbClient

	// ExternalGatewayType define external gateway type, centralized
	ExternalGatewayType string

	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 (*Controller) AddDnatRule added in v1.12.0

func (c *Controller) AddDnatRule(vpcName, dnatName, externalIP, internalIP, externalPort, internalPort, protocol string) error

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) DelDnatRule added in v1.12.0

func (c *Controller) DelDnatRule(vpcName, dnatName, externalIP, externalPort string) error

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.

func (*Controller) UpdateChassisTag added in v1.12.1

func (c *Controller) UpdateChassisTag(node *v1.Node) error

type ErrChassisNotFound added in v1.12.19

type ErrChassisNotFound struct {
	Chassis string
	Node    string
}

func (*ErrChassisNotFound) Error added in v1.12.19

func (e *ErrChassisNotFound) Error() string

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 SlrInfo added in v1.12.1

type SlrInfo struct {
	Name       string
	Namespace  string
	IsRecreate bool
	Vips       []string
}

func NewSlrInfo added in v1.11.0

func NewSlrInfo(slr *kubeovnv1.SwitchLBRule) *SlrInfo

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