network

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPluginName = "kubernetes.io/no-op"

Variables

This section is empty.

Functions

func NewFakeHost

func NewFakeHost(kubeClient client.Interface) *fakeNetworkHost

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() client.Interface
}

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

	// 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 kubeletTypes.DockerID) error

	// TearDownPod is the method called before a pod's infra container will be deleted
	TearDownPod(namespace string, name string, podInfraContainerID kubeletTypes.DockerID) 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.

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: plugin-name/ (plugins have to be directories first) plugin-name/plugin-name (executable that will be called out, see Vendoring Note for more nuances) plugin-name/<other-files> where, 'executable' has the following requirements: - should have exec permissions - should give non-zero exit code on failure, and zero on sucess - the arguments will be <action> <pod_namespace> <pod_name> <docker_id_of_infra_container> whereupon, <action> will be one of: - init, called when the kubelet loads the plugin - setup, called after the infra container of a pod is created, but before other containers of the pod are created - teardown, called before the pod infra container is killed As the executables are called, the file-descriptors stdin, stdout, stderr remain open.
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: plugin-name/ (plugins have to be directories first) plugin-name/plugin-name (executable that will be called out, see Vendoring Note for more nuances) plugin-name/<other-files> where, 'executable' has the following requirements: - should have exec permissions - should give non-zero exit code on failure, and zero on sucess - the arguments will be <action> <pod_namespace> <pod_name> <docker_id_of_infra_container> whereupon, <action> will be one of: - init, called when the kubelet loads the plugin - setup, called after the infra container of a pod is created, but before other containers of the pod are created - teardown, called before the pod infra container is killed As the executables are called, the file-descriptors stdin, stdout, stderr remain open.

Jump to

Keyboard shortcuts

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