Documentation ¶
Overview ¶
Package runtime defines interfaces for accessing runtime specific settings, and state.
Index ¶
- Variables
- type APIServer
- type AdminKubeconfig
- type Bond
- type CNI
- type ClusterConfig
- type ClusterNetwork
- type ClusterState
- type Configurator
- type ConfiguratorBundle
- type Controller
- type ControllerManager
- type CoreDNS
- type Device
- type Disk
- type Env
- type Etcd
- type EventFatalSequencerError
- type EventSequenceStart
- type EventStream
- type ExtraHost
- type File
- type Install
- type Kubelet
- type Machine
- type MachineConfig
- type MachineNetwork
- type MachineState
- type MachineType
- type Mode
- type Partition
- type Phase
- type Platform
- type PodCheckpointer
- type Proxy
- type Publisher
- type Registries
- type RegistryAuthConfig
- type RegistryConfig
- type RegistryMirrorConfig
- type RegistryTLSConfig
- type Route
- type Runtime
- type Scheduler
- type Security
- type Sequence
- type Sequencer
- type State
- type TaskExecutionFunc
- type TaskSetupFunc
- type Time
- type Token
- type Vlan
- type WatchFunc
- type Watcher
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLocked indicates that the sequencer is currently locked, and processing // another sequence. ErrLocked = errors.New("locked") // ErrReboot indicates that a task is requesting a reboot. ErrReboot = errors.New("reboot") // ErrInvalidSequenceData indicates that the sequencer got data the wrong // data type for a sequence. ErrInvalidSequenceData = errors.New("invalid sequence data") // ErrUndefinedRuntime indicates that the sequencer's runtime is not defined. ErrUndefinedRuntime = errors.New("undefined runtime") )
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
APIServer defines the requirements for a config that pertains to apiserver related options.
type AdminKubeconfig ¶
AdminKubeconfig defines settings for admin kubeconfig.
type Bond ¶
type Bond struct { Interfaces []string `yaml:"interfaces"` ARPIPTarget []string `yaml:"arpIPTarget"` Mode string `yaml:"mode"` HashPolicy string `yaml:"xmitHashPolicy"` LACPRate string `yaml:"lacpRate"` ADActorSystem string `yaml:"adActorSystem"` ARPValidate string `yaml:"arpValidate"` ARPAllTargets string `yaml:"arpAllTargets"` Primary string `yaml:"primary"` PrimaryReselect string `yaml:"primaryReselect"` FailOverMac string `yaml:"failOverMac"` ADSelect string `yaml:"adSelect"` MIIMon uint32 `yaml:"miimon"` UpDelay uint32 `yaml:"updelay"` DownDelay uint32 `yaml:"downdelay"` ARPInterval uint32 `yaml:"arpInterval"` ResendIGMP uint32 `yaml:"resendIgmp"` MinLinks uint32 `yaml:"minLinks"` LPInterval uint32 `yaml:"lpInterval"` PacketsPerSlave uint32 `yaml:"packetsPerSlave"` NumPeerNotif uint8 `yaml:"numPeerNotif"` TLBDynamicLB uint8 `yaml:"tlbDynamicLb"` AllSlavesActive uint8 `yaml:"allSlavesActive"` UseCarrier bool `yaml:"useCarrier"` ADActorSysPrio uint16 `yaml:"adActorSysPrio"` ADUserPortKey uint16 `yaml:"adUserPortKey"` PeerNotifyDelay uint32 `yaml:"peerNotifyDelay"` }
Bond contains the various options for configuring a bonded interface.
type ClusterConfig ¶
type ClusterConfig interface { Name() string APIServer() APIServer ControllerManager() ControllerManager Proxy() Proxy Scheduler() Scheduler Endpoint() *url.URL Token() Token CertSANs() []string SetCertSANs([]string) CA() *x509.PEMEncodedCertificateAndKey AESCBCEncryptionSecret() string Config(MachineType) (string, error) Etcd() Etcd Network() ClusterNetwork LocalAPIServerPort() int PodCheckpointer() PodCheckpointer CoreDNS() CoreDNS ExtraManifestURLs() []string ExtraManifestHeaderMap() map[string]string AdminKubeconfig() AdminKubeconfig }
ClusterConfig defines the requirements for a config that pertains to cluster related options.
type ClusterNetwork ¶
type ClusterNetwork interface { CNI() CNI PodCIDR() string ServiceCIDR() string DNSDomain() string }
ClusterNetwork defines the requirements for a config that pertains to cluster network options.
type Configurator ¶
type Configurator interface { Version() string Debug() bool Persist() bool Machine() MachineConfig Cluster() ClusterConfig Validate(Mode) error String() (string, error) Bytes() ([]byte, error) }
Configurator defines the configuration interface.
type ConfiguratorBundle ¶
type ConfiguratorBundle interface { Init() Configurator ControlPlane() Configurator Join() Configurator TalosConfig() *config.Config }
ConfiguratorBundle defines the configuration bundle interface.
type Controller ¶
type Controller interface { Runtime() Runtime Sequencer() Sequencer Run(Sequence, interface{}) error }
Controller represents the controller responsible for managing the execution of sequences.
type ControllerManager ¶
ControllerManager defines the requirements for a config that pertains to controller manager related options.
type CoreDNS ¶
type CoreDNS interface {
Image() string
}
CoreDNS defines the requirements for a config that pertains to bootkube coredns options.
type Device ¶
type Device struct { Interface string `yaml:"interface"` CIDR string `yaml:"cidr"` Routes []Route `yaml:"routes"` Bond *Bond `yaml:"bond"` Vlans []*Vlan `yaml:"vlans"` MTU int `yaml:"mtu"` DHCP bool `yaml:"dhcp"` Ignore bool `yaml:"ignore"` }
Device represents a network interface.
type Disk ¶
type Disk struct { Device string `yaml:"device,omitempty"` Partitions []Partition `yaml:"partitions,omitempty"` }
Disk represents the options available for partitioning, formatting, and mounting extra disks.
type Etcd ¶
type Etcd interface { Image() string CA() *x509.PEMEncodedCertificateAndKey ExtraArgs() map[string]string }
Etcd defines the requirements for a config that pertains to etcd related options.
type EventFatalSequencerError ¶
EventFatalSequencerError represents a fatal sequencer error.
type EventSequenceStart ¶
type EventSequenceStart struct {
Sequence Sequence
}
EventSequenceStart represents the sequence start event.
type EventStream ¶
EventStream defines the runtime event stream.
type File ¶
type File struct { Content string `yaml:"content"` Permissions os.FileMode `yaml:"permissions"` Path string `yaml:"path"` Op string `yaml:"op"` }
File represents a file to write to disk.
type Install ¶
type Install interface { Image() string Disk() string ExtraKernelArgs() []string Zero() bool Force() bool WithBootloader() bool }
Install defines the requirements for a config that pertains to install related options.
type Kubelet ¶
Kubelet defines the requirements for a config that pertains to kubelet related options.
type Machine ¶
type Machine interface { State() MachineState Config() MachineConfig }
Machine defines the runtime parameters.
type MachineConfig ¶
type MachineConfig interface { Install() Install Security() Security Network() MachineNetwork Disks() []Disk Time() Time Env() Env Files() ([]File, error) Type() MachineType Kubelet() Kubelet Sysctls() map[string]string Registries() Registries }
MachineConfig defines the requirements for a config that pertains to machine related options.
type MachineNetwork ¶
type MachineNetwork interface { Hostname() string SetHostname(string) Resolvers() []string Devices() []Device ExtraHosts() []ExtraHost }
MachineNetwork defines the requirements for a config that pertains to network related options.
type MachineState ¶
type MachineState interface { Disk() *probe.ProbedBlockDevice Close() error Installed() bool }
MachineState defines the machined state.
type MachineType ¶
type MachineType int
MachineType represents a machine type.
const ( // MachineTypeInit represents a bootstrap node. MachineTypeInit MachineType = iota // MachineTypeControlPlane represents a control plane node. MachineTypeControlPlane // MachineTypeJoin represents a worker node. MachineTypeJoin )
func ParseMachineType ¶
func ParseMachineType(t string) (MachineType, error)
ParseMachineType parses string constant as Type
func (MachineType) String ¶
func (t MachineType) String() string
String returns the string representation of Type.
type Mode ¶
type Mode int
Mode is a runtime mode.
type Partition ¶
type Partition struct { Size uint `yaml:"size,omitempty"` MountPoint string `yaml:"mountpoint,omitempty"` }
Partition represents the options for a device partition.
type Phase ¶
type Phase []TaskSetupFunc
Phase represents a collection of tasks to be performed concurrently.
type Platform ¶
type Platform interface { Name() string Configuration() ([]byte, error) Hostname() ([]byte, error) Mode() Mode ExternalIPs() ([]net.IP, error) KernelArgs() procfs.Parameters }
Platform defines the requirements for a platform.
type PodCheckpointer ¶
type PodCheckpointer interface {
Image() string
}
PodCheckpointer defines the requirements for a config that pertains to bootkube pod-checkpointer options.
type Proxy ¶
type Proxy interface { // Mode indicates the proxy mode for kube-proxy. By default, this is `iptables`. Other options include `ipvs`. Mode() string // ExtraArgs describe an additional set of arguments to be supplied to the execution of `kube-proxy` ExtraArgs() map[string]string }
Proxy defines the requirements for a config that pertains to the kube-proxy options.
type Registries ¶
type Registries interface { // Mirror config by registry host (first part of image reference). Mirrors() map[string]RegistryMirrorConfig // Registry config (auth, TLS) by hostname. Config() map[string]RegistryConfig // ExtraFiles generates TOML config for containerd CRI plugin. ExtraFiles() ([]File, error) }
Registries defines the configuration for image fetching.
type RegistryAuthConfig ¶
type RegistryAuthConfig struct { // description: | // Optional registry authentication. // The meaning of each field is the same with the corresponding field in .docker/config.json. Username string `yaml:"username"` // description: | // Optional registry authentication. // The meaning of each field is the same with the corresponding field in .docker/config.json. Password string `yaml:"password"` // description: | // Optional registry authentication. // The meaning of each field is the same with the corresponding field in .docker/config.json. Auth string `yaml:"auth"` // description: | // Optional registry authentication. // The meaning of each field is the same with the corresponding field in .docker/config.json. IdentityToken string `yaml:"identityToken"` }
RegistryAuthConfig specifies authentication configuration for a registry.
type RegistryConfig ¶
type RegistryConfig struct { TLS *RegistryTLSConfig `yaml:"tls,omitempty"` Auth *RegistryAuthConfig `yaml:"auth,omitempty"` }
RegistryConfig specifies auth & TLS config per registry.
type RegistryMirrorConfig ¶
type RegistryMirrorConfig struct { // description: | // List of endpoints (URLs) for registry mirrors to use. // Endpoint configures HTTP/HTTPS access mode, host name, // port and path (if path is not set, it defaults to `/v2`). Endpoints []string `yaml:"endpoints"` }
RegistryMirrorConfig represents mirror configuration for a registry.
type RegistryTLSConfig ¶
type RegistryTLSConfig struct { // description: | // Enable mutual TLS authentication with the registry. // Client certificate and key should be base64-encoded. // examples: // - | // clientIdentity: // crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJIekNCMHF... // key: LS0tLS1CRUdJTiBFRDI1NTE5IFBSSVZBVEUgS0VZLS0tLS0KTUM... ClientIdentity *x509.PEMEncodedCertificateAndKey `yaml:"clientIdentity,omitempty"` // description: | // CA registry certificate to add the list of trusted certificates. // Certificate should be base64-encoded. CA []byte `yaml:"ca,omitempty"` // description: | // Skip TLS server certificate verification (not recommended). InsecureSkipVerify bool `yaml:"insecureSkipVerify,omitempty"` }
RegistryTLSConfig specifies TLS config for HTTPS registries.
func (*RegistryTLSConfig) GetTLSConfig ¶
func (cfg *RegistryTLSConfig) GetTLSConfig() (*tls.Config, error)
GetTLSConfig prepares TLS configuration for connection.
type Runtime ¶
type Runtime interface { Config() Configurator SetConfig([]byte) error State() State Events() EventStream }
Runtime defines the runtime parameters.
type Scheduler ¶
Scheduler defines the requirements for a config that pertains to scheduler related options.
type Security ¶
type Security interface { CA() *x509.PEMEncodedCertificateAndKey Token() string CertSANs() []string SetCertSANs([]string) }
Security defines the requirements for a config that pertains to security related options.
type Sequence ¶
type Sequence int
Sequence represents a sequence type.
const ( // SequenceBoot is the boot sequence. SequenceBoot Sequence = iota // SequenceBootstrap is the boot sequence. SequenceBootstrap // SequenceInitialize is the initialize sequence. SequenceInitialize // SequenceInstall is the install sequence. SequenceInstall // SequenceShutdown is the shutdown sequence. SequenceShutdown // SequenceUpgrade is the upgrade sequence. SequenceUpgrade // SequenceReset is the reset sequence. SequenceReset // SequenceReboot is the reboot sequence. SequenceReboot // SequenceRecover is the recover sequence. SequenceRecover // SequenceNoop is the noop sequence. SequenceNoop )
func ParseSequence ¶
ParseSequence returns a `Sequence` that matches the specified string.
nolint: gocyclo
type Sequencer ¶
type Sequencer interface { Boot(Runtime) []Phase Bootstrap(Runtime) []Phase Initialize(Runtime) []Phase Install(Runtime) []Phase Reboot(Runtime) []Phase Recover(Runtime, *machine.RecoverRequest) []Phase Reset(Runtime, *machine.ResetRequest) []Phase Shutdown(Runtime) []Phase Upgrade(Runtime, *machine.UpgradeRequest) []Phase }
Sequencer describes the set of sequences required for the lifecycle management of the operating system.
type State ¶
type State interface { Platform() Platform Machine() MachineState Cluster() ClusterState }
State defines the state.
type TaskExecutionFunc ¶
TaskExecutionFunc defines the function that a task will execute for a specific runtime mode.
type TaskSetupFunc ¶
type TaskSetupFunc func(seq Sequence, data interface{}) TaskExecutionFunc
TaskSetupFunc defines the function that a task will execute for a specific runtime mode.
type Time ¶
type Time interface {
Servers() []string
}
Time defines the requirements for a config that pertains to time related options.
type Token ¶
Token defines the requirements for a config that pertains to Kubernetes bootstrap token.
type Vlan ¶
type Vlan struct { CIDR string `ỳaml:"cidr"` Routes []Route `yaml:"routes"` DHCP bool `yaml:"dhcp"` ID uint16 `yaml:"vlanId"` }
Vlan represents vlan settings for a device
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package v1alpha1 implements a `Runtime`.
|
Package v1alpha1 implements a `Runtime`. |