options

package
v1.7.7-beta.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: Apache-2.0 Imports: 13 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

This section is empty.

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

	// If true, an invalid KubeConfig will result in the Kubelet exiting with an error.
	RequireKubeConfig bool
	APIServerList     []string // Deprecated -- use KubeConfig instead

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

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 (*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
	componentconfig.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

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