executor

package
v1.35.4-0...-e51c063 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotInitialized = errors.New("executor not initialized")
)

Functions

func APIServer

func APIServer(ctx context.Context, args []string) error

func APIServerHandlers

func APIServerHandlers(ctx context.Context) (authenticator.Request, http.Handler, error)

func APIServerReadyChan

func APIServerReadyChan() <-chan struct{}

func Bootstrap

func Bootstrap(ctx context.Context, nodeConfig *daemonconfig.Node, cfg cmds.Agent) error

func CNI

func CNI(ctx context.Context, wg *sync.WaitGroup, config *daemonconfig.Node) error

func CRI

func CRI(ctx context.Context, config *daemonconfig.Node) error

func CRIReadyChan

func CRIReadyChan() <-chan struct{}

func CloseIfNilErr

func CloseIfNilErr(err error, ch chan struct{}) error

func CloudControllerManager

func CloudControllerManager(ctx context.Context, ccmRBACReady <-chan struct{}, args []string) error

func Containerd

func Containerd(ctx context.Context, config *daemonconfig.Node) error

func ControllerManager

func ControllerManager(ctx context.Context, args []string) error

func Docker

func Docker(ctx context.Context, config *daemonconfig.Node) error

func ETCD

func ETCD(ctx context.Context, wg *sync.WaitGroup, args *ETCDConfig, extraArgs []string, test TestFunc) error

func ETCDReadyChan

func ETCDReadyChan() <-chan struct{}

func IsSelfHosted

func IsSelfHosted() bool

func KubeProxy

func KubeProxy(ctx context.Context, args []string) error

func Kubelet

func Kubelet(ctx context.Context, args []string) error

func Prepare

func Prepare(ctx context.Context, nodeConfig *daemonconfig.Node, cfg cmds.Agent) error

func Scheduler

func Scheduler(ctx context.Context, nodeReady <-chan struct{}, args []string) error

func Set

func Set(driver Executor)

Types

type ETCDConfig

type ETCDConfig struct {
	InitialOptions       `json:",inline"`
	Name                 string         `json:"name,omitempty"`
	ListenClientURLs     string         `json:"listen-client-urls,omitempty"`
	ListenClientHTTPURLs string         `json:"listen-client-http-urls,omitempty"`
	ListenMetricsURLs    string         `json:"listen-metrics-urls,omitempty"`
	ListenPeerURLs       string         `json:"listen-peer-urls,omitempty"`
	AdvertiseClientURLs  string         `json:"advertise-client-urls,omitempty"`
	DataDir              string         `json:"data-dir,omitempty"`
	SnapshotCount        int            `json:"snapshot-count,omitempty"`
	ServerTrust          ServerTrust    `json:"client-transport-security"`
	PeerTrust            PeerTrust      `json:"peer-transport-security"`
	ForceNewCluster      bool           `json:"force-new-cluster,omitempty"`
	HeartbeatInterval    int            `json:"heartbeat-interval"`
	ElectionTimeout      int            `json:"election-timeout"`
	Logger               string         `json:"logger"`
	LogOutputs           []string       `json:"log-outputs"`
	SocketOpts           ETCDSocketOpts `json:"socket-options"`

	ExperimentalInitialCorruptCheck         bool          `json:"experimental-initial-corrupt-check"`
	ExperimentalWatchProgressNotifyInterval time.Duration `json:"experimental-watch-progress-notify-interval"`
}

func (ETCDConfig) ToConfigFile

func (e ETCDConfig) ToConfigFile(extraArgs []string) (string, error)

type ETCDSocketOpts

type ETCDSocketOpts struct {
	ReuseAddress bool `json:"reuse-address,omitempty"`
	ReusePort    bool `json:"reuse-port,omitempty"`
}

type Executor

type Executor interface {
	Bootstrap(ctx context.Context, nodeConfig *daemonconfig.Node, cfg cmds.Agent) error
	Kubelet(ctx context.Context, args []string) error
	KubeProxy(ctx context.Context, args []string) error
	APIServerHandlers(ctx context.Context) (authenticator.Request, http.Handler, error)
	APIServer(ctx context.Context, args []string) error
	Scheduler(ctx context.Context, nodeReady <-chan struct{}, args []string) error
	ControllerManager(ctx context.Context, args []string) error
	CurrentETCDOptions() (InitialOptions, error)
	ETCD(ctx context.Context, wg *sync.WaitGroup, args *ETCDConfig, extraArgs []string, test TestFunc) error
	CloudControllerManager(ctx context.Context, ccmRBACReady <-chan struct{}, args []string) error
	Containerd(ctx context.Context, node *daemonconfig.Node) error
	Docker(ctx context.Context, node *daemonconfig.Node) error
	CRI(ctx context.Context, node *daemonconfig.Node) error
	CNI(ctx context.Context, wg *sync.WaitGroup, node *daemonconfig.Node) error
	APIServerReadyChan() <-chan struct{}
	ETCDReadyChan() <-chan struct{}
	CRIReadyChan() <-chan struct{}
	IsSelfHosted() bool
}

Executor is a set of functions for bootstrapping a node and starting the CRI, CNI, and Kubernetes components

func Get

func Get() Executor

type InitialOptions

type InitialOptions struct {
	AdvertisePeerURL string `json:"initial-advertise-peer-urls,omitempty"`
	Cluster          string `json:"initial-cluster,omitempty"`
	State            string `json:"initial-cluster-state,omitempty"`
}

func CurrentETCDOptions

func CurrentETCDOptions() (InitialOptions, error)

type PeerTrust

type PeerTrust struct {
	CertFile       string `json:"cert-file"`
	KeyFile        string `json:"key-file"`
	ClientCertAuth bool   `json:"client-cert-auth"`
	TrustedCAFile  string `json:"trusted-ca-file"`
}

type PreparingExecutor

type PreparingExecutor interface {
	Prepare(ctx context.Context, nodeConfig *daemonconfig.Node, cfg cmds.Agent) error
}

PreparingExecutor is an optional interface that Executors may implement to modify node configuration and CLI flags before config is retrieved from the server.

type ServerTrust

type ServerTrust struct {
	CertFile       string `json:"cert-file"`
	KeyFile        string `json:"key-file"`
	ClientCertAuth bool   `json:"client-cert-auth"`
	TrustedCAFile  string `json:"trusted-ca-file"`
}

type TestFunc

type TestFunc func(ctx context.Context, enableMaintenance bool) error

TestFunc is the signature of a function that returns nil error when the component is ready. The enableMaintenance flag enables attempts to perform corrective maintenance during the test process.

Jump to

Keyboard shortcuts

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