common

package
v3.11.0-0.34.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package common contains the OpenShift SDN code that is shared between master, node, and proxy

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterNetworkListContains

func ClusterNetworkListContains(clusterNetworks []ClusterNetwork, ipaddr net.IP) (*net.IPNet, bool)

func ClusterNetworkToString

func ClusterNetworkToString(n *networkapi.ClusterNetwork) string

func HostSubnetToString

func HostSubnetToString(subnet *networkapi.HostSubnet) string

func InformerFuncs

func InformerFuncs(objType runtime.Object, addOrUpdateFunc InformerAddOrUpdateFunc, deleteFunc InformerDeleteFunc) kcache.ResourceEventHandlerFuncs

Types

type ClusterNetwork

type ClusterNetwork struct {
	ClusterCIDR      *net.IPNet
	HostSubnetLength uint32
}

type DNS

type DNS struct {
	// contains filtered or unexported fields
}

func NewDNS

func NewDNS(resolverConfigFile string) (*DNS, error)

func (*DNS) Add

func (d *DNS) Add(dns string) error

func (*DNS) Get

func (d *DNS) Get(dns string) dnsValue

func (*DNS) GetMinQueryTime

func (d *DNS) GetMinQueryTime() (time.Time, bool)

func (*DNS) Size

func (d *DNS) Size() int

func (*DNS) Update

func (d *DNS) Update() (error, bool)

type EgressDNS

type EgressDNS struct {

	// Report changes when there are dns updates
	Updates chan EgressDNSUpdate
	// contains filtered or unexported fields
}

func NewEgressDNS

func NewEgressDNS() *EgressDNS

func (*EgressDNS) Add

func (e *EgressDNS) Add(policy networkapi.EgressNetworkPolicy)

func (*EgressDNS) Delete

func (e *EgressDNS) Delete(policy networkapi.EgressNetworkPolicy)

func (*EgressDNS) GetIPs

func (e *EgressDNS) GetIPs(policy networkapi.EgressNetworkPolicy, dnsName string) []net.IP

func (*EgressDNS) GetMinQueryTime

func (e *EgressDNS) GetMinQueryTime() (time.Time, ktypes.UID, string, bool)

func (*EgressDNS) GetNetCIDRs

func (e *EgressDNS) GetNetCIDRs(policy networkapi.EgressNetworkPolicy, dnsName string) []net.IPNet

func (*EgressDNS) Sync

func (e *EgressDNS) Sync()

func (*EgressDNS) Update

func (e *EgressDNS) Update(policyUID ktypes.UID) (error, bool)

type EgressDNSUpdate

type EgressDNSUpdate struct {
	UID       ktypes.UID
	Namespace string
}

type EgressIPTracker

type EgressIPTracker struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewEgressIPTracker

func NewEgressIPTracker(watcher EgressIPWatcher) *EgressIPTracker

func (*EgressIPTracker) DeleteNetNamespaceEgress

func (eit *EgressIPTracker) DeleteNetNamespaceEgress(vnid uint32)

func (*EgressIPTracker) Ping

func (eit *EgressIPTracker) Ping(ip string, timeout time.Duration) bool

Ping a node and return whether or not it is online. We do this by trying to open a TCP connection to the "discard" service (port 9); if the node is offline, the attempt will time out with no response (and we will return false). If the node is online then we presumably will get a "connection refused" error; the code below assumes that anything other than timing out indicates that the node is online.

func (*EgressIPTracker) ReallocateEgressIPs

func (eit *EgressIPTracker) ReallocateEgressIPs() map[string][]string

ReallocateEgressIPs returns a map from Node name to array-of-Egress-IP for all auto-allocated egress IPs

func (*EgressIPTracker) SetNodeOffline

func (eit *EgressIPTracker) SetNodeOffline(nodeIP string, offline bool)

func (*EgressIPTracker) Start

func (eit *EgressIPTracker) Start(hostSubnetInformer networkinformers.HostSubnetInformer, netNamespaceInformer networkinformers.NetNamespaceInformer)

func (*EgressIPTracker) UpdateHostSubnetEgress

func (eit *EgressIPTracker) UpdateHostSubnetEgress(hs *networkapi.HostSubnet)

func (*EgressIPTracker) UpdateNetNamespaceEgress

func (eit *EgressIPTracker) UpdateNetNamespaceEgress(netns *networkapi.NetNamespace)

type EgressIPWatcher

type EgressIPWatcher interface {
	ClaimEgressIP(vnid uint32, egressIP, nodeIP string)
	ReleaseEgressIP(egressIP, nodeIP string)

	SetNamespaceEgressNormal(vnid uint32)
	SetNamespaceEgressDropped(vnid uint32)
	SetNamespaceEgressViaEgressIP(vnid uint32, egressIP, nodeIP string)

	UpdateEgressCIDRs()
}

type InformerAddOrUpdateFunc

type InformerAddOrUpdateFunc func(interface{}, interface{}, watch.EventType)

type InformerDeleteFunc

type InformerDeleteFunc func(interface{})

type NetworkInfo

type NetworkInfo struct {
	ClusterNetworks []ClusterNetwork
	ServiceNetwork  *net.IPNet
	VXLANPort       uint32
}

func GetNetworkInfo

func GetNetworkInfo(networkClient networkclient.Interface) (*NetworkInfo, error)

func ParseNetworkInfo

func ParseNetworkInfo(clusterNetwork []networkapi.ClusterNetworkEntry, serviceNetwork string, vxlanPort *uint32) (*NetworkInfo, error)

func (*NetworkInfo) CheckClusterObjects

func (ni *NetworkInfo) CheckClusterObjects(subnets []networkapi.HostSubnet, pods []kapi.Pod, services []kapi.Service) error

func (*NetworkInfo) CheckHostNetworks

func (ni *NetworkInfo) CheckHostNetworks(hostIPNets []*net.IPNet) error

func (*NetworkInfo) ValidateNodeIP

func (ni *NetworkInfo) ValidateNodeIP(nodeIP string) error

Jump to

Keyboard shortcuts

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