kubespan

package
v1.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MPL-2.0 Imports: 34 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 struct{}

ConfigController watches v1alpha1.Config, updates KubeSpan config.

func (*ConfigController) Inputs

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

Inputs implements controller.Controller interface.

func (*ConfigController) Name

func (ctrl *ConfigController) Name() string

Name implements controller.Controller interface.

func (*ConfigController) Outputs

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

Outputs implements controller.Controller interface.

func (*ConfigController) Run

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

Run implements controller.Controller interface.

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

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

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

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

Run implements controller.Controller interface.

type ManagerController

type ManagerController struct {
	WireguardClientFactory WireguardClientFactory
	RulesManagerFactory    RulesManagerFactory
	NfTablesManagerFactory NfTablesManagerFactory
	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 NfTablesManager

type NfTablesManager interface {
	Update(ips *netipx.IPSet, mtu uint32) error
	Cleanup() error
}

NfTablesManager manages nftables outside of controllers/resources scope.

func NewNfTablesManager

func NewNfTablesManager(externalMark, internalMark, markMask uint32) NfTablesManager

NewNfTablesManager initializes NfTablesManager.

type NfTablesManagerFactory

type NfTablesManagerFactory func(externalMark, internalMark, markMask uint32) NfTablesManager

NfTablesManagerFactory allows mocking NfTablesManager.

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, internalMark, markMask int) RulesManager

NewRulesManager initializes new RulesManager.

type RulesManagerFactory

type RulesManagerFactory func(targetTable, internalMark, markMask int) 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