Documentation ¶
Overview ¶
Package options contains all of the primary arguments for a kubelet.
Index ¶
- func AddGlobalFlags(fs *pflag.FlagSet)
- func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfiguration)
- func NewContainerRuntimeOptions() *config.ContainerRuntimeOptions
- func NewKubeletConfiguration() (*kubeletconfig.KubeletConfiguration, error)
- func ValidateKubeletFlags(f *KubeletFlags) error
- func ValidateKubeletServer(s *KubeletServer) error
- type KubeletFlags
- type KubeletServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGlobalFlags ¶
AddGlobalFlags explicitly registers flags that libraries (glog, verflag, etc.) register against the global flagsets from "flag" and "github.com/spf13/pflag". We do this in order to prevent unwanted flags from leaking into the Kubelet's flagset.
func AddKubeletConfigFlags ¶
func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfiguration)
AddKubeletConfigFlags adds flags for a specific kubeletconfig.KubeletConfiguration to the specified FlagSet
func NewContainerRuntimeOptions ¶
func NewContainerRuntimeOptions() *config.ContainerRuntimeOptions
NewContainerRuntimeOptions will create a new ContainerRuntimeOptions with default values.
func NewKubeletConfiguration ¶
func NewKubeletConfiguration() (*kubeletconfig.KubeletConfiguration, error)
NewKubeletConfiguration will create a new KubeletConfiguration with default values
func ValidateKubeletFlags ¶
func ValidateKubeletFlags(f *KubeletFlags) error
ValidateKubeletFlags validates Kubelet's configuration flags and returns an error if they are invalid.
func ValidateKubeletServer ¶
func ValidateKubeletServer(s *KubeletServer) error
ValidateKubeletServer validates configuration of KubeletServer and returns an error if the input configuration is invalid.
Types ¶
type KubeletFlags ¶
type KubeletFlags struct { KubeConfig string BootstrapKubeconfig string // Insert a probability of random errors during calls to the master. ChaosChance float64 // Crash immediately, rather than eating panics. ReallyCrashForTesting bool // TODO(mtaufen): It is increasingly looking like nobody actually uses the // Kubelet's runonce mode anymore, so it may be a candidate // for deprecation and removal. // If runOnce is true, the Kubelet will check the API server once for pods, // run those in addition to the pods specified by static pod files, and exit. RunOnce bool // enableServer enables the Kubelet's server EnableServer bool // HostnameOverride is the hostname used to identify the kubelet instead // of the actual hostname. HostnameOverride string // NodeIP is IP address of the node. // If set, kubelet will use this IP address for the node. NodeIP string // This flag, if set, sets the unique id of the instance that an external provider (i.e. cloudprovider) // can use to identify a specific node ProviderID string // Container-runtime-specific options. config.ContainerRuntimeOptions // certDirectory is the directory where the TLS certs are located (by // default /var/run/kubernetes). If tlsCertFile and tlsPrivateKeyFile // are provided, this flag will be ignored. CertDirectory string // cloudProvider is the provider for cloud services. // +optional CloudProvider string // cloudConfigFile is the path to the cloud provider configuration file. // +optional CloudConfigFile string // rootDirectory is the directory path to place kubelet files (volume // mounts,etc). RootDirectory string // The Kubelet will use this directory for checkpointing downloaded configurations and tracking configuration health. // The Kubelet will create this directory if it does not already exist. // The path may be absolute or relative; relative paths are under the Kubelet's current working directory. // Providing this flag enables dynamic kubelet configuration. // To use this flag, the DynamicKubeletConfig feature gate must be enabled. DynamicConfigDir cliflag.StringFlag // The Kubelet will load its initial configuration from this file. // The path may be absolute or relative; relative paths are under the Kubelet's current working directory. // Omit this flag to use the combination of built-in default configuration values and flags. KubeletConfigFile string // registerNode enables automatic registration with the apiserver. RegisterNode bool // registerWithTaints are an array of taints to add to a node object when // the kubelet registers itself. This only takes effect when registerNode // is true and upon the initial registration of the node. RegisterWithTaints []core.Taint // WindowsService should be set to true if kubelet is running as a service on Windows. // Its corresponding flag only gets registered in Windows builds. WindowsService bool // remoteRuntimeEndpoint is the endpoint of remote runtime service RemoteRuntimeEndpoint string // remoteImageEndpoint is the endpoint of remote image service RemoteImageEndpoint string // experimentalMounterPath is the path of mounter binary. Leave empty to use the default mount path ExperimentalMounterPath string // If enabled, the kubelet will integrate with the kernel memcg notification to determine if memory eviction thresholds are crossed rather than polling. // +optional ExperimentalKernelMemcgNotification bool // This flag, if set, enables a check prior to mount operations to verify that the required components // (binaries, etc.) to mount the volume are available on the underlying node. If the check is enabled // and fails the mount operation fails. ExperimentalCheckNodeCapabilitiesBeforeMount bool // This flag, if set, will avoid including `EvictionHard` limits while computing Node Allocatable. // Refer to [Node Allocatable](https://git.k8s.io/community/contributors/design-proposals/node/node-allocatable.md) doc for more information. ExperimentalNodeAllocatableIgnoreEvictionThreshold bool // Node Labels are the node labels to add when registering the node in the cluster NodeLabels map[string]string // volumePluginDir is the full path of the directory in which to search // for additional third party volume plugins VolumePluginDir string // lockFilePath is the path that kubelet will use to as a lock file. // It uses this file as a lock to synchronize with other kubelet processes // that may be running. LockFilePath string // ExitOnLockContention is a flag that signifies to the kubelet that it is running // in "bootstrap" mode. This requires that 'LockFilePath' has been set. // This will cause the kubelet to listen to inotify events on the lock file, // releasing it and exiting when another process tries to open that file. ExitOnLockContention bool // seccompProfileRoot is the directory path for seccomp profiles. SeccompProfileRoot string // bootstrapCheckpointPath is the path to the directory containing pod checkpoints to // run on restore BootstrapCheckpointPath string // NodeStatusMaxImages caps the number of images reported in Node.Status.Images. // This is an experimental, short-term flag to help with node scalability. NodeStatusMaxImages int32 // DEPRECATED FLAGS // minimumGCAge is the minimum age for a finished container before it is // garbage collected. MinimumGCAge metav1.Duration // maxPerPodContainerCount is the maximum number of old instances to // retain per container. Each container takes up some disk space. MaxPerPodContainerCount int32 // maxContainerCount is the maximum number of old instances of containers // to retain globally. Each container takes up some disk space. MaxContainerCount int32 // masterServiceNamespace is The namespace from which the kubernetes // master services should be injected into pods. MasterServiceNamespace string // registerSchedulable tells the kubelet to register the node as // schedulable. Won't have any effect if register-node is false. // DEPRECATED: use registerWithTaints instead RegisterSchedulable bool // nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade. NonMasqueradeCIDR string // This flag, if set, instructs the kubelet to keep volumes from terminated pods mounted to the node. // This can be useful for debugging volume related issues. KeepTerminatedPodVolumes bool // EnableCAdvisorJSONEndpoints enables some cAdvisor endpoints that will be removed in future versions EnableCAdvisorJSONEndpoints bool }
KubeletFlags contains configuration flags for the Kubelet. A configuration field should go in KubeletFlags instead of KubeletConfiguration if any of these are true:
- its value will never, or cannot safely be changed during the lifetime of a node, or
- its value cannot be safely shared between nodes at the same time (e.g. a hostname); KubeletConfiguration is intended to be shared between nodes.
In general, please try to avoid adding flags or configuration fields, we already have a confusingly large amount of them.
func NewKubeletFlags ¶
func NewKubeletFlags() *KubeletFlags
NewKubeletFlags will create a new KubeletFlags with default values
func (*KubeletFlags) AddFlags ¶
func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet)
AddFlags adds flags for a specific KubeletFlags to the specified FlagSet
type KubeletServer ¶
type KubeletServer struct { KubeletFlags kubeletconfig.KubeletConfiguration }
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, error)
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