ksdn

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// rule versioning; increment each time flow rules change
	VERSION        = 1
	VERSION_TABLE  = "table=253"
	VERSION_ACTION = "actions=note:"

	BR    = "br0"
	TUN   = "tun0"
	VXLAN = "vxlan0"

	VXLAN_PORT = "4789"
)

Variables

This section is empty.

Functions

func DeletionHandlingMetaNamespaceKeyFunc

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

func RunEventQueue

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

Run event queue for the given resource. 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(kClient *kclient.Client, eClient etcdmanager.EtcdManager, network string, ctx context.Context) error

func StartNode

func StartNode(kClient *kclient.Client, eClient etcdmanager.EtcdManager, dClient dockertools.DockerInterface, network, hostname string, ctx context.Context)

Called by higher layers to create the plugin SDN node instance

Types

type EventQueue

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

func NewEventQueue(keyFunc cache.KeyFunc) *EventQueue

func NewEventQueueForStore

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

func (*EventQueue) Pop

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 FirewallRule

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

type KsdnMaster

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

func (*KsdnMaster) SubnetStartMaster

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

func (*KsdnMaster) VnidStartMaster

func (master *KsdnMaster) VnidStartMaster() error

type KsdnNode

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

func (*KsdnNode) AddHostSubnetRules

func (plugin *KsdnNode) AddHostSubnetRules(subnet *etcdmanager.HostSubnet) error

func (*KsdnNode) AddServiceRules

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

func (*KsdnNode) DeleteHostSubnetRules

func (plugin *KsdnNode) DeleteHostSubnetRules(subnet *etcdmanager.HostSubnet) error

func (*KsdnNode) DeleteServiceRules

func (plugin *KsdnNode) DeleteServiceRules(service *kapi.Service) error

func (*KsdnNode) GetLocalPods

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

func (*KsdnNode) IsPodNetworkReady

func (node *KsdnNode) IsPodNetworkReady() error

func (*KsdnNode) SetupSDN

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

func (*KsdnNode) SubnetStartNode

func (node *KsdnNode) SubnetStartNode() error

func (*KsdnNode) UpdatePod

func (node *KsdnNode) 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

func (*KsdnNode) VnidStartNode

func (node *KsdnNode) VnidStartNode() error

type NetworkInfo

type NetworkInfo struct {
	ClusterNetwork *net.IPNet
	ServiceNetwork *net.IPNet
	// contains filtered or unexported fields
}

type NodeIPTables

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

func (*NodeIPTables) Setup

func (n *NodeIPTables) Setup() error

type PodConfig

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

type ProcessEventFunc

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"
	Services   ResourceName = "Services"
	Pods       ResourceName = "Pods"
)

Jump to

Keyboard shortcuts

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