func init() { … } const componentKubelet … // NewKubeletCommand creates a *cobra.Command object with default parameters func NewKubeletCommand() *cobra.Command { … } // mergeKubeletConfigurations merges the provided drop-in configurations with the base kubelet configuration. // The drop-in configurations are processed in lexical order based on the file names. This means that the // configurations in files with lower numeric prefixes are applied first, followed by higher numeric prefixes. // For example, if the drop-in directory contains files named "10-config.conf" and "20-config.conf", // the configurations in "10-config.conf" will be applied first, and then the configurations in "20-config.conf" will be applied, // potentially overriding the previous values. func mergeKubeletConfigurations(kubeletConfig *kubeletconfiginternal.KubeletConfiguration, kubeletDropInConfigDir string) error { … } // newFlagSetWithGlobals constructs a new pflag.FlagSet with global flags registered // on it. func newFlagSetWithGlobals() *pflag.FlagSet { … } // newFakeFlagSet constructs a pflag.FlagSet with the same flags as fs, but where // all values have noop Set implementations func newFakeFlagSet(fs *pflag.FlagSet) *pflag.FlagSet { … } // kubeletConfigFlagPrecedence re-parses flags over the KubeletConfiguration object. // We must enforce flag precedence by re-parsing the command line into the new object. // This is necessary to preserve backwards-compatibility across binary upgrades. // See issue #56171 for more details. func kubeletConfigFlagPrecedence(kc *kubeletconfiginternal.KubeletConfiguration, args []string) error { … } func loadConfigFile(name string) (*kubeletconfiginternal.KubeletConfiguration, error) { … } func loadDropinConfigFileIntoJSON(name string) ([]byte, *schema.GroupVersionKind, error) { … } // UnsecuredDependencies returns a Dependencies 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 func UnsecuredDependencies(s *options.KubeletServer, featureGate featuregate.FeatureGate) (*kubelet.Dependencies, error) { … } // Run runs the specified KubeletServer with the given Dependencies. This should never exit. // The kubeDeps argument may be nil - if so, it is initialized from the settings on KubeletServer. // Otherwise, the caller is assumed to have set up the Dependencies object and a default one will // not be generated. func Run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Dependencies, featureGate featuregate.FeatureGate) error { … } func setConfigz(cz *configz.Config, kc *kubeletconfiginternal.KubeletConfiguration) error { … } func initConfigz(kc *kubeletconfiginternal.KubeletConfiguration) error { … } // makeEventRecorder sets up kubeDeps.Recorder if it's nil. It's a no-op otherwise. func makeEventRecorder(ctx context.Context, kubeDeps *kubelet.Dependencies, nodeName types.NodeName) { … } func getReservedCPUs(machineInfo *cadvisorapi.MachineInfo, cpus string) (cpuset.CPUSet, error) { … } func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Dependencies, featureGate featuregate.FeatureGate) (err error) { … } // buildKubeletClientConfig constructs the appropriate client config for the kubelet depending on whether // bootstrapping is enabled or client certificate rotation is enabled. func buildKubeletClientConfig(ctx context.Context, s *options.KubeletServer, tp oteltrace.TracerProvider, nodeName types.NodeName) (*restclient.Config, func(), error) { … } // updateDialer instruments a restconfig with a dial. the returned function allows forcefully closing all active connections. func updateDialer(clientConfig *restclient.Config) (func(), error) { … } // buildClientCertificateManager creates a certificate manager that will use certConfig to request a client certificate // if no certificate is available, or the most recent clientConfig (which is assumed to point to the cert that the manager will // write out). func buildClientCertificateManager(certConfig, clientConfig *restclient.Config, certDir string, nodeName types.NodeName) (certificate.Manager, error) { … } func kubeClientConfigOverrides(s *options.KubeletServer, clientConfig *restclient.Config) { … } // getNodeName returns the node name according to the cloud provider // if cloud provider is specified. Otherwise, returns the hostname of the node. func getNodeName(cloud cloudprovider.Interface, hostname string) (types.NodeName, 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 InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletConfiguration) (*server.TLSOptions, error) { … } // setContentTypeForClient sets the appropriate content type into the rest config // and handles defaulting AcceptContentTypes based on that input. func setContentTypeForClient(cfg *restclient.Config, contentType string) { … } // 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 func RunKubelet(ctx context.Context, kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencies, runOnce bool) error { … } func startKubelet(k kubelet.Bootstrap, podCfg *config.PodConfig, kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps *kubelet.Dependencies, enableServer bool) { … } func createAndInitKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencies, hostname string, hostnameOverridden bool, nodeName types.NodeName, nodeIPs []net.IP) (k kubelet.Bootstrap, err error) { … } // parseResourceList parses the given configuration map into an API // ResourceList or returns an error. func parseResourceList(m map[string]string) (v1.ResourceList, error) { … } func newTracerProvider(s *options.KubeletServer) (oteltrace.TracerProvider, error) { … } func getCgroupDriverFromCRI(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Dependencies) error { … }