clusterplugin

package
v0.0.0-...-e169fab Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RoleInit denotes a special `RoleControlPlane` that can run special tasks to initialize the cluster.  There will only ever be one node with this role in a cluster.
	RoleInit = "init"

	// RoleControlPlane denotes nodes that persist cluster information and host the kubernetes control plane
	RoleControlPlane = "controlplane"

	// RoleWorker denotes a node that runs workloads in the cluster
	RoleWorker = "worker"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// ClusterToken is a unique string that can be used to distinguish different clusters on networks with multiple clusters
	ClusterToken string `yaml:"cluster_token,omitempty"`

	// ControlPlaneHost is a host that all nodes can resolve and use for node registration
	ControlPlaneHost string `yaml:"control_plane_host,omitempty"`

	// Role informs the sdk what kind of installation to manage on this device
	Role Role `yaml:"role,omitempty"`

	// Options are arbitrary values the sdk may be interested in.  These values are not validated by C3OS and are simply forwarded to the sdk
	Options string `yaml:"config,omitempty"`
}

type ClusterPlugin

type ClusterPlugin struct {
	Provider ClusterProvider
}

ClusterPlugin creates a cluster plugin from a `ClusterProvider`. It calls the cluster provider at the appropriate events and ensures it configuration is written where it will be executed.

func (ClusterPlugin) Run

func (p ClusterPlugin) Run() error

type ClusterProvider

type ClusterProvider func(cluster Cluster) yip.YipConfig

ClusterProvider returns a yip configuration that configures a Kubernetes engine. The yip config may use any elemental stages after initramfs.

type Config

type Config struct {
	Cluster *Cluster `yaml:"cluster,omitempty"`
}

type Role

type Role string

func (*Role) MarshalYAML

func (n *Role) MarshalYAML() (interface{}, error)

func (*Role) UnmarshalYAML

func (n *Role) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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