kubespan

package
v1.10.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MPL-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package kubespan provides controllers which manage Talos KubeSpan feature.

Index

Constants

View Source
const DefaultPeerReconcileInterval = 30 * time.Second

DefaultPeerReconcileInterval is interval between peer status reconciliation on timer.

Peers might be reconciled more often e.g. when peerSpecs are updated.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigController

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

ConfigController watches v1alpha1.Config, updates KubeSpan config.

func NewConfigController added in v1.5.0

func NewConfigController() *ConfigController

NewConfigController instanciates the config controller.

type EndpointController

type EndpointController struct{}

EndpointController watches KubeSpanPeerStatuses, Affiliates and harvests additional endpoints for the peers.

func (*EndpointController) Inputs

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

Inputs implements controller.Controller interface.

func (*EndpointController) Name

func (ctrl *EndpointController) Name() string

Name implements controller.Controller interface.

func (*EndpointController) Outputs

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

Outputs implements controller.Controller interface.

func (*EndpointController) Run

Run implements controller.Controller interface.

type IdentityController

type IdentityController struct {
	StatePath string
}

IdentityController watches KubeSpan configuration, updates KubeSpan Identity.

func (*IdentityController) Inputs

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

Inputs implements controller.Controller interface.

func (*IdentityController) Name

func (ctrl *IdentityController) Name() string

Name implements controller.Controller interface.

func (*IdentityController) Outputs

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

Outputs implements controller.Controller interface.

func (*IdentityController) Run

Run implements controller.Controller interface.

type ManagerController

type ManagerController struct {
	WireguardClientFactory WireguardClientFactory
	RulesManagerFactory    RulesManagerFactory
	PeerReconcileInterval  time.Duration
}

ManagerController sets up Wireguard networking based on KubeSpan configuration, watches and updates peer statuses.

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 PeerSpecController

type PeerSpecController struct{}

PeerSpecController watches cluster.Affiliates updates PeerSpec.

func (*PeerSpecController) Inputs

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

Inputs implements controller.Controller interface.

func (*PeerSpecController) Name

func (ctrl *PeerSpecController) Name() string

Name implements controller.Controller interface.

func (*PeerSpecController) Outputs

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

Outputs implements controller.Controller interface.

func (*PeerSpecController) Run

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

Run implements controller.Controller interface.

type RulesManager

type RulesManager interface {
	Install() error
	Cleanup() error
}

RulesManager manages routing rules outside of controllers/resources scope.

TODO: this might be refactored later to support routing rules in the native network resources.

func NewRulesManager

func NewRulesManager(targetTable uint8, internalMark, markMask uint32) RulesManager

NewRulesManager initializes new RulesManager.

type RulesManagerFactory

type RulesManagerFactory func(targetTable uint8, internalMark, markMask uint32) RulesManager

RulesManagerFactory allows mocking RulesManager.

type WireguardClient

type WireguardClient interface {
	Device(string) (*wgtypes.Device, error)
	Close() error
}

WireguardClient allows mocking Wireguard client.

type WireguardClientFactory

type WireguardClientFactory func() (WireguardClient, error)

WireguardClientFactory allows mocking Wireguard client.

Jump to

Keyboard shortcuts

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