Documentation ¶
Overview ¶
Package app makes it easy to create a kubelet server for various contexts.
Index ¶
- func CreateAPIServerClientConfig(s *options.KubeletServer) (*restclient.Config, error)
- func InitializeTLS(s *options.KubeletServer) (*server.TLSOptions, error)
- func NewKubeletCommand() *cobra.Command
- func ProbeNetworkPlugins(pluginDir string) []network.NetworkPlugin
- func ProbeVolumePlugins(pluginDir string) []volume.VolumePlugin
- func Run(s *options.KubeletServer, kcfg *KubeletConfig) error
- func RunKubelet(kcfg *KubeletConfig) error
- type KubeletBootstrap
- type KubeletBuilder
- type KubeletConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAPIServerClientConfig ¶ added in v1.2.0
func CreateAPIServerClientConfig(s *options.KubeletServer) (*restclient.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 ¶ added in v1.2.0
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 ¶ added in v1.1.1
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(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 ¶ added in v1.2.0
func Run(s *options.KubeletServer, 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 RunKubelet ¶ added in v0.12.0
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 ¶ added in v0.15.0
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 ¶ added in v1.2.0
func CreateAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.PodConfig, err error)
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 Auth server.AuthInterface AutoDetectCloudProvider bool 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 RuntimeRequestTimeout time.Duration CPUCFSQuota bool DiskSpacePolicy kubelet.DiskSpacePolicy DockerClient dockertools.DockerInterface RuntimeCgroups string DockerExecHandler dockertools.ExecHandler EnableControllerAttachDetach bool EnableCustomMetrics bool EnableDebuggingHandlers bool CgroupsPerQOS 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 NvidiaGPUs int OOMAdjuster *oom.OOMAdjuster OSInterface kubecontainer.OSInterface PodCIDR string PodsPerCore int 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 RktAPIEndpoint string RktStage1Image string RootDirectory string Runonce bool SeccompProfileRoot string SerializeImagePulls bool StandaloneMode bool StreamingConnectionIdleTimeout time.Duration SyncFrequency time.Duration SystemCgroups string TLSOptions *server.TLSOptions Writer io.Writer VolumePlugins []volume.VolumePlugin OutOfDiskTransitionFrequency time.Duration EvictionConfig eviction.Config ExperimentalFlannelOverlay bool NodeIP net.IP ContainerRuntimeOptions []kubecontainer.Option HairpinMode string BabysitDaemons bool Options []kubelet.Option }
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 *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, evictionPressureTransitionPeriod time.Duration, maxPods int, podsPerCore 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 ¶ added in v1.2.0
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