proxy

package
v0.0.0-...-e1628ab Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRouteForTableLocalGw

func AddRouteForTableLocalGw(agentInfo *datapath.DpManagerInfo) error

func ChangeLocalRulePriority

func ChangeLocalRulePriority() error

func GetNodeInternalIP

func GetNodeInternalIP(node corev1.Node) net.IP

func GetRouteByDst

func GetRouteByDst(dst *net.IPNet) []netlink.Route

func GetRoutesByGW

func GetRoutesByGW(gw net.IP, tables ...int) ([]netlink.Route, error)

func IsRouteExist

func IsRouteExist(filter *netlink.Route) (bool, error)

filter must set dst,gw,table

func RouteEqual

func RouteEqual(r1, r2 netlink.Route) bool

func SetFixRouteWhenDisableERProxy

func SetFixRouteWhenDisableERProxy(agentInfo *datapath.DpManagerInfo)

Types

type NodeReconciler

type NodeReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	DatapathManager *datapath.DpManager

	StopCtx context.Context
	// contains filtered or unexported fields
}

NodeReconciler watch node and update route table

func (*NodeReconciler) Reconcile

func (r *NodeReconciler) Reconcile(_ context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile receive node from work queue, synchronize network config

func (*NodeReconciler) SetFixRoute

func (r *NodeReconciler) SetFixRoute()

func (*NodeReconciler) SetupWithManager

func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager create and add Endpoint Controller to the manager.

func (*NodeReconciler) UpdateNetwork

func (r *NodeReconciler) UpdateNetwork()

func (*NodeReconciler) UpdateRoute

func (r *NodeReconciler) UpdateRoute(nodeList corev1.NodeList, thisNode corev1.Node)

UpdateRoute will be called when Node has been updated, or every 100 seconds. This function will update route table in linux kernel. Old related route items which are useless will be deleted, and new route item will be added. In each node, there will be (n-1) * mi route items, n means the num of nodes, mi means m pod cidrs in node i. for example, if there are two nodes in cluster and node2 has two pod cidrs, Here are route item in node1: ip route add node2-podCIDR-1 via node2 ip route add node2-podCIDR-2 via node2

type OverlayRoute

type OverlayRoute interface {
	Update()
	AddRouteByDst(dstCIDR string) error
	DelRouteByDst(dstCIDR string) error
	InsertPodCIDRs(cidrs ...string)
	DelPodCIDRs(cidrs ...string)
}

func NewOverlayRoute

func NewOverlayRoute(gatewayIP net.IP, clusterPodCIDR string, dpManager *datapath.DpManager) OverlayRoute

func SetupRouteAndIPtables

func SetupRouteAndIPtables(ctx context.Context, datapathManager *datapath.DpManager) (eriptables.OverlayIPtables, OverlayRoute)

SetupRouteAndIPtables setup route and iptables for overlay mode

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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