options

package
v1.8.1-rancher1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	DefaultKubeletPodsDirName       = "pods"
	DefaultKubeletVolumesDirName    = "volumes"
	DefaultKubeletPluginsDirName    = "plugins"
	DefaultKubeletContainersDirName = "containers"
)

Variables

This section is empty.

Functions

func AddKubeletConfigFlags added in v1.8.0

func AddKubeletConfigFlags(fs *pflag.FlagSet, c *kubeletconfig.KubeletConfiguration)

AddKubeletConfigFlags adds flags for a specific kubeletconfig.KubeletConfiguration to the specified FlagSet

func NewKubeletConfiguration added in v1.8.0

func NewKubeletConfiguration() (*kubeletconfig.KubeletConfiguration, error)

NewKubeletConfiguration will create a new KubeletConfiguration with default values

func ValidateKubeletFlags added in v1.8.0

func ValidateKubeletFlags(f *KubeletFlags) error

func ValidateKubeletServer added in v1.8.0

func ValidateKubeletServer(s *KubeletServer) error

validateKubeletServer validates configuration of KubeletServer and returns an error if the input configuration is invalid

Types

type ContainerRuntimeOptions added in v1.7.0

type ContainerRuntimeOptions struct {

	// DockershimRootDirectory is the path to the dockershim root directory. Defaults to
	// /var/lib/dockershim if unset. Exposed for integration testing (e.g. in OpenShift).
	DockershimRootDirectory string
	// Enable dockershim only mode.
	ExperimentalDockershim bool
	// This flag, if set, disables use of a shared PID namespace for pods running in the docker CRI runtime.
	// A shared PID namespace is the only option in non-docker runtimes and is required by the CRI. The ability to
	// disable it for docker will be removed unless a compelling use case is discovered with widespread use.
	// TODO: Remove once we no longer support disabling shared PID namespace (https://issues.k8s.io/41938)
	DockerDisableSharedPID bool
	// PodSandboxImage is the image whose network/ipc namespaces
	// containers in each pod will use.
	PodSandboxImage string
	// DockerEndpoint is the path to the docker endpoint to communicate with.
	DockerEndpoint string
	// DockerExecHandlerName is the handler to use when executing a command
	// in a container. Valid values are 'native' and 'nsenter'. Defaults to
	// 'native'.
	DockerExecHandlerName string
	// If no pulling progress is made before the deadline imagePullProgressDeadline,
	// the image pulling will be cancelled. Defaults to 1m0s.
	// +optional
	ImagePullProgressDeadline metav1.Duration

	// networkPluginName is the name of the network plugin to be invoked for
	// various events in kubelet/pod lifecycle
	NetworkPluginName string
	// NetworkPluginMTU is the MTU to be passed to the network plugin,
	// and overrides the default MTU for cases where it cannot be automatically
	// computed (such as IPSEC).
	NetworkPluginMTU int32
	// NetworkPluginDir is the full path of the directory in which to search
	// for network plugins (and, for backwards-compat, CNI config files)
	NetworkPluginDir string
	// CNIConfDir is the full path of the directory in which to search for
	// CNI config files
	CNIConfDir string
	// CNIBinDir is the full path of the directory in which to search for
	// CNI plugin binaries
	CNIBinDir string

	// rktPath is the path of rkt binary. Leave empty to use the first rkt in $PATH.
	RktPath string
	// rktApiEndpoint is the endpoint of the rkt API service to communicate with.
	RktAPIEndpoint string
	// rktStage1Image is the image to use as stage1. Local paths and
	// http/https URLs are supported.
	RktStage1Image string
}

func NewContainerRuntimeOptions added in v1.7.0

func NewContainerRuntimeOptions() *ContainerRuntimeOptions

NewContainerRuntimeOptions will create a new ContainerRuntimeOptions with default values.

func (*ContainerRuntimeOptions) AddFlags added in v1.7.0

func (s *ContainerRuntimeOptions) AddFlags(fs *pflag.FlagSet)

type KubeletFlags added in v1.7.0

type KubeletFlags struct {
	KubeConfig          flag.StringFlag
	BootstrapKubeconfig string
	RotateCertificates  bool

	// RequireKubeConfig is deprecated! A valid KubeConfig is now required if --kubeconfig is provided.
	RequireKubeConfig bool

	// 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 the local manifest, and exit.
	RunOnce 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.
	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 flag.StringFlag

	// The Kubelet will look in this directory for an init configuration.
	// 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.
	// To use this flag, the DynamicKubeletConfig feature gate must be enabled.
	InitConfigDir flag.StringFlag
}

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
  • 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 added in v1.8.0

func NewKubeletFlags() *KubeletFlags

NewKubeletFlags will create a new KubeletFlags with default values

func (*KubeletFlags) AddFlags added in v1.7.0

func (f *KubeletFlags) AddFlags(fs *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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL