core

package
v0.0.0-...-97303f7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	State state.State
	// contains filtered or unexported fields
}

Core is responsible for maintaining state information of the VM-agent. Currently we do not need any state.

func NewCore

func NewCore(zapLogger *zap.Logger, loadbalancerIP string) (*Core, error)

NewCore creates and initializes a new Core object.

func (*Core) ConnectToKubernetes

func (c *Core) ConnectToKubernetes() error

ConnectToKubernetes connects to the Kubernetes API server.

func (*Core) GetControlPlaneCertificatesAndKeys

func (c *Core) GetControlPlaneCertificatesAndKeys() (map[string][]byte, error)

GetControlPlaneCertificatesAndKeys loads the Kubernetes CA certificates and keys.

func (*Core) GetJoinToken

func (c *Core) GetJoinToken(ttl time.Duration) (*kubeadm.BootstrapTokenDiscovery, error)

GetJoinToken creates a new bootstrap (join) token, which a node can use to join the cluster.

func (*Core) IsInReadyState

func (c *Core) IsInReadyState() bool

IsInReadyState returns true if the Core is in a ready state.

func (*Core) IsReadyForInit

func (c *Core) IsReadyForInit() bool

IsReadyForInit returns true if the Core is in a ready state.

func (*Core) JoinCluster

func (c *Core) JoinCluster(ctx context.Context) error

JoinCluster joins the Kube Cluster. TODO: Authentication checks.

func (*Core) SetInitialized

func (c *Core) SetInitialized()

func (*Core) SetJoiningCluster

func (c *Core) SetJoiningCluster()

SetJoiningCluster returns true if the Core is in a ready state.

func (*Core) TryJoinCluster

func (c *Core) TryJoinCluster(ctx context.Context)

TryJoinCluster tries to join the cluster every 5 seconds until it succeeds.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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