kubernetes: k8s.io/kubernetes/pkg/kubelet/kubeletconfig Index | Files | Directories

package kubeletconfig

import "k8s.io/kubernetes/pkg/kubelet/kubeletconfig"


Package Files

configsync.go controller.go watch.go


const (
    // KubeletConfigChangedEventReason identifies an event as a change of Kubelet configuration
    KubeletConfigChangedEventReason = "KubeletConfigChanged"
    // LocalEventMessage is sent when the Kubelet restarts to use local config
    LocalEventMessage = "Kubelet restarting to use local config"
    // RemoteEventMessageFmt is sent when the Kubelet restarts to use a remote config
    RemoteEventMessageFmt = "Kubelet restarting to use %s, UID: %s, ResourceVersion: %s, KubeletConfigKey: %s"

type Controller Uses

type Controller struct {
    // contains filtered or unexported fields

Controller manages syncing dynamic Kubelet configurations For more information, see the proposal: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/dynamic-kubelet-configuration.md

func NewController Uses

func NewController(dynamicConfigDir string, transform TransformFunc) *Controller

NewController constructs a new Controller object and returns it. The dynamicConfigDir path must be absolute. transform applies an arbitrary transformation to config after loading, and before validation. This can be used, for example, to include config from flags before the controller's validation step. If transform returns an error, loadConfig will fail, and an InternalError will be reported. Be wary if using this function as an extension point, in most cases the controller should probably just be natively extended to do what you need. Injecting flag precedence transformations is something of an exception because the caller of this controller (cmd/) is aware of flags, but this controller's tree (pkg/) is not.

func (*Controller) Bootstrap Uses

func (cc *Controller) Bootstrap() (*kubeletconfig.KubeletConfiguration, error)

Bootstrap attempts to return a valid KubeletConfiguration based on the configuration of the Controller, or returns an error if no valid configuration could be produced. Bootstrap should be called synchronously before StartSync. If the pre-existing local configuration should be used, Bootstrap returns a nil config.

func (*Controller) StartSync Uses

func (cc *Controller) StartSync(client clientset.Interface, eventClient v1core.EventsGetter, nodeName string) error

StartSync tells the controller to start the goroutines that sync status/config to/from the API server. The clients must be non-nil, and the nodeName must be non-empty.

type TransformFunc Uses

type TransformFunc func(kc *kubeletconfig.KubeletConfiguration) error

TransformFunc edits the KubeletConfiguration in-place, and returns an error if any of the transformations failed.



Package kubeletconfig imports 24 packages (graph) and is imported by 10 packages. Updated 2021-01-26. Refresh now. Tools for package owners.