Documentation ¶
Index ¶
- func AddFlatNetworkRouteToHost(podNS ns.NetNS, flatNetworkIP net.IP, master string) error
- func AddPodFlatNetworkCustomRoutes(podNS ns.NetNS, customRoutes []flv1.Route) error
- func AddPodKubeCIDRRoutes(podNS ns.NetNS, cidr string) error
- func AddPodNodeCIDRRoutes(podNS ns.NetNS) error
- func CheckRouteExists(route *netlink.Route) (bool, error)
- func DelFlatNetworkRouteFromHost(flatNetworkIP net.IP) error
- func EnsureRouteExists(route *netlink.Route) error
- func GetDefaultLinkIDSet() (map[int]bool, error)
- func GetDefaultRoutes() ([]netlink.Route, error)
- func GetRouteByIP(ip net.IP) (*netlink.Route, error)
- func UpdatePodDefaultGateway(podNS ns.NetNS, ifName string, flatNetworkIP net.IP, gateway net.IP) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFlatNetworkRouteToHost ¶
AddFlatNetworkRouteToHost adds flatNetworkIP route to native CNI iface on host NS
Example: ip route add <FLAT_NETWORK_IP> dev <NATIVE_CNI_IFACE> src <HOST_IP>
func AddPodFlatNetworkCustomRoutes ¶
AddPodFlatNetworkCustomRoutes adds user defined custom routes and host IP routes to pod NS
func AddPodNodeCIDRRoutes ¶
func CheckRouteExists ¶
CheckRouteExists checks whether the route exists by route dst
func DelFlatNetworkRouteFromHost ¶
DelFlatNetworkRouteFromHost remove flatNetworkIP route from native CNI iface on host NS
Example: ip route del <FLAT_NETWORK_IP>
func EnsureRouteExists ¶
EnsureRouteExists adds route if not exists
func GetDefaultLinkIDSet ¶
func GetDefaultRoutes ¶
GetDefaultRoute gets default route NOTE: will return nil if no route found
func GetRouteByIP ¶
GetRouteByIP executes 'ip route get <IP>' on host network NS. NOTE: will return nil if no route found
Types ¶
This section is empty.