controllers

package
v1.8.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MPL-2.0 Imports: 97 Imported by: 0

Documentation

Overview

Package controllers contains stripped versions of Talos controllers.

Index

Constants

View Source
const KubernetesCertificateValidityDuration = constants.KubernetesDefaultCertificateValidityDuration

KubernetesCertificateValidityDuration is the validity duration for the certificates created with this controller.

Controller automatically refreshes certs at 50% of CertificateValidityDuration.

Variables

This section is empty.

Functions

func FindLink(links []rtnetlink.LinkMessage, name string) *rtnetlink.LinkMessage

FindLink looks up the link in the list of the links from rtnetlink.

func FromHostname

func FromHostname(hostname string) (string, error)

FromHostname converts a hostname to Kubernetes Node name.

UNIX hostname has almost no restrictions, but Kubernetes Node name has to be RFC 1123 compliant. This function converts a hostname to a valid Kubernetes Node name (if possible).

The allowed format is:

[a-z0-9]([-a-z0-9]*[a-z0-9])?

func GenerateRandomNodeAddr

func GenerateRandomNodeAddr(prefix netip.Prefix) (netip.Prefix, error)

GenerateRandomNodeAddr generates a random node address within the last 8 bytes of the given prefix.

func WireguardSpec

func WireguardSpec(r *network.WireguardSpec) wireguardSpec

WireguardSpec adapter provides encoding/decoding to netlink structures.

Types

type APICertSANsController

type APICertSANsController struct{}

APICertSANsController manages secrets.APICertSANs based on configuration.

func (*APICertSANsController) Inputs

func (ctrl *APICertSANsController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*APICertSANsController) Name

func (ctrl *APICertSANsController) Name() string

Name implements controller.Controller interface.

func (*APICertSANsController) Outputs

func (ctrl *APICertSANsController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*APICertSANsController) Run

Run implements controller.Controller interface.

type APIDController

type APIDController struct {
	APID *services.APID
	// contains filtered or unexported fields
}

APIDController interacts with SideroLink API and brings up the SideroLink Wireguard interface.

func (*APIDController) Inputs

func (ctrl *APIDController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*APIDController) Name

func (ctrl *APIDController) Name() string

Name implements controller.Controller interface.

func (*APIDController) Outputs

func (ctrl *APIDController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*APIDController) Run

func (ctrl *APIDController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type AddressSpecController

type AddressSpecController struct{}

AddressSpecController applies network.AddressSpec to the actual interfaces.

func (*AddressSpecController) Inputs

func (ctrl *AddressSpecController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*AddressSpecController) Name

func (ctrl *AddressSpecController) Name() string

Name implements controller.Controller interface.

func (*AddressSpecController) Outputs

func (ctrl *AddressSpecController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*AddressSpecController) Run

Run implements controller.Controller interface.

type AffiliateMergeController

type AffiliateMergeController struct{}

AffiliateMergeController merges raw Affiliates from the RawNamespaceName into final representation in the NamespaceName.

func (*AffiliateMergeController) Inputs

func (ctrl *AffiliateMergeController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*AffiliateMergeController) Name

func (ctrl *AffiliateMergeController) Name() string

Name implements controller.Controller interface.

func (*AffiliateMergeController) Outputs

func (ctrl *AffiliateMergeController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*AffiliateMergeController) Run

Run implements controller.Controller interface.

type ConfigController

type ConfigController = transform.Controller[*config.MachineConfig, *cluster.Config]

ConfigController watches v1alpha1.Config, updates discovery config.

func NewClusterConfigController

func NewClusterConfigController() *ConfigController

NewClusterConfigController instanciates the config controller.

type DiscoveryServiceController

type DiscoveryServiceController struct {
	// contains filtered or unexported fields
}

DiscoveryServiceController pushes Affiliate resource to the Kubernetes registry.

func (*DiscoveryServiceController) Inputs

func (ctrl *DiscoveryServiceController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*DiscoveryServiceController) Name

func (ctrl *DiscoveryServiceController) Name() string

Name implements controller.Controller interface.

func (*DiscoveryServiceController) Outputs

func (ctrl *DiscoveryServiceController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*DiscoveryServiceController) Run

Run implements controller.Controller interface.

type EtcdController

type EtcdController struct {
	GlobalState state.State
	MachineID   string
}

EtcdController generates node identity.

func (*EtcdController) Inputs

func (ctrl *EtcdController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*EtcdController) Name

func (ctrl *EtcdController) Name() string

Name implements controller.Controller interface.

func (*EtcdController) Outputs

func (ctrl *EtcdController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*EtcdController) Run

func (ctrl *EtcdController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type ExtensionStatusController

type ExtensionStatusController struct{}

ExtensionStatusController computes extensions list from the configuration. Updates machine status resource.

func (*ExtensionStatusController) Inputs

func (ctrl *ExtensionStatusController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*ExtensionStatusController) Name

func (ctrl *ExtensionStatusController) Name() string

Name implements controller.Controller interface.

func (*ExtensionStatusController) Outputs

func (ctrl *ExtensionStatusController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*ExtensionStatusController) Run

Run implements controller.Controller interface.

type GRPCTLSController

type GRPCTLSController struct{}

GRPCTLSController manages secrets.API based on configuration to provide apid certificate.

func (*GRPCTLSController) Inputs

func (ctrl *GRPCTLSController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*GRPCTLSController) Name

func (ctrl *GRPCTLSController) Name() string

Name implements controller.Controller interface.

func (*GRPCTLSController) Outputs

func (ctrl *GRPCTLSController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*GRPCTLSController) Run

func (ctrl *GRPCTLSController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type HostnameConfigController

type HostnameConfigController struct {
	MachineID string
}

HostnameConfigController manages network.HostnameSpec based on machine configuration, kernel cmdline.

func (*HostnameConfigController) Inputs

func (ctrl *HostnameConfigController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*HostnameConfigController) Name

func (ctrl *HostnameConfigController) Name() string

Name implements controller.Controller interface.

func (*HostnameConfigController) Outputs

func (ctrl *HostnameConfigController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*HostnameConfigController) Run

Run implements controller.Controller interface.

type HostnameMergeController

type HostnameMergeController struct{}

HostnameMergeController merges network.HostnameSpec in network.ConfigNamespace and produces final network.HostnameSpec in network.Namespace.

func (*HostnameMergeController) Inputs

func (ctrl *HostnameMergeController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*HostnameMergeController) Name

func (ctrl *HostnameMergeController) Name() string

Name implements controller.Controller interface.

func (*HostnameMergeController) Outputs

func (ctrl *HostnameMergeController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*HostnameMergeController) Run

Run implements controller.Controller interface.

type HostnameSpecController

type HostnameSpecController struct {
	GlobalState state.State
	MachineID   string
}

HostnameSpecController applies network.HostnameSpec to the actual interfaces.

func (*HostnameSpecController) Inputs

func (ctrl *HostnameSpecController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*HostnameSpecController) Name

func (ctrl *HostnameSpecController) Name() string

Name implements controller.Controller interface.

func (*HostnameSpecController) Outputs

func (ctrl *HostnameSpecController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*HostnameSpecController) Run

Run implements controller.Controller interface.

type KubeconfigController

type KubeconfigController struct {
	GlobalState state.State
}

KubeconfigController saves admin kubeconfig to the global emulator state in the cluster resource.

func (*KubeconfigController) Inputs

func (ctrl *KubeconfigController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubeconfigController) Name

func (ctrl *KubeconfigController) Name() string

Name implements controller.Controller interface.

func (*KubeconfigController) Outputs

func (ctrl *KubeconfigController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubeconfigController) Run

Run implements controller.Controller interface.

type KubernetesCertSANsController

type KubernetesCertSANsController struct{}

KubernetesCertSANsController manages secrets.KubernetesCertSANs based on configuration.

func (*KubernetesCertSANsController) Inputs

Inputs implements controller.Controller interface.

func (*KubernetesCertSANsController) Name

func (ctrl *KubernetesCertSANsController) Name() string

Name implements controller.Controller interface.

func (*KubernetesCertSANsController) Outputs

Outputs implements controller.Controller interface.

func (*KubernetesCertSANsController) Run

Run implements controller.Controller interface.

type KubernetesController

type KubernetesController struct {
	Kubernetes *kubefactory.Kubernetes
	MachineID  string
	// contains filtered or unexported fields
}

KubernetesController interacts with SideroLink API and brings up the SideroLink Wireguard interface.

func (*KubernetesController) Inputs

func (ctrl *KubernetesController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubernetesController) Name

func (ctrl *KubernetesController) Name() string

Name implements controller.Controller interface.

func (*KubernetesController) Outputs

func (ctrl *KubernetesController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubernetesController) Run

Run implements controller.Controller interface.

type KubernetesDynamicCertsController

type KubernetesDynamicCertsController struct{}

KubernetesDynamicCertsController manages secrets.KubernetesDynamicCerts based on configuration.

func (*KubernetesDynamicCertsController) Inputs

Inputs implements controller.Controller interface.

func (*KubernetesDynamicCertsController) Name

Name implements controller.Controller interface.

func (*KubernetesDynamicCertsController) Outputs

Outputs implements controller.Controller interface.

func (*KubernetesDynamicCertsController) Run

Run implements controller.Controller interface.

type KubernetesNodeController

type KubernetesNodeController struct {
	GlobalState state.State

	MachineID string
	// contains filtered or unexported fields
}

KubernetesNodeController registers machine in the kubernetes state.

func (*KubernetesNodeController) Inputs

func (ctrl *KubernetesNodeController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubernetesNodeController) Name

func (ctrl *KubernetesNodeController) Name() string

Name implements controller.Controller interface.

func (*KubernetesNodeController) Outputs

func (ctrl *KubernetesNodeController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubernetesNodeController) Run

Run implements controller.Controller interface.

type KubernetesSecretsController

type KubernetesSecretsController struct{}

KubernetesSecretsController manages secrets.Kubernetes based on configuration.

func (*KubernetesSecretsController) Inputs

func (ctrl *KubernetesSecretsController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*KubernetesSecretsController) Name

func (ctrl *KubernetesSecretsController) Name() string

Name implements controller.Controller interface.

func (*KubernetesSecretsController) Outputs

func (ctrl *KubernetesSecretsController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*KubernetesSecretsController) Run

Run implements controller.Controller interface.

type LinkSpecController

type LinkSpecController struct{}

LinkSpecController applies network.LinkSpec to the actual interfaces.

func (*LinkSpecController) Inputs

func (ctrl *LinkSpecController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*LinkSpecController) Name

func (ctrl *LinkSpecController) Name() string

Name implements controller.Controller interface.

func (*LinkSpecController) Outputs

func (ctrl *LinkSpecController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*LinkSpecController) Run

func (ctrl *LinkSpecController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type LinkStatusController

type LinkStatusController struct{}

LinkStatusController manages secrets.Etcd based on configuration.

func (*LinkStatusController) Inputs

func (ctrl *LinkStatusController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*LinkStatusController) Name

func (ctrl *LinkStatusController) Name() string

Name implements controller.Controller interface.

func (*LinkStatusController) Outputs

func (ctrl *LinkStatusController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*LinkStatusController) Run

Run implements controller.Controller interface.

type LocalAffiliateController

type LocalAffiliateController struct{}

LocalAffiliateController builds Affiliate resource for the local node.

func (*LocalAffiliateController) Inputs

func (ctrl *LocalAffiliateController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*LocalAffiliateController) Name

func (ctrl *LocalAffiliateController) Name() string

Name implements controller.Controller interface.

func (*LocalAffiliateController) Outputs

func (ctrl *LocalAffiliateController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*LocalAffiliateController) Run

Run implements controller.Controller interface.

type LogSinkController

type LogSinkController struct {
	LogSink *logging.ZapCore
}

LogSinkController configures log sink.

func (*LogSinkController) Inputs

func (ctrl *LogSinkController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*LogSinkController) Name

func (ctrl *LogSinkController) Name() string

Name implements controller.Controller interface.

func (*LogSinkController) Outputs

func (ctrl *LogSinkController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*LogSinkController) Run

Run implements controller.Controller interface.

type MachineStatusController

type MachineStatusController struct {
	State state.State
}

MachineStatusController computes machine state from the existing resources. Updates machine status resource.

func (*MachineStatusController) Inputs

func (ctrl *MachineStatusController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*MachineStatusController) Name

func (ctrl *MachineStatusController) Name() string

Name implements controller.Controller interface.

func (*MachineStatusController) Outputs

func (ctrl *MachineStatusController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*MachineStatusController) Run

Run implements controller.Controller interface.

type MachineTypeController

type MachineTypeController struct{}

MachineTypeController manages config.MachineType based on configuration.

func (*MachineTypeController) Inputs

func (ctrl *MachineTypeController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*MachineTypeController) Name

func (ctrl *MachineTypeController) Name() string

Name implements controller.Controller interface.

func (*MachineTypeController) Outputs

func (ctrl *MachineTypeController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*MachineTypeController) Run

Run implements controller.Controller interface.

type ManagerController

type ManagerController struct {
	MachineIndex int
	// contains filtered or unexported fields
}

ManagerController interacts with SideroLink API and brings up the SideroLink Wireguard interface.

func (*ManagerController) Inputs

func (ctrl *ManagerController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*ManagerController) Name

func (ctrl *ManagerController) Name() string

Name implements controller.Controller interface.

func (*ManagerController) Outputs

func (ctrl *ManagerController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*ManagerController) Run

func (ctrl *ManagerController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type MemberController

type MemberController struct{}

MemberController converts Affiliates which have Nodename set into Members.

func (*MemberController) Inputs

func (ctrl *MemberController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*MemberController) Name

func (ctrl *MemberController) Name() string

Name implements controller.Controller interface.

func (*MemberController) Outputs

func (ctrl *MemberController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*MemberController) Run

Run implements controller.Controller interface.

type MountStatusController

type MountStatusController struct{}

MountStatusController generates node fake mounts.

func (*MountStatusController) Inputs

func (ctrl *MountStatusController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*MountStatusController) Name

func (ctrl *MountStatusController) Name() string

Name implements controller.Controller interface.

func (*MountStatusController) Outputs

func (ctrl *MountStatusController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*MountStatusController) Run

Run implements controller.Controller interface.

type NodeAddressController

type NodeAddressController struct {
	GlobalState state.State
	MachineID   string
}

NodeAddressController simple version of node addresses generator.

func (*NodeAddressController) Inputs

func (ctrl *NodeAddressController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeAddressController) Name

func (ctrl *NodeAddressController) Name() string

Name implements controller.Controller interface.

func (*NodeAddressController) Outputs

func (ctrl *NodeAddressController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeAddressController) Run

Run implements controller.Controller interface.

type NodeIdentityController

type NodeIdentityController struct{}

NodeIdentityController generates node identity.

func (*NodeIdentityController) Inputs

func (ctrl *NodeIdentityController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodeIdentityController) Name

func (ctrl *NodeIdentityController) Name() string

Name implements controller.Controller interface.

func (*NodeIdentityController) Outputs

func (ctrl *NodeIdentityController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodeIdentityController) Run

Run implements controller.Controller interface.

type NodenameController

type NodenameController struct{}

NodenameController renders manifests based on templates and config/secrets.

func (*NodenameController) Inputs

func (ctrl *NodenameController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*NodenameController) Name

func (ctrl *NodenameController) Name() string

Name implements controller.Controller interface.

func (*NodenameController) Outputs

func (ctrl *NodenameController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*NodenameController) Run

Run implements controller.Controller interface.

type RebootStatusController

type RebootStatusController = qtransform.QController[*talos.Reboot, *talos.RebootStatus]

RebootStatusController simulates node reboots by creating and removing reboot status resource.

func NewRebootStatusController

func NewRebootStatusController() *RebootStatusController

NewRebootStatusController creates new controller.

type RenderSecretsStaticPodController

type RenderSecretsStaticPodController struct {
	MachineID string
}

RenderSecretsStaticPodController manages k8s.SecretsReady and renders secrets from secrets.Kubernetes.

func (*RenderSecretsStaticPodController) Inputs

Inputs implements controller.Controller interface.

func (*RenderSecretsStaticPodController) Name

Name implements controller.Controller interface.

func (*RenderSecretsStaticPodController) Outputs

Outputs implements controller.Controller interface.

func (*RenderSecretsStaticPodController) Run

Run implements controller.Controller interface.

type RootKubernetesController

type RootKubernetesController = transform.Controller[*config.MachineConfig, *secrets.KubernetesRoot]

RootKubernetesController manages secrets.KubernetesRoot based on configuration.

func NewRootKubernetesController

func NewRootKubernetesController() *RootKubernetesController

NewRootKubernetesController instanciates the controller.

type RootOSController

type RootOSController = transform.Controller[*config.MachineConfig, *secrets.OSRoot]

RootOSController manages secrets.OSRoot based on configuration.

func NewRootOSController

func NewRootOSController() *RootOSController

NewRootOSController instanciates the controller.

type StaticPodController

type StaticPodController struct {
	MachineID string
	// contains filtered or unexported fields
}

StaticPodController renders fake static pod states.

func (*StaticPodController) Inputs

func (ctrl *StaticPodController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*StaticPodController) Name

func (ctrl *StaticPodController) Name() string

Name implements controller.Controller interface.

func (*StaticPodController) Outputs

func (ctrl *StaticPodController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*StaticPodController) Run

func (ctrl *StaticPodController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

type VersionController

type VersionController struct{}

VersionController computes extensions list from the configuration. Updates machine status resource.

func (*VersionController) Inputs

func (ctrl *VersionController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*VersionController) Name

func (ctrl *VersionController) Name() string

Name implements controller.Controller interface.

func (*VersionController) Outputs

func (ctrl *VersionController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*VersionController) Run

func (ctrl *VersionController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

Jump to

Keyboard shortcuts

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