kubernetesk8s.io/kubernetes/cmd/kubeadm/app/phases/kubelet Index | Files

package kubelet

import "k8s.io/kubernetes/cmd/kubeadm/app/phases/kubelet"

Index

Functions

func ApplyPatchesToConfig

func ApplyPatchesToConfig(cfg *kubeadmapi.ClusterConfiguration, patchesDir string) error

ApplyPatchesToConfig applies the patches located in patchesDir to the KubeletConfiguration stored in the ClusterConfiguration.ComponentConfigs map.

func CreateConfigMap

func CreateConfigMap(cfg *kubeadmapi.ClusterConfiguration, client clientset.Interface) error

CreateConfigMap creates a ConfigMap with the generic kubelet configuration. Used at "kubeadm init" and "kubeadm upgrade" time

func GetNodeNameAndHostname

func GetNodeNameAndHostname(cfg *kubeadmapi.NodeRegistrationOptions) (string, string, error)

GetNodeNameAndHostname obtains the name for this Node using the following precedence (from lower to higher): - actual hostname - NodeRegistrationOptions.Name (same as "--node-name" passed to "kubeadm init/join") - "hostname-override" flag in NodeRegistrationOptions.KubeletExtraArgs It also returns the hostname or an error if getting the hostname failed.

func ReadKubeletDynamicEnvFile

func ReadKubeletDynamicEnvFile(kubeletEnvFilePath string) ([]string, error)

ReadKubeletDynamicEnvFile reads the kubelet dynamic environment flags file a slice of strings.

func TryRestartKubelet

func TryRestartKubelet()

TryRestartKubelet attempts to restart the kubelet service

func TryStartKubelet

func TryStartKubelet()

TryStartKubelet attempts to bring up kubelet service

func TryStopKubelet

func TryStopKubelet()

TryStopKubelet attempts to bring down the kubelet service momentarily

func WriteConfigToDisk

func WriteConfigToDisk(cfg *kubeadmapi.ClusterConfiguration, kubeletDir, patchesDir string, output io.Writer) error

WriteConfigToDisk writes the kubelet config object down to a file Used at "kubeadm init" and "kubeadm upgrade" time

func WriteInstanceConfigToDisk

func WriteInstanceConfigToDisk(cfg *kubeletconfig.KubeletConfiguration, kubeletDir string) error

WriteInstanceConfigToDisk writes the container runtime endpoint configuration to the instance configuration file in the specified kubelet directory.

func WriteKubeletArgsToFile

func WriteKubeletArgsToFile(kubeletFlags, overridesFlags []kubeadmapi.Arg, kubeletDir string) error

WriteKubeletArgsToFile writes combined kubelet flags to KubeletEnvFile file in kubeletDir.

func WriteKubeletDynamicEnvFile

func WriteKubeletDynamicEnvFile(cfg *kubeadmapi.ClusterConfiguration, nodeReg *kubeadmapi.NodeRegistrationOptions, registerTaintsUsingFlags bool, kubeletDir string) error

WriteKubeletDynamicEnvFile writes an environment file with dynamic flags to the kubelet. Used at "kubeadm init" and "kubeadm join" time.

Source Files

config.go flags.go kubelet.go

Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
24 packages
Last checked
6 hours ago

Tools for package owners.