plugin

package
v3.7.0-0.120.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: Apache-2.0 Imports: 69 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Br0    = "br0"
	Tun0   = "tun0"
	Vxlan0 = "vxlan0"
)

Variables

This section is empty.

Functions

func CheckDNSResolver

func CheckDNSResolver() error

func DeletionHandlingMetaNamespaceKeyFunc added in v1.4.0

func DeletionHandlingMetaNamespaceKeyFunc(obj interface{}) (string, error)

func GetNodeCondition

func GetNodeCondition(status *kapi.NodeStatus, conditionType kapi.NodeConditionType) (int, *kapi.NodeCondition)

TODO remove this and switch to external GetNodeCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func NewMultiTenantPlugin added in v1.5.0

func NewMultiTenantPlugin() osdnPolicy

func NewNetworkPolicyPlugin added in v1.5.0

func NewNetworkPolicyPlugin() osdnPolicy

func NewNodePlugin

func NewNodePlugin(c *OsdnNodeConfig) (sdn.NodeInterface, error)

Called by higher layers to create the plugin SDN node instance

func NewOVSController

func NewOVSController(ovsif ovs.Interface, pluginId int, useConnTrack bool) *ovsController

func NewProxyPlugin

func NewProxyPlugin(pluginName string, osClient *osclient.Client, kClient kclientset.Interface) (sdn.ProxyInterface, error)

Called by higher layers to create the proxy plugin instance; only used by nodes

func NewSingleTenantPlugin added in v1.5.0

func NewSingleTenantPlugin() osdnPolicy

func RegisterSharedInformerEventHandlers

func RegisterSharedInformerEventHandlers(kubeInformers kinternalinformers.SharedInformerFactory,
	addOrUpdateFunc func(interface{}, interface{}, watch.EventType),
	delFunc func(interface{}), resourceName ResourceName)

RegisterSharedInformerEventHandlers registers addOrUpdateFunc and delFunc event handlers with kubernetes shared informers for the given resource name.

func RunEventQueue added in v1.4.0

func RunEventQueue(client kcache.Getter, resourceName ResourceName, process ProcessEventFunc)

Run event queue for the given resource. The 'process' function is called repeatedly with each available cache.Delta that describes state changes to an object. If the process function returns an error queued changes for that object are dropped but processing continues with the next available object's cache.Deltas. The error is logged with call stack information.

NOTE: this function will handle DeletedFinalStateUnknown delta objects automatically, which may not always be what you want since the now-deleted object may be stale.

func StartMaster

func StartMaster(networkConfig osconfigapi.MasterNetworkConfig, osClient *osclient.Client, kClient kclientset.Interface, informers kinternalinformers.SharedInformerFactory) error

Types

type Chain

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

type DNS

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

func NewDNS

func NewDNS(execer kexec.Interface) *DNS

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 {
	// contains filtered or unexported fields
}

func NewEgressDNS

func NewEgressDNS() *EgressDNS

func (*EgressDNS) Add

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

func (*EgressDNS) Delete

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

func (*EgressDNS) GetIPs

