app

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2016 License: Apache-2.0 Imports: 58 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 NewKubeletCommand added in v1.1.1

func NewKubeletCommand() *cobra.Command

NewKubeletCommand creates a *cobra.Command object with default parameters

func ProbeNetworkPlugins added in v0.14.0

func ProbeNetworkPlugins(pluginDir string) []network.NetworkPlugin

ProbeNetworkPlugins collects all compiled-in plugins

func ProbeVolumePlugins

func ProbeVolumePlugins() []volume.VolumePlugin

ProbeVolumePlugins collects all volume plugins into an easy to use list.

func RunKubelet added in v0.12.0

func RunKubelet(kcfg *KubeletConfig, builder KubeletBuilder) 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 added in v0.15.0

type KubeletBootstrap interface {
	BirthCry()
	StartGarbageCollection()
	ListenAndServe(net.IP, uint, *kubelet.TLSOptions, bool)
	ListenAndServeReadOnly(net.IP, uint)
	Run(<-chan kubelet.PodUpdate)
	RunOnce(<-chan kubelet.PodUpdate) ([]kubelet.RunPodResult, error)
}

bootstrapping interface for kubelet, targets the initialization protocol

type KubeletBuilder added in v0.15.0

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

create and initialize a Kubelet instance

type KubeletConfig added in v0.12.0

type KubeletConfig struct {
	Address                        net.IP
	AllowPrivileged                bool
	CAdvisorInterface              cadvisor.Interface
	CgroupRoot                     string
	Cloud                          cloudprovider.Interface
	ClusterDNS                     net.IP
	ClusterDomain                  string
	ConfigFile                     string
	ConfigureCBR0                  bool
	ContainerRuntime               string
	CPUCFSQuota                    bool
	DiskSpacePolicy                kubelet.DiskSpacePolicy
	DockerClient                   dockertools.DockerInterface
	DockerDaemonContainer          string
	DockerExecHandler              dockertools.ExecHandler
	EnableDebuggingHandlers        bool
	EnableServer                   bool
	EventBurst                     int
	EventRecordQPS                 float32
	FileCheckFrequency             time.Duration
	Hostname                       string
	HostnameOverride               string
	HostNetworkSources             []string
	HostPIDSources                 []string
	HostIPCSources                 []string
	HTTPCheckFrequency             time.Duration
	ImageGCPolicy                  kubelet.ImageGCPolicy
	KubeClient                     *client.Client
	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
	NodeStatusUpdateFrequency      time.Duration
	OSInterface                    kubecontainer.OSInterface
	PodCIDR                        string
	PodInfraContainerImage         string
	Port                           uint
	ReadOnlyPort                   uint
	Recorder                       record.EventRecorder
	RegisterNode                   bool
	RegistryBurst                  int
	RegistryPullQPS                float64
	ResolverConfig                 string
	ResourceContainer              string
	RktPath                        string
	RktStage1Image                 string
	RootDirectory                  string
	Runonce                        bool
	SerializeImagePulls            bool
	StandaloneMode                 bool
	StreamingConnectionIdleTimeout time.Duration
	SyncFrequency                  time.Duration
	SystemContainer                string
	TLSOptions                     *kubelet.TLSOptions
	Writer                         io.Writer
	VolumePlugins                  []volume.VolumePlugin
}

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 added in v0.14.0

func SimpleKubelet(client *client.Client,
	dockerClient dockertools.DockerInterface,
	hostname, rootDir, manifestURL, address string,
	port uint,
	readOnlyPort uint,
	masterServiceNamespace string,
	volumePlugins []volume.VolumePlugin,
	tlsOptions *kubelet.TLSOptions,
	cadvisorInterface cadvisor.Interface,
	configFilePath string,
	cloud cloudprovider.Interface,
	osInterface kubecontainer.OSInterface,
	fileCheckFrequency, httpCheckFrequency, minimumGCAge, nodeStatusUpdateFrequency, syncFrequency time.Duration) *KubeletConfig

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

