Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAlive() error
- func CleanDuplicatePort(ifaceID string)
- func CleanLostInterface()
- func ClearPodBandwidth(podName, podNamespace string) error
- func ExpandExcludeIPs(excludeIPs []string, cidr string) []string
- func PodNameToLocalnetName(subnet string) string
- func PodNameToPortName(pod, namespace string) string
- func SetPodBandwidth(podName, podNamespace, ingress, egress string) error
- func SetPortTag(port, tag string) error
- func StartOvnNbctlDaemon(nbHost string, nbPort int) (string, error)
- type Client
- func (c Client) AddStaticRoute(policy, cidr, nextHop, router string) error
- func (c Client) CleanLogicalSwitchAcl(ls string) error
- func (c Client) CreateAddressSet(asName string) error
- func (c Client) CreateEgressACL(pgName, asEgressName, asExceptName, protocol string, ...) error
- func (c Client) CreateIngressACL(pgName, asIngressName, asExceptName, protocol string, ...) error
- func (c Client) CreateLoadBalancer(lb, protocol string) error
- func (c Client) CreateLoadBalancerRule(lb, vip, ips, protocol string) error
- func (c Client) CreateLocalnetPort(ls, port, providerName, vlanID string) error
- func (c Client) CreateLogicalRouter(lr string) error
- func (c Client) CreateLogicalSwitch(ls, protocol, subnet, gateway string, excludeIps []string, ...) error
- func (c Client) CreatePort(ls, port, ip, cidr, mac, tag string) error
- func (c Client) CreatePortGroup(pgName, npNs, npName string) error
- func (c Client) DeleteACL(pgName, direction string) error
- func (c Client) DeleteAddressSet(asName string) error
- func (c Client) DeleteChassis(node string) error
- func (c Client) DeleteLoadBalancerVip(vip, lb string) error
- func (c Client) DeleteLogicalSwitch(ls string) error
- func (c Client) DeletePort(port string) error
- func (c Client) DeletePortGroup(pgName string) error
- func (c Client) DeleteStaticRoute(cidr, router string) error
- func (c Client) DeleteStaticRouteByNextHop(nextHop string) error
- func (c Client) FindLoadbalancer(lb string) (string, error)
- func (c Client) GetLoadBalancerVips(lb string) (map[string]string, error)
- func (c Client) GetLogicalSwitchExcludeIPS(logicalSwitch string) ([]string, error)
- func (c Client) GetLogicalSwitchPortAddress(port string) ([]string, error)
- func (c Client) GetLogicalSwitchPortByLogicalSwitch(logicalSwitch string) ([]string, error)
- func (c Client) GetLogicalSwitchPortDynamicAddress(port string) ([]string, error)
- func (c Client) GetPortAddr(port string) ([]string, error)
- func (c Client) ListLogicalRouter() ([]string, error)
- func (c Client) ListLogicalSwitch() ([]string, error)
- func (c Client) ListLogicalSwitchPort() ([]string, error)
- func (c Client) ListPortGroup() ([]portGroup, error)
- func (c Client) ListStaticRoute() ([]StaticRoute, error)
- func (c Client) LogicalSwitchExists(logicalSwitch string) (bool, error)
- func (c Client) ResetLogicalSwitchAcl(ls, protocol string) error
- func (c Client) SetAddressesToAddressSet(addresses []string, as string) error
- func (c Client) SetLogicalSwitchConfig(ls, protocol, subnet, gateway string, excludeIps []string) error
- func (c Client) SetLogicalSwitchExcludeIPS(logicalSwitch string, excludeIPS []string) error
- func (c Client) SetPortsToPortGroup(portGroup string, portNames []string) error
- func (c Client) SetPrivateLogicalSwitch(ls, protocol, cidr string, allow []string) error
- type StaticRoute
Constants ¶
const ( OvnNbCtl = "ovn-nbctl" OvnSbCtl = "ovn-sbctl" MayExist = "--may-exist" IfExists = "--if-exists" Policy = "--policy" PolicyDstIP = "dst-ip" PolicySrcIP = "src-ip" )
Variables ¶
var ( ErrNoAddr = errors.New("no address") ErrNotFound = errors.New("not found") )
Functions ¶
func CheckAlive ¶ added in v0.10.2
func CheckAlive() error
CheckAlive check if kube-ovn-controller can access ovn-nb from nbctl-daemon
func CleanDuplicatePort ¶ added in v0.9.0
func CleanDuplicatePort(ifaceID string)
Find and remove any existing OVS port with this iface-id. Pods can have multiple sandboxes if some are waiting for garbage collection, but only the latest one should have the iface-id set. See: https://github.com/ovn-org/ovn-kubernetes/pull/869
func CleanLostInterface ¶
func CleanLostInterface()
CleanLostInterface will clean up related ovs port, interface and qos When reboot node, the ovs internal interface will be deleted.
func ClearPodBandwidth ¶
ClearPodBandwidth remove qos related to this pod. Only used when remove pod.
func ExpandExcludeIPs ¶ added in v0.6.0
ExpandExcludeIPs parse ovn exclude_ips to ip slice
func PodNameToLocalnetName ¶ added in v1.2.0
func PodNameToPortName ¶
PodNameToPortName return the ovn port name for a given pod
func SetPodBandwidth ¶
SetPodBandwidth set ingress/egress qos for given pod
func SetPortTag ¶ added in v1.2.0
Types ¶
type Client ¶
type Client struct { OvnNbAddress string OvnTimeout int OvnSbAddress string ClusterRouter string ClusterTcpLoadBalancer string ClusterUdpLoadBalancer string NodeSwitch string NodeSwitchCIDR string }
Client is the ovn client
func NewClient ¶
func NewClient(ovnNbHost string, ovnNbPort int, ovnNbTimeout int, ovnSbHost string, ovnSbPort int, clusterRouter, clusterTcpLoadBalancer, clusterUdpLoadBalancer, nodeSwitch, nodeSwitchCIDR string) *Client
NewClient init an ovn client
func (Client) AddStaticRoute ¶ added in v0.9.1
AddStaticRoute add a static route rule in ovn
func (Client) CleanLogicalSwitchAcl ¶
CleanLogicalSwitchAcl clean acl of a switch
func (Client) CreateAddressSet ¶ added in v0.5.0
func (Client) CreateEgressACL ¶ added in v0.5.0
func (c Client) CreateEgressACL(pgName, asEgressName, asExceptName, protocol string, npp []netv1.NetworkPolicyPort) error
func (Client) CreateIngressACL ¶ added in v0.5.0
func (c Client) CreateIngressACL(pgName, asIngressName, asExceptName, protocol string, npp []netv1.NetworkPolicyPort) error
func (Client) CreateLoadBalancer ¶
CreateLoadBalancer create loadbalancer in ovn
func (Client) CreateLoadBalancerRule ¶
CreateLoadBalancerRule create loadbalancer rul in ovn
func (Client) CreateLocalnetPort ¶ added in v1.2.0
func (Client) CreateLogicalRouter ¶
CreateLogicalRouter create logical router in ovn
func (Client) CreateLogicalSwitch ¶
func (c Client) CreateLogicalSwitch(ls, protocol, subnet, gateway string, excludeIps []string, underlayGateway bool) error
CreateLogicalSwitch create logical switch in ovn, connect it to router and apply tcp/udp lb rules
func (Client) CreatePort ¶
CreatePort create logical switch port in ovn
func (Client) CreatePortGroup ¶ added in v0.5.0
func (Client) DeleteAddressSet ¶ added in v0.5.0
func (Client) DeleteChassis ¶ added in v1.1.0
func (Client) DeleteLoadBalancerVip ¶
DeleteLoadBalancerVip delete a vip rule from loadbalancer
func (Client) DeleteLogicalSwitch ¶
DeleteLogicalSwitch delete logical switch and related router port
func (Client) DeletePort ¶
DeletePort delete logical switch port in ovn
func (Client) DeletePortGroup ¶ added in v0.5.0
func (Client) DeleteStaticRoute ¶ added in v0.9.1
DeleteStaticRoute delete a static route rule in ovn
func (Client) DeleteStaticRouteByNextHop ¶ added in v0.9.1
func (Client) FindLoadbalancer ¶
FindLoadbalancer find ovn loadbalancer uuid by name
func (Client) GetLoadBalancerVips ¶
GetLoadBalancerVips return vips of a loadbalancer
func (Client) GetLogicalSwitchExcludeIPS ¶ added in v0.6.0
GetLogicalSwitchExcludeIPS get a logical switch exclude ips ovn-nbctl get logical_switch ovn-default other_config:exclude_ips => "10.17.0.1 10.17.0.2 10.17.0.3..10.17.0.5"
func (Client) GetLogicalSwitchPortAddress ¶
func (Client) GetLogicalSwitchPortByLogicalSwitch ¶ added in v0.9.0
func (Client) GetLogicalSwitchPortDynamicAddress ¶
func (Client) GetPortAddr ¶
GetPortAddr return port [mac, ip]
func (Client) ListLogicalRouter ¶
ListLogicalRouter list logical router names
func (Client) ListLogicalSwitch ¶
ListLogicalSwitch list logical switch names
func (Client) ListLogicalSwitchPort ¶ added in v0.9.0
func (Client) ListPortGroup ¶ added in v0.9.0
func (Client) ListStaticRoute ¶ added in v1.1.0
func (c Client) ListStaticRoute() ([]StaticRoute, error)
func (Client) LogicalSwitchExists ¶ added in v0.7.0
func (Client) ResetLogicalSwitchAcl ¶ added in v0.8.0
ResetLogicalSwitchAcl reset acl of a switch
func (Client) SetAddressesToAddressSet ¶ added in v0.5.0
func (Client) SetLogicalSwitchConfig ¶ added in v1.2.0
func (Client) SetLogicalSwitchExcludeIPS ¶ added in v0.6.0
SetLogicalSwitchExcludeIPS set a logical switch exclude ips ovn-nbctl set logical_switch ovn-default other_config:exclude_ips="10.17.0.2 10.17.0.1"