ovs

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OvnNbCtl    = "ovn-nbctl"
	MayExist    = "--may-exist"
	IfExists    = "--if-exists"
	Policy      = "--policy"
	PolicyDstIP = "dst-ip"
	PolicySrcIP = "src-ip"
)

Variables

View Source
var (
	ErrNoAddr   = errors.New("no address")
	ErrNotFound = errors.New("not found")
)

Functions

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

func ClearPodBandwidth(podName, podNamespace string) error

ClearPodBandwidth remove qos related to this pod. Only used when remove pod.

func ExpandExcludeIPs added in v0.6.0

func ExpandExcludeIPs(excludeIPs []string) []string

ExpandExcludeIPs parse ovn exclude_ips to ip slice

func PodNameToPortName

func PodNameToPortName(pod, namespace string) string

PodNameToPortName return the ovn port name for a given pod

func SetPodBandwidth

func SetPodBandwidth(podName, podNamespace, ingress, egress string) error

SetPodBandwidth set ingress/egress qos for given pod

func StartOvnNbctlDaemon added in v0.6.0

func StartOvnNbctlDaemon(nbHost string, nbPort int) (string, error)

StartOvnNbctlDaemon start a daemon and set OVN_NB_DAEMON env

Types

type Client

type Client struct {
	OvnNbAddress           string
	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, ovnSbHost string, ovnSbPort int, clusterRouter, clusterTcpLoadBalancer, clusterUdpLoadBalancer, nodeSwitch, nodeSwitchCIDR string) *Client

NewClient init an ovn client

func (Client) AddStaticRouter

func (c Client) AddStaticRouter(policy, cidr, nextHop, router string) error

AddStaticRouter add a static route rule in ovn

func (Client) CleanLogicalSwitchAcl

func (c Client) CleanLogicalSwitchAcl(ls string) error

CleanLogicalSwitchAcl clean acl of a switch

func (Client) CreateAddressSet added in v0.5.0

func (c Client) CreateAddressSet(asName string) error

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

func (c Client) CreateLoadBalancer(lb, protocol string) error

CreateLoadBalancer create loadbalancer in ovn

func (Client) CreateLoadBalancerRule

func (c Client) CreateLoadBalancerRule(lb, vip, ips string) error

CreateLoadBalancerRule create loadbalancer rul in ovn

func (Client) CreateLogicalRouter

func (c Client) CreateLogicalRouter(lr string) error

CreateLogicalRouter create logical router in ovn

func (Client) CreateLogicalSwitch

func (c Client) CreateLogicalSwitch(ls, protocol, subnet, gateway string, excludeIps []string) error

CreateLogicalSwitch create logical switch in ovn, connect it to router and apply tcp/udp lb rules

func (Client) CreatePort

func (c Client) CreatePort(ls, port, ip, cidr, mac string) (*nic, error)

CreatePort create logical switch port in ovn

func (Client) CreatePortGroup added in v0.5.0

func (c Client) CreatePortGroup(pgName, npNs, npName string) error

func (Client) DeleteACL added in v0.5.0

func (c Client) DeleteACL(pgName, direction string) error

func (Client) DeleteAddressSet added in v0.5.0

func (c Client) DeleteAddressSet(asName string) error

func (Client) DeleteLoadBalancerVip

func (c Client) DeleteLoadBalancerVip(vip, lb string) error

DeleteLoadBalancerVip delete a vip rule from loadbalancer

func (Client) DeleteLogicalSwitch

func (c Client) DeleteLogicalSwitch(ls string) error

DeleteLogicalSwitch delete logical switch and related router port

func (Client) DeletePort

func (c Client) DeletePort(port string) error

DeletePort delete logical switch port in ovn

func (Client) DeletePortGroup added in v0.5.0

func (c Client) DeletePortGroup(pgName string) error

func (Client) DeleteStaticRouter

func (c Client) DeleteStaticRouter(cidr, router string) error

DeleteStaticRouter delete a static route rule in ovn

func (Client) FindLoadbalancer

func (c Client) FindLoadbalancer(lb string) (string, error)

FindLoadbalancer find ovn loadbalancer uuid by name

func (Client) GetLoadBalancerVips

func (c Client) GetLoadBalancerVips(lb string) (map[string]string, error)

GetLoadBalancerVips return vips of a loadbalancer

func (Client) GetLogicalSwitchExcludeIPS added in v0.6.0

func (c Client) GetLogicalSwitchExcludeIPS(logicalSwitch string) ([]string, error)

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 (c Client) GetLogicalSwitchPortAddress(port string) ([]string, error)

func (Client) GetLogicalSwitchPortByLogicalSwitch added in v0.9.0

func (c Client) GetLogicalSwitchPortByLogicalSwitch(logicalSwitch string) ([]string, error)

func (Client) GetLogicalSwitchPortDynamicAddress

func (c Client) GetLogicalSwitchPortDynamicAddress(port string) ([]string, error)

func (Client) GetPortAddr

func (c Client) GetPortAddr(port string) ([]string, error)

GetPortAddr return port [mac, ip]

func (Client) ListLogicalRouter

func (c Client) ListLogicalRouter() ([]string, error)

ListLogicalRouter list logical router names

func (Client) ListLogicalSwitch

func (c Client) ListLogicalSwitch() ([]string, error)

ListLogicalSwitch list logical switch names

func (Client) ListLogicalSwitchPort added in v0.9.0

func (c Client) ListLogicalSwitchPort() ([]string, error)

func (Client) ListPortGroup added in v0.9.0

func (c Client) ListPortGroup() ([]portGroup, error)

func (Client) LogicalSwitchExists added in v0.7.0

func (c Client) LogicalSwitchExists(logicalSwitch string) (bool, error)

func (Client) ResetLogicalSwitchAcl added in v0.8.0

func (c Client) ResetLogicalSwitchAcl(ls, protocol string) error

ResetLogicalSwitchAcl reset acl of a switch

func (Client) SetAddressesToAddressSet added in v0.5.0

func (c Client) SetAddressesToAddressSet(addresses []string, as string) error

func (Client) SetLogicalSwitchExcludeIPS added in v0.6.0

func (c Client) SetLogicalSwitchExcludeIPS(logicalSwitch string, excludeIPS []string) error

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"

func (Client) SetPortsToPortGroup added in v0.5.0

func (c Client) SetPortsToPortGroup(portGroup string, portNames []string) error

func (Client) SetPrivateLogicalSwitch

func (c Client) SetPrivateLogicalSwitch(ls, protocol, cidr string, allow []string) error

SetPrivateLogicalSwitch will drop all ingress traffic except allow subnets

Jump to

Keyboard shortcuts

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