type KubeletServer added in v0.12.0

type KubeletServer struct {
	Address                        net.IP
	AllowPrivileged                bool
	APIServerList                  []string
	AuthPath                       util.StringFlag // Deprecated -- use KubeConfig instead
	CAdvisorPort                   uint
	CertDirectory                  string
	CgroupRoot                     string
	CloudConfigFile                string
	CloudProvider                  string
	ClusterDNS                     net.IP
	ClusterDomain                  string
	Config                         string
	ConfigureCBR0                  bool
	ContainerRuntime               string
	CPUCFSQuota                    bool
	DockerDaemonContainer          string
	DockerEndpoint                 string
	DockerExecHandlerName          string
	EnableDebuggingHandlers        bool
	EnableServer                   bool
	EventBurst                     int
	EventRecordQPS                 float32
	FileCheckFrequency             time.Duration
	HealthzBindAddress             net.IP
	HealthzPort                    int
	HostnameOverride               string
	HostNetworkSources             string
	HostPIDSources                 string
	HostIPCSources                 string
	HTTPCheckFrequency             time.Duration
	ImageGCHighThresholdPercent    int
	ImageGCLowThresholdPercent     int
	KubeConfig                     util.StringFlag
	LowDiskSpaceThresholdMB        int
	ManifestURL                    string
	ManifestURLHeader              string
	MasterServiceNamespace         string
	MaxContainerCount              int
	MaxOpenFiles                   uint64
	MaxPerPodContainerCount        int
	MaxPods                        int
	MinimumGCAge                   time.Duration
	NetworkPluginDir               string
	NetworkPluginName              string
	NodeStatusUpdateFrequency      time.Duration
	OOMScoreAdj                    int
	PodCIDR                        string
	PodInfraContainerImage         string
	Port                           uint
	ReadOnlyPort                   uint
	RegisterNode                   bool
	RegistryBurst                  int
	RegistryPullQPS                float64
	ResolverConfig                 string
	ResourceContainer              string
	RktPath                        string
	RktStage1Image                 string
	RootDirectory                  string
	RunOnce                        bool
	StandaloneMode                 bool
	StreamingConnectionIdleTimeout time.Duration
	SyncFrequency                  time.Duration
	SystemContainer                string
	TLSCertFile                    string
	TLSPrivateKeyFile              string

	// Flags intended for testing
	// Is the kubelet containerized?
	Containerized bool
	// Insert a probability of random errors during calls to the master.
	ChaosChance float64
	// Crash immediately, rather than eating panics.
	ReallyCrashForTesting bool
	// Pull images one at a time.
	SerializeImagePulls bool
}

KubeletServer encapsulates all of the parameters necessary for starting up a kubelet. These can either be set via command line or directly.

func NewKubeletServer added in v0.12.0

func NewKubeletServer() *KubeletServer

NewKubeletServer will create a new KubeletServer with default values.

func (*KubeletServer) AddFlags added in v0.12.0

func (s *KubeletServer) AddFlags(fs *pflag.FlagSet)

AddFlags adds flags for a specific KubeletServer to the specified FlagSet

func (*KubeletServer) CreateAPIServerClientConfig added in v0.20.0

func (s *KubeletServer) CreateAPIServerClientConfig() (*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 (*KubeletServer) InitializeTLS added in v0.19.0

func (s *KubeletServer) InitializeTLS() (*kubelet.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 kubelet.TLSOptions object.

func (*KubeletServer) KubeletConfig added in v1.1.0

func (s *KubeletServer) KubeletConfig() (*KubeletConfig, error)

KubeletConfig returns a KubeletConfig suitable for being run, or an error if the server setup is not valid. It will not start any background processes.

func (*KubeletServer) Run added in v0.12.0

func (s *KubeletServer) Run(kcfg *KubeletConfig) error

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.

Jump to

Keyboard shortcuts

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