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 an HTTP GET response.
Package config implements the pod configuration readers.
Index ¶
- Constants
- func NewSourceApiserver(c *clientset.Clientset, nodeName string, updates chan<- interface{})
- func NewSourceFile(path string, nodeName string, period time.Duration, updates chan<- interface{})
- func NewSourceURL(url string, header http.Header, nodeName string, period time.Duration, ...)
- type PodConfig
- type PodConfigNotificationMode
- type SourcesReady
- type SourcesReadyFn
Constants ¶
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 )
Variables ¶
This section is empty.
Functions ¶
func NewSourceApiserver ¶
NewSourceApiserver creates a config source that watches and pulls from the apiserver.
func NewSourceFile ¶
Types ¶
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 ¶
Channel creates or returns a config source channel. The channel only accepts PodUpdates
func (*PodConfig) SeenAllSources ¶
SeenAllSources returns true if seenSources contains all sources in the config, and also this config has received a SET message from each source.
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 ¶
SourcesReadyFn is function that returns true if the specified sources have been seen.