Documentation ¶
Index ¶
- func AddRouteForTableLocalGw(agentInfo *datapath.DpManagerInfo) error
- func ChangeLocalRulePriority() error
- func GetNodeInternalIP(node corev1.Node) net.IP
- func GetRouteByDst(dst *net.IPNet) []netlink.Route
- func GetRoutesByGW(gw net.IP, tables ...int) ([]netlink.Route, error)
- func IsRouteExist(filter *netlink.Route) (bool, error)
- func RouteEqual(r1, r2 netlink.Route) bool
- func SetFixRouteWhenDisableERProxy(agentInfo *datapath.DpManagerInfo)
- type NodeReconciler
- func (r *NodeReconciler) Reconcile(_ context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *NodeReconciler) SetFixRoute()
- func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *NodeReconciler) UpdateNetwork()
- func (r *NodeReconciler) UpdateRoute(nodeList corev1.NodeList, thisNode corev1.Node)
- type OverlayRoute
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 IsRouteExist ¶
filter must set dst,gw,table
func RouteEqual ¶
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 ¶
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 SetupRouteAndIPtables ¶
func SetupRouteAndIPtables(ctx context.Context, datapathManager *datapath.DpManager) (eriptables.OverlayIPtables, OverlayRoute)
SetupRouteAndIPtables setup route and iptables for overlay mode