osdn

package
v1.3.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2016 License: Apache-2.0 Imports: 27 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 (
	// TODO: We are unable to consolidate constants with ovs/controller.go as golang doesn't allow import cycle
	// Fix this once we land https://github.com/openshift/openshift-sdn/pull/305
	TUN        = "tun0"
	VXLAN_PORT = "4789"
)
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 HostSubnetToString

func HostSubnetToString(subnet *osapi.HostSubnet) string

func ValidateClusterNetwork

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

Types

type FirewallRule

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

type NodeIPTables

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

func NewNodeIPTables

func NewNodeIPTables(clusterNetworkCIDR string, syncPeriod time.Duration) *NodeIPTables

func (*NodeIPTables) Setup

func (n *NodeIPTables) Setup() error

type OsdnController

type OsdnController struct {
	Registry *Registry

	HostName string
	// contains filtered or unexported fields
}

func (*OsdnController) BaseInit

func (oc *OsdnController) BaseInit(registry *Registry, pluginHooks PluginHooks, multitenant bool, hostname string, selfIP string, iptablesSyncPeriod time.Duration) 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) GetVNID

func (oc *OsdnController) GetVNID(name string) (uint, 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) WaitAndGetVNID

func (oc *OsdnController) WaitAndGetVNID(name string) (uint, error)

Nodes asynchronously watch for both NetNamespaces and services NetNamespaces populates vnid map and services/pod-setup depend on vnid map If for some reason, vnid map propagation from master to node is slow and if service/pod-setup tries to lookup vnid map then it may fail. So, use this method to alleviate this problem. This method will retry vnid lookup before giving up.

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) error
	DeleteHostSubnetRules(subnet *osapi.HostSubnet) error

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

	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) (*osapi.HostSubnet, error)

func (*Registry) DeleteNetNamespace

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

func (*Registry) DeleteSubnet

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

func (*Registry) GetAllPods

func (registry *Registry) GetAllPods() ([]kapi.Pod, 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) RunEventQueue

func (registry *Registry) RunEventQueue(resourceName ResourceName) *oscache.EventQueue

Run event queue for the given resource

func (*Registry) UpdateClusterNetwork

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

func (*Registry) UpdateSubnet

func (registry *Registry) UpdateSubnet(hs *osapi.HostSubnet) (*osapi.HostSubnet, error)

func (*Registry) WriteNetNamespace

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

type ResourceName

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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