app

package
v1.1.0-alpha.0....-ad7ed67 Latest Latest
Warning

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

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

Documentation

Overview

Package app makes it easy to create a kubelet server for various contexts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAPIServerClientConfig

func CreateAPIServerClientConfig(s *options.KubeletServer) (*client.Config, error)

CreateAPIServerClientConfig generates a client.Config from command line flags, including api-server-list, via createClientConfig and then injects chaos into the configuration via addChaosToClientConfig. This func is exported to support integration with third party kubelet extensions (e.g. kubernetes-mesos).

func InitializeTLS

func InitializeTLS(s *options.KubeletServer) (*server.TLSOptions, error)

InitializeTLS checks for a configured TLSCertFile and TLSPrivateKeyFile: if unspecified a new self-signed certificate and key file are generated. Returns a configured server.TLSOptions object.

func NewKubeletCommand

func NewKubeletCommand() *cobra.Command

NewKubeletCommand creates a *cobra.Command object with default parameters

func ProbeNetworkPlugins

func ProbeNetworkPlugins(pluginDir string) []network.NetworkPlugin

ProbeNetworkPlugins collects all compiled-in plugins

func ProbeVolumePlugins

func ProbeVolumePlugins(pluginDir string) []volume.VolumePlugin

ProbeVolumePlugins collects all volume plugins into an easy to use list. PluginDir specifies the directory to search for additional third party volume plugins.

func Run

Run runs the specified KubeletServer for the given KubeletConfig. This should never exit. The kcfg argument may be nil - if so, it is initialized from the settings on KubeletServer. Otherwise, the caller is assumed to have set up the KubeletConfig object and all defaults will be ignored.

func RunKubelet

func RunKubelet(kcfg *KubeletConfig) error

RunKubelet is responsible for setting up and running a kubelet. It is used in three different applications:

1 Integration tests
2 Kubelet binary
3 Standalone 'kubernetes' binary

Eventually, #2 will be replaced with instances of #3

Types

type KubeletBootstrap

type KubeletBootstrap interface {
	BirthCry()
	StartGarbageCollection()
	ListenAndServe(address net.IP, port uint, tlsOptions *server.TLSOptions, auth server.AuthInterface, enableDebuggingHandlers bool)
	ListenAndServeReadOnly(address net.IP, port uint)
	Run(<-chan kubetypes.PodUpdate)
	RunOnce(<-chan kubetypes.PodUpdate) ([]kubelet.RunPodResult, error)
}

bootstrapping interface for kubelet, targets the initialization protocol

func CreateAndInitKubelet

func CreateAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.PodConfig, err error)

type KubeletBuilder

type KubeletBuilder func(kc *KubeletConfig) (KubeletBootstrap, *config.PodConfig, error)

create and initialize a Kubelet instance

type KubeletConfig

type KubeletConfig struct {
	Address                        net.IP
	AllowPrivileged                bool
	Auth                           server.AuthInterface
	Builder                        KubeletBuilder
	CAdvisorInterface              cadvisor.Interface
	VolumeStatsAggPeriod           time.Duration
	CgroupRoot                     string
	Cloud                          cloudprovider.Interface
	ClusterDNS                     net.IP
	ClusterDomain                  string
	ConfigFile                     string
	ConfigureCBR0                  bool
	ContainerManager               cm.ContainerManager
	ContainerRuntime               string
	CPUCFSQuota                    bool
	DiskSpacePolicy                kubelet.DiskSpacePolicy
	DockerClient                   dockertools.DockerInterface
	RuntimeCgroups                 string
	DockerExecHandler              dockertools.ExecHandler
	EnableCustomMetrics            bool
	EnableDebuggingHandlers        bool
	EnableServer                   bool
	EventClient                    *clientset.Clientset
	EventBurst                     int
	EventRecordQPS                 float32
	FileCheckFrequency             time.Duration
	Hostname                       string
	HostnameOverride               string
	HostNetworkSources             []string
	HostPIDSources                 []string
	HostIPCSources                 []string
	HTTPCheckFrequency             time.Duration
	ImageGCPolicy                  kubelet.ImageGCPolicy
	KubeClient                     *clientset.Clientset
	ManifestURL                    string
	ManifestURLHeader              http.Header
	MasterServiceNamespace         string
	MaxContainerCount              int
	MaxOpenFiles                   uint64
	MaxPerPodContainerCount        int
	MaxPods                        int
	MinimumGCAge                   time.Duration
	Mounter                        mount.Interface
	NetworkPluginName              string
	NetworkPlugins                 []network.NetworkPlugin
	NodeName                       string
	NodeLabels                     map[string]string
	NodeStatusUpdateFrequency      time.Duration
	NonMasqueradeCIDR              string
	OOMAdjuster                    *oom.OOMAdjuster
	OSInterface                    kubecontainer.OSInterface
	PodCIDR                        string
	ReconcileCIDR                  bool
	PodConfig                      *config.PodConfig
	PodInfraContainerImage         string
	Port                           uint
	ReadOnlyPort                   uint
	Recorder                       record.EventRecorder
	RegisterNode                   bool
	RegisterSchedulable            bool
	RegistryBurst                  int
	RegistryPullQPS                float64
	Reservation                    kubetypes.Reservation
	ResolverConfig                 string
	KubeletCgroups                 string
	RktPath                        string
	RktStage1Image                 string
	RootDirectory                  string
	Runonce                        bool
	SerializeImagePulls            bool
	StandaloneMode                 bool
	StreamingConnectionIdleTimeout time.Duration
	SyncFrequency                  time.Duration
	SystemCgroups                  string
	TLSOptions                     *server.TLSOptions
	Writer                         io.Writer
	VolumePlugins                  []volume.VolumePlugin
	OutOfDiskTransitionFrequency   time.Duration

	ExperimentalFlannelOverlay bool
	NodeIP                     net.IP
	ContainerRuntimeOptions    []kubecontainer.Option
	HairpinMode                bool
}

KubeletConfig is all of the parameters necessary for running a kubelet. TODO: This should probably be merged with KubeletServer. The extra object is a consequence of refactoring.

func SimpleKubelet

func SimpleKubelet(client *clientset.Clientset,
	dockerClient dockertools.DockerInterface,
	hostname, rootDir, manifestURL, address string,
	port uint,
	readOnlyPort uint,
	masterServiceNamespace string,
	volumePlugins []volume.VolumePlugin,
	tlsOptions *server.TLSOptions,
	cadvisorInterface cadvisor.Interface,
	configFilePath string,
	cloud cloudprovider.Interface,
	osInterface kubecontainer.OSInterface,
	fileCheckFrequency, httpCheckFrequency, minimumGCAge, nodeStatusUpdateFrequency, syncFrequency, outOfDiskTransitionFrequency time.Duration,
	maxPods int,
	containerManager cm.ContainerManager, clusterDNS net.IP) *KubeletConfig

SimpleRunKubelet is a simple way to start a Kubelet talking to dockerEndpoint, using an API Client. Under the hood it calls RunKubelet (below)

func UnsecuredKubeletConfig

func UnsecuredKubeletConfig(s *options.KubeletServer) (*KubeletConfig, error)

UnsecuredKubeletConfig returns a KubeletConfig suitable for being run, or an error if the server setup is not valid. It will not start any background processes, and does not include authentication/authorization

Directories

Path Synopsis
Package options contains all of the primary arguments for a kubelet.
Package options contains all of the primary arguments for a kubelet.

Jump to

Keyboard shortcuts

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