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

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 added in v1.2.0

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

func GetPodContainerID added in v1.2.0

func GetPodContainerID(pod *kapi.Pod) string

func HostSubnetToString

func HostSubnetToString(subnet *osapi.HostSubnet) string

func ValidateClusterNetwork added in v1.1.5

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

Types

type FirewallRule added in v1.1.1

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 added in v1.2.0

type OsdnController struct {
	Registry *Registry

	HostName string
	// contains filtered or unexported fields
}

func (*OsdnController) BaseInit added in v1.2.0

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 added in v1.2.0

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

func (*OsdnController) GetVNID

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

func (*OsdnController) StartMaster added in v1.2.0

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

func (*OsdnController) StartNode added in v1.2.0

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

func (*OsdnController) SubnetStartMaster added in v1.2.0

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

func (*OsdnController) SubnetStartNode added in v1.2.0

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

func (*OsdnController) VnidStartMaster added in v1.2.0

func (oc *OsdnController) VnidStartMaster() error

func (*OsdnController) VnidStartNode added in v1.2.0

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 added in v1.2.0

func (oc *OsdnController) WaitForPodNetworkReady() error

type PluginHooks added in v1.1.1

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 added in v1.1.1

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

func NewRegistry added in v1.1.1

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

func (*Registry) CreateClusterNetwork added in v1.1.5

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

func (*Registry) CreateSubnet added in v1.1.1

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

func (*Registry) DeleteNetNamespace added in v1.1.1

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

func (*Registry) DeleteSubnet added in v1.1.1

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

func (*Registry) GetAllPods

func (registry *Registry) GetAllPods() ([]kapi.Pod, error)

func (*Registry) GetClusterNetwork added in v1.1.5

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

func (*Registry) GetNetNamespace added in v1.1.1

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

func (*Registry) GetNetNamespaces added in v1.1.1

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

func (*Registry) GetNetworkInfo added in v1.1.5

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

func (*Registry) GetPod added in v1.1.5

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

func (*Registry) GetRunningPods added in v1.1.1

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

func (*Registry) GetServices added in v1.1.1

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

func (*Registry) GetServicesForNamespace added in v1.1.1

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

func (*Registry) GetSubnet added in v1.1.1

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

func (*Registry) GetSubnets added in v1.1.1

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 added in v1.1.5

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 added in v1.1.1

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