func (e *EgressDNS) GetIPs(policy osapi.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 osapi.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 EndpointsConfigHandler

type EndpointsConfigHandler interface {
	// OnEndpointsUpdate gets called when endpoints configuration is changed for a given
	// service on any of the configuration sources. An example is when a new
	// service comes up, or when containers come up or down for an existing service.
	OnEndpointsUpdate(endpoints []*kapi.Endpoints)
}

EndpointsConfigHandler is an abstract interface of objects which receive update notifications for the set of endpoints.

type EventQueue added in v1.4.0

type EventQueue struct {
	*cache.DeltaFIFO
	// contains filtered or unexported fields
}

EventQueue is an enhanced DeltaFIFO that provides reliable Deleted deltas even if no knownObjects store is given, and compresses multiple deltas to reduce duplicate events.

Without a store, DeltaFIFO will drop Deleted deltas when its queue is empty because the deleted object is not present in the queue and DeltaFIFO tries to protect against duplicate Deleted deltas resulting from Replace().

To get reliable deletion, a store must be provided, and EventQueue provides one if the caller does not.

func NewEventQueue added in v1.4.0

func NewEventQueue(keyFunc cache.KeyFunc) *EventQueue

func NewEventQueueForStore added in v1.4.0

func NewEventQueueForStore(keyFunc cache.KeyFunc, knownObjects cache.KeyListerGetter) *EventQueue

func (*EventQueue) Pop added in v1.4.0

func (queue *EventQueue) Pop(process ProcessEventFunc, expectedType interface{}) (interface{}, error)

Process queued changes for an object. The 'process' function is called repeatedly with each available cache.Delta that describes state changes for that object. If the process function returns an error queued changes for that object are dropped but processing continues with the next available object's cache.Deltas. The error is logged with call stack information.

type NetworkInfo

type NetworkInfo struct {
	ClusterNetwork *net.IPNet
	ServiceNetwork *net.IPNet
}

type NodeIPTables

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

func (*NodeIPTables) Setup

func (n *NodeIPTables) Setup() error

type OsdnMaster

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

func (*OsdnMaster) SubnetStartMaster

func (master *OsdnMaster) SubnetStartMaster(clusterNetwork *net.IPNet, hostSubnetLength uint32) error

func (*OsdnMaster) VnidStartMaster

func (master *OsdnMaster) VnidStartMaster() error

type OsdnNode

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

func (*OsdnNode) AddHostSubnetRules

func (plugin *OsdnNode) AddHostSubnetRules(subnet *osapi.HostSubnet)

func (*OsdnNode) AddServiceRules

func (plugin *OsdnNode) AddServiceRules(service *kapi.Service, netID uint32)

func (*OsdnNode) DeleteHostSubnetRules

func (plugin *OsdnNode) DeleteHostSubnetRules(subnet *osapi.HostSubnet)

func (*OsdnNode) DeleteServiceRules

func (plugin *OsdnNode) DeleteServiceRules(service *kapi.Service)

func (*OsdnNode) GetLocalPods

func (node *OsdnNode) GetLocalPods(namespace string) ([]kapi.Pod, error)

func (*OsdnNode) SetupEgressNetworkPolicy

func (plugin *OsdnNode) SetupEgressNetworkPolicy() error

func (*OsdnNode) SetupSDN

func (plugin *OsdnNode) SetupSDN() (bool, error)

func (*OsdnNode) Start

func (node *OsdnNode) Start() error

func (*OsdnNode) SubnetStartNode

func (node *OsdnNode) SubnetStartNode() error

func (*OsdnNode) UpdateEgressNetworkPolicyVNID

func (plugin *OsdnNode) UpdateEgressNetworkPolicyVNID(namespace string, oldVnid, newVnid uint32)

func (*OsdnNode) UpdatePod

func (node *OsdnNode) UpdatePod(pod kapi.Pod) error

FIXME: this should eventually go into kubelet via a CNI UPDATE/CHANGE action See https://github.com/containernetworking/cni/issues/89

type OsdnNodeConfig

type OsdnNodeConfig struct {
	PluginName      string
	Hostname        string
	SelfIP          string
	RuntimeEndpoint string
	MTU             uint32

	OSClient *osclient.Client
	KClient  kclientset.Interface

	KubeInformers kinternalinformers.SharedInformerFactory

	IPTablesSyncPeriod time.Duration
	ProxyMode          componentconfig.ProxyMode
}

type OsdnProxy added in v1.4.0

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

func (*OsdnProxy) OnEndpointsAdd

func (proxy *OsdnProxy) OnEndpointsAdd(ep *kapi.Endpoints)

func (*OsdnProxy) OnEndpointsDelete

func (proxy *OsdnProxy) OnEndpointsDelete(ep *kapi.Endpoints)

func (*OsdnProxy) OnEndpointsSynced

func (proxy *OsdnProxy) OnEndpointsSynced()

func (*OsdnProxy) OnEndpointsUpdate added in v1.4.0

func (proxy *OsdnProxy) OnEndpointsUpdate(old, ep *kapi.Endpoints)

func (*OsdnProxy) Start added in v1.4.0

func (proxy *OsdnProxy) Start(baseHandler pconfig.EndpointsHandler) error

type ProcessEventFunc added in v1.4.0

type ProcessEventFunc func(delta cache.Delta) error

Function should process one object delta, which represents a change notification for a single object. Function is passed the delta, which contains the changed object or the deleted final object state. The deleted final object state is extracted from the DeletedFinalStateUnknown passed by DeltaFIFO.

type ResourceName

type ResourceName string
const (
	Nodes                 ResourceName = "Nodes"
	Namespaces            ResourceName = "Namespaces"
	NetNamespaces         ResourceName = "NetNamespaces"
	Services              ResourceName = "Services"
	HostSubnets           ResourceName = "HostSubnets"
	Pods                  ResourceName = "Pods"
	EgressNetworkPolicies ResourceName = "EgressNetworkPolicies"
	NetworkPolicies       ResourceName = "NetworkPolicies"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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