Documentation ¶
Index ¶
- Constants
- func DeletionHandlingMetaNamespaceKeyFunc(obj interface{}) (string, error)
- func RunEventQueue(client kcache.Getter, resourceName ResourceName, process ProcessEventFunc)
- func StartMaster(kClient *kclient.Client, eClient etcdmanager.EtcdManager, network string, ...) error
- func StartNode(kClient *kclient.Client, eClient etcdmanager.EtcdManager, ...)
- type EventQueue
- type FirewallRule
- type KsdnMaster
- type KsdnNode
- func (plugin *KsdnNode) AddHostSubnetRules(subnet *etcdmanager.HostSubnet) error
- func (plugin *KsdnNode) AddServiceRules(service *kapi.Service, netID uint32) error
- func (plugin *KsdnNode) DeleteHostSubnetRules(subnet *etcdmanager.HostSubnet) error
- func (plugin *KsdnNode) DeleteServiceRules(service *kapi.Service) error
- func (node *KsdnNode) GetLocalPods(namespace string) ([]kapi.Pod, []kapi.Pod, error)
- func (node *KsdnNode) IsPodNetworkReady() error
- func (plugin *KsdnNode) SetupSDN() (bool, error)
- func (node *KsdnNode) SubnetStartNode() error
- func (node *KsdnNode) UpdatePod(pod kapi.Pod) error
- func (node *KsdnNode) VnidStartNode() error
- type NetworkInfo
- type NodeIPTables
- type PodConfig
- type ProcessEventFunc
- type ResourceName
Constants ¶
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 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 ¶
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 (*KsdnNode) DeleteHostSubnetRules ¶
func (plugin *KsdnNode) DeleteHostSubnetRules(subnet *etcdmanager.HostSubnet) error
func (*KsdnNode) DeleteServiceRules ¶
func (*KsdnNode) GetLocalPods ¶
func (*KsdnNode) IsPodNetworkReady ¶
func (*KsdnNode) SubnetStartNode ¶
func (*KsdnNode) UpdatePod ¶
FIXME: this should eventually go into kubelet via a CNI UPDATE/CHANGE action See https://github.com/containernetworking/cni/issues/89
func (*KsdnNode) VnidStartNode ¶
type NetworkInfo ¶
type NodeIPTables ¶
type NodeIPTables struct {
// contains filtered or unexported fields
}
func (*NodeIPTables) Setup ¶
func (n *NodeIPTables) Setup() error
type ProcessEventFunc ¶
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" )