network

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultInterfaceName = "eth0"

TODO: Consider making this value configurable.

View Source
const DefaultPluginName = "kubernetes.io/no-op"
View Source
const NET_PLUGIN_EVENT_POD_CIDR_CHANGE = "pod-cidr-change"

Called when the node's Pod CIDR is known when using the controller manager's --allocate-node-cidrs=true option

View Source
const NET_PLUGIN_EVENT_POD_CIDR_CHANGE_DETAIL_CIDR = "pod-cidr"

Variables

This section is empty.

Functions

func UnescapePluginName

func UnescapePluginName(in string) string

Types

type Host

type Host interface {
	// Get the pod structure by its name, namespace
	GetPodByName(namespace, name string) (*api.Pod, bool)

	// GetKubeClient returns a client interface
	GetKubeClient() clientset.Interface

	// GetContainerRuntime returns the container runtime that implements the containers (e.g. docker/rkt)
	GetRuntime() kubecontainer.Runtime
}

Host is an interface that plugins can use to access the kubelet.

type NetworkPlugin

type NetworkPlugin interface {
	// Init initializes the plugin.  This will be called exactly once
	// before any other methods are called.
	Init(host Host) error

	// Called on various events like:
	// NET_PLUGIN_EVENT_POD_CIDR_CHANGE
	Event(name string, details map[string]interface{})

	// Name returns the plugin's name. This will be used when searching
	// for a plugin by name, e.g.
	Name() string

	// SetUpPod is the method called after the infra container of
	// the pod has been created but before the other containers of the
	// pod are launched.
	SetUpPod(namespace string, name string, podInfraContainerID kubecontainer.DockerID, containerRuntime string) error

	// TearDownPod is the method called before a pod's infra container will be deleted
	TearDownPod(namespace string, name string, podInfraContainerID kubecontainer.DockerID, containerRuntime string) error

	// Status is the method called to obtain the ipv4 or ipv6 addresses of the container
	Status(namespace string, name string, podInfraContainerID kubecontainer.DockerID, containerRuntime string) (*PodNetworkStatus, error)
}

Plugin is an interface to network plugins for the kubelet

func InitNetworkPlugin

func InitNetworkPlugin(plugins []NetworkPlugin, networkPluginName string, host Host) (NetworkPlugin, error)

InitNetworkPlugin inits the plugin that matches networkPluginName. Plugins must have unique names.

type PodNetworkStatus

type PodNetworkStatus struct {
	unversioned.TypeMeta `json:",inline"`

	// IP is the primary ipv4/ipv6 address of the pod. Among other things it is the address that -
	//   - kube expects to be reachable across the cluster
	//   - service endpoints are constructed with
	//   - will be reported in the PodStatus.PodIP field (will override the IP reported by docker)
	IP net.IP `json:"ip" description:"Primary IP address of the pod"`
}

PodNetworkStatus stores the network status of a pod (currently just the primary IP address) This struct represents version "v1beta1"

Directories

Path Synopsis
Package exec scans and loads networking plugins that are installed under /usr/libexec/kubernetes/kubelet-plugins/net/exec/ The layout convention for a plugin is:
Package exec scans and loads networking plugins that are installed under /usr/libexec/kubernetes/kubelet-plugins/net/exec/ The layout convention for a plugin is:

Jump to

Keyboard shortcuts

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