config

package
v1.10.5-lite2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2018 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Overview

Reads the pod configuration from the Kubernetes apiserver.

Common logic used by both http and file channels.

Package config implements the pod configuration readers.

Reads the pod configuration from file or a directory of files.

Reads the pod configuration from file or a directory of files.

Reads the pod configuration from an HTTP GET response.

Package config implements the pod configuration readers.

Index

Constants

View Source
const (
	// PodConfigNotificationUnknown is the default value for
	// PodConfigNotificationMode when uninitialized.
	PodConfigNotificationUnknown = iota
	// PodConfigNotificationSnapshot delivers the full configuration as a SET whenever
	// any change occurs.
	PodConfigNotificationSnapshot
	// PodConfigNotificationSnapshotAndUpdates delivers an UPDATE and DELETE message whenever pods are
	// changed, and a SET message if there are any additions or removals.
	PodConfigNotificationSnapshotAndUpdates
	// PodConfigNotificationIncremental delivers ADD, UPDATE, DELETE, REMOVE, RECONCILE to the update channel.
	PodConfigNotificationIncremental
)
View Source
const (
	DefaultKubeletPodsDirName             = "pods"
	DefaultKubeletVolumesDirName          = "volumes"
	DefaultKubeletVolumeDevicesDirName    = "volumeDevices"
	DefaultKubeletPluginsDirName          = "plugins"
	DefaultKubeletContainersDirName       = "containers"
	DefaultKubeletPluginContainersDirName = "plugin-containers"
)

Variables

This section is empty.

Functions

func NewSourceApiserver

func NewSourceApiserver(c clientset.Interface, nodeName types.NodeName, updates chan<- interface{})

NewSourceApiserver creates a config source that watches and pulls from the apiserver.

func NewSourceFile

func NewSourceFile(path string, nodeName types.NodeName, period time.Duration, updates chan<- interface{})

func NewSourceURL

func NewSourceURL(url string, header http.Header, nodeName types.NodeName, period time.Duration, updates chan<- interface{})

Types

type ContainerRuntimeOptions

type ContainerRuntimeOptions struct {

	// ContainerRuntime is the container runtime to use.
	ContainerRuntime string
	// RuntimeCgroups that container runtime is expected to be isolated in.
	RuntimeCgroups string

	// 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
	// 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
	// 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 (*ContainerRuntimeOptions) AddFlags

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

type PodConfig

type PodConfig struct {
	// contains filtered or unexported fields
}

PodConfig is a configuration mux that merges many sources of pod configuration into a single consistent structure, and then delivers incremental change notifications to listeners in order.

func NewPodConfig

func NewPodConfig(mode PodConfigNotificationMode, recorder record.EventRecorder) *PodConfig

NewPodConfig creates an object that can merge many configuration sources into a stream of normalized updates to a pod configuration.

func (*PodConfig) Channel

func (c *PodConfig) Channel(source string) chan<- interface{}

Channel creates or returns a config source channel. The channel only accepts PodUpdates

func (*PodConfig) Restore

func (c *PodConfig) Restore(path string, updates chan<- interface{}) error

Restore restores pods from the checkpoint path, *once*

func (*PodConfig) SeenAllSources

func (c *PodConfig) SeenAllSources(seenSources sets.String) bool

SeenAllSources returns true if seenSources contains all sources in the config, and also this config has received a SET message from each source.

func (*PodConfig) Sync

func (c *PodConfig) Sync()

Sync requests the full configuration be delivered to the update channel.

func (*PodConfig) Updates

func (c *PodConfig) Updates() <-chan kubetypes.PodUpdate

Updates returns a channel of updates to the configuration, properly denormalized.

type PodConfigNotificationMode

type PodConfigNotificationMode int

PodConfigNotificationMode describes how changes are sent to the update channel.

type SourcesReady

type SourcesReady interface {
	// AddSource adds the specified source to the set of sources managed.
	AddSource(source string)
	// AllReady returns true if the currently configured sources have all been seen.
	AllReady() bool
}

SourcesReady tracks the set of configured sources seen by the kubelet.

func NewSourcesReady

func NewSourcesReady(sourcesReadyFn SourcesReadyFn) SourcesReady

NewSourcesReady returns a SourcesReady with the specified function.

type SourcesReadyFn

type SourcesReadyFn func(sourcesSeen sets.String) bool

SourcesReadyFn is function that returns true if the specified sources have been seen.

Jump to

Keyboard shortcuts

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