cluster

package
v1.21.9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save added in v1.21.9

func Save(ctx context.Context, config *config.Control, etcdConfig endpoint.ETCDConfig, override bool) error

Save writes the current ControlRuntimeBootstrap data to the datastore. This contains a complete snapshot of the cluster's CA certs and keys, encryption passphrases, etc - encrypted with the join token. This is used when bootstrapping a cluster from a managed database or external etcd cluster. This is NOT used with embedded etcd, which bootstraps over HTTP.

Types

type Cluster

type Cluster struct {
	EtcdConfig endpoint.ETCDConfig
	// contains filtered or unexported fields
}

func New

func New(config *config.Control) *Cluster

New creates an initial cluster using the provided configuration.

func (*Cluster) Bootstrap added in v1.21.9

func (c *Cluster) Bootstrap(ctx context.Context, snapshot bool) error

Bootstrap attempts to load a managed database driver, if one has been initialized or should be created/joined. It then checks to see if the cluster needs to load bootstrap data, and if so, loads data into the ControlRuntimeBoostrap struct, either via HTTP or from the datastore.

func (*Cluster) ReconcileBootstrapData added in v1.21.9

func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker, crb *config.ControlRuntimeBootstrap, isHTTP bool, ec *endpoint.ETCDConfig) error

ReconcileBootstrapData is called before any data is saved to the datastore or locally. It checks to see if the contents of the bootstrap data in the datastore is newer than on disk or different and depending on where the difference is. If the datastore is newer, then the data will be written to disk. If the data on disk is newer, k3s will exit with an error.

func (*Cluster) Snapshot added in v1.21.9

func (c *Cluster) Snapshot(ctx context.Context, config *config.Control) error

Snapshot is a proxy method to call the snapshot method on the managedb interface for etcd clusters.

func (*Cluster) Start

func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error)

Start creates the dynamic tls listener, http request handler, handles starting and writing/reading bootstrap data, and returns a channel that will be closed when datastore is ready. If embedded etcd is in use, a secondary call to Cluster.save is made.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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