Documentation ¶
Overview ¶
Package app makes it easy to create a kubelet server for various contexts.
Index ¶
- func NewKubeletCommand() *cobra.Command
- func ProbeNetworkPlugins(pluginDir string) []network.NetworkPlugin
- func ProbeVolumePlugins() []volume.VolumePlugin
- func RunKubelet(kcfg *KubeletConfig) error
- type KubeletBootstrap
- type KubeletBuilder
- type KubeletConfig
- type KubeletServer
- func (s *KubeletServer) AddFlags(fs *pflag.FlagSet)
- func (s *KubeletServer) CreateAPIServerClientConfig() (*client.Config, error)
- func (s *KubeletServer) InitializeTLS() (*kubelet.TLSOptions, error)
- func (s *KubeletServer) Run(kcfg *KubeletConfig) error
- func (s *KubeletServer) UnsecuredKubeletConfig() (*KubeletConfig, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKubeletCommand ¶
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() []volume.VolumePlugin
ProbeVolumePlugins collects all volume plugins into an easy to use list.
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 *kubelet.TLSOptions, auth kubelet.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 kubelet.AuthInterface Builder KubeletBuilder 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 ChownRunner chown.Interface ChmodRunner chmod.Interface NetworkPluginName string NetworkPlugins []network.NetworkPlugin NodeName string NodeStatusUpdateFrequency time.Duration 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 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 ¶
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, maxPods int, ) *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 ¶
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 RegisterSchedulable 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 ReconcileCIDR bool // 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 KubeAPIQPS float32 KubeAPIBurst int // 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 ¶
func NewKubeletServer() *KubeletServer
NewKubeletServer will create a new KubeletServer with default values.
func (*KubeletServer) AddFlags ¶
func (s *KubeletServer) AddFlags(fs *pflag.FlagSet)
AddFlags adds flags for a specific KubeletServer to the specified FlagSet
func (*KubeletServer) CreateAPIServerClientConfig ¶
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 ¶
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) Run ¶
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.
func (*KubeletServer) UnsecuredKubeletConfig ¶
func (s *KubeletServer) UnsecuredKubeletConfig() (*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