cluster

package
v0.0.0-...-f4dfa5d Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RotateBootstrapToken

func RotateBootstrapToken(ctx context.Context, config *config.Control, oldToken string) error

func Save

func Save(ctx context.Context, config *config.Control, 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 {
	// 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

func (c *Cluster) Bootstrap(ctx context.Context, clusterReset 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

func (c *Cluster) ReconcileBootstrapData(ctx context.Context, buf io.ReadSeeker, crb *config.ControlRuntimeBootstrap, isHTTP bool) 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) 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