...

Package options

import "k8s.io/kubernetes/cmd/kubelet/app/options"
Overview
Index

Overview ▾

Package options contains all of the primary arguments for a kubelet.

func AddGlobalFlags

func AddGlobalFlags(fs *pflag.FlagSet)

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.

type KubeletFlags

KubeletFlags contains configuration flags for the Kubelet. A configuration field should go in KubeletFlags instead of KubeletConfiguration if any of these are true:

In general, please try to avoid adding flags or configuration fields, we already have a confusingly large amount of them.

type KubeletFlags struct {
    KubeConfig          string
    BootstrapKubeconfig string

    // 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

    // Container-runtime-specific options.
    config.ContainerRuntimeOptions

    // certDirectory is the directory where the TLS certs are located.
    // 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 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

    // kubeletDropinConfigDirectory is a path to a directory to specify dropins allows the user to optionally specify
    // additional configs to overwrite what is provided by default and in the KubeletConfigFile flag
    KubeletDropinConfigDirectory string

    // 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

    // WindowsPriorityClass sets the priority class associated with the Kubelet process
    // Its corresponding flag only gets registered in Windows builds
    // The default priority class associated with any process in Windows is NORMAL_PRIORITY_CLASS. Keeping it as is
    // to maintain backwards compatibility.
    // Source: https://docs.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities
    WindowsPriorityClass string

    // experimentalMounterPath is the path of mounter binary. Leave empty to use the default mount path
    ExperimentalMounterPath string
    // This flag, if set, will avoid including `EvictionHard` limits while computing Node Allocatable.
    // Refer to [Node Allocatable](https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable) 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
    // 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
    // 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
    // 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
    // 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
    // SeccompDefault enables the use of `RuntimeDefault` as the default seccomp profile for all workloads on the node.
    SeccompDefault bool
}

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

KubeletServer encapsulates all of the parameters necessary for starting up a kubelet. These can either be set via command line or directly.

type KubeletServer struct {
    KubeletFlags
    kubeletconfig.KubeletConfiguration
}

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