osdn

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2016 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// Maximum VXLAN Network Identifier as per RFC#7348
	MaxVNID = ((1 << 24) - 1)
	// VNID for the admin namespaces
	AdminVNID = uint(0)
)

Variables

This section is empty.

Functions

func GetNodeIP

func GetNodeIP(node *kapi.Node) (string, error)

func GetPodContainerID

func GetPodContainerID(pod *kapi.Pod) string

func SetupIptables

func SetupIptables(ipt iptables.Interface, clusterNetworkCIDR string) error

func ValidateClusterNetwork

func ValidateClusterNetwork(network string, hostSubnetLength int, serviceNetwork string) (*net.IPNet, int, *net.IPNet, error)

Types

type EventType

type EventType string
const (
	Added   EventType = "ADDED"
	Deleted EventType = "DELETED"
)

type FirewallRule

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

type HostSubnetEvent

type HostSubnetEvent struct {
	Type       EventType
	HostSubnet *osapi.HostSubnet
}

type NamespaceEvent

type NamespaceEvent struct {
	Type      EventType
	Namespace *kapi.Namespace
}

type NetNamespaceEvent

type NetNamespaceEvent struct {
	Type         EventType
	NetNamespace *osapi.NetNamespace
}

type NodeEvent

type NodeEvent struct {
	Type EventType
	Node *kapi.Node
}

type OsdnController

type OsdnController struct {
	Registry *Registry

	HostName string

	VNIDMap map[string]uint
	// contains filtered or unexported fields
}

func (*OsdnController) BaseInit

func (oc *OsdnController) BaseInit(registry *Registry, pluginHooks PluginHooks, multitenant bool, hostname string, selfIP string) error

Called by plug factory functions to initialize the generic plugin instance

func (*OsdnController) GetLocalPods

func (oc *OsdnController) GetLocalPods(namespace string) ([]kapi.Pod, error)

func (*OsdnController) StartMaster

func (oc *OsdnController) StartMaster(clusterNetworkCIDR string, clusterBitsPerSubnet uint, serviceNetworkCIDR string) error

func (*OsdnController) StartNode

func (oc *OsdnController) StartNode(mtu uint) error

func (*OsdnController) SubnetStartMaster

func (oc *OsdnController) SubnetStartMaster(clusterNetwork *net.IPNet, hostSubnetLength uint) error

func (*OsdnController) SubnetStartNode

func (oc *OsdnController) SubnetStartNode(mtu uint) (bool, error)

func (*OsdnController) VnidStartMaster

func (oc *OsdnController) VnidStartMaster() error

func (*OsdnController) VnidStartNode

func (oc *OsdnController) VnidStartNode() error

func (*OsdnController) WaitForPodNetworkReady

func (oc *OsdnController) WaitForPodNetworkReady() error

type PluginHooks

type PluginHooks interface {
	PluginStartMaster(clusterNetwork *net.IPNet, hostSubnetLength uint) error
	PluginStartNode(mtu uint) error

	SetupSDN(localSubnetCIDR, clusterNetworkCIDR, serviceNetworkCIDR string, mtu uint) (bool, error)

	AddHostSubnetRules(subnet *osapi.HostSubnet)
	DeleteHostSubnetRules(subnet *osapi.HostSubnet)

	AddServiceRules(service *kapi.Service, netID uint)
	DeleteServiceRules(service *kapi.Service)

	UpdatePod(namespace string, name string, id kubetypes.DockerID) error
}

type Registry

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

func NewRegistry

func NewRegistry(osClient *osclient.Client, kClient *kclient.Client) *Registry

func (*Registry) CreateClusterNetwork

func (registry *Registry) CreateClusterNetwork(clusterNetwork *net.IPNet, subnetLength int, serviceNetwork *net.IPNet) error

func (*Registry) CreateSubnet

func (registry *Registry) CreateSubnet(nodeName, nodeIP, subnetCIDR string) error

func (*Registry) DeleteNetNamespace

func (registry *Registry) DeleteNetNamespace(name string) error

func (*Registry) DeleteSubnet

func (registry *Registry) DeleteSubnet(nodeName string) error

func (*Registry) GetClusterNetwork

func (registry *Registry) GetClusterNetwork() (*net.IPNet, error)

func (*Registry) GetNetNamespace

func (registry *Registry) GetNetNamespace(name string) (*osapi.NetNamespace, error)

func (*Registry) GetNetNamespaces

func (registry *Registry) GetNetNamespaces() ([]osapi.NetNamespace, error)

func (*Registry) GetNetworkInfo

func (registry *Registry) GetNetworkInfo() (*net.IPNet, int, *net.IPNet, error)

func (*Registry) GetPod

func (registry *Registry) GetPod(nodeName, namespace, podName string) (*kapi.Pod, error)

func (*Registry) GetRunningPods

func (registry *Registry) GetRunningPods(nodeName, namespace string) ([]kapi.Pod, error)

func (*Registry) GetServices

func (registry *Registry) GetServices() ([]kapi.Service, error)

func (*Registry) GetServicesForNamespace

func (registry *Registry) GetServicesForNamespace(namespace string) ([]kapi.Service, error)

func (*Registry) GetSubnet

func (registry *Registry) GetSubnet(nodeName string) (*osapi.HostSubnet, error)

func (*Registry) GetSubnets

func (registry *Registry) GetSubnets() ([]osapi.HostSubnet, error)

func (*Registry) OnEndpointsUpdate

func (registry *Registry) OnEndpointsUpdate(allEndpoints []kapi.Endpoints)

func (*Registry) PopulatePodsByIP

func (registry *Registry) PopulatePodsByIP() error

func (*Registry) SetBaseEndpointsHandler

func (registry *Registry) SetBaseEndpointsHandler(base pconfig.EndpointsConfigHandler)

FilteringEndpointsConfigHandler implementation

func (*Registry) UpdateClusterNetwork

func (registry *Registry) UpdateClusterNetwork(clusterNetwork *net.IPNet, subnetLength int, serviceNetwork *net.IPNet) error

func (*Registry) WatchNamespaces

func (registry *Registry) WatchNamespaces(receiver chan<- *NamespaceEvent) error

func (*Registry) WatchNetNamespaces

func (registry *Registry) WatchNetNamespaces(receiver chan<- *NetNamespaceEvent) error

func (*Registry) WatchNodes

func (registry *Registry) WatchNodes(receiver chan<- *NodeEvent) error

func (*Registry) WatchPods

func (registry *Registry) WatchPods() error

func (*Registry) WatchServices

func (registry *Registry) WatchServices(receiver chan<- *ServiceEvent) error

func (*Registry) WatchSubnets

func (registry *Registry) WatchSubnets(receiver chan<- *HostSubnetEvent) error

func (*Registry) WriteNetNamespace

func (registry *Registry) WriteNetNamespace(name string, id uint) error

type ServiceEvent

type ServiceEvent struct {
	Type    EventType
	Service *kapi.Service
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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