kubespan

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigID = resource.ID("kubespan")

ConfigID the singleton config resource ID.

View Source
const ConfigType = resource.Type("KubeSpanConfigs.kubespan.talos.dev")

ConfigType is type of Config resource.

View Source
const EndpointType = resource.Type("KubeSpanEndpoints.kubespan.talos.dev")

EndpointType is type of Endpoint resource.

View Source
const IdentityType = resource.Type("KubeSpanIdentities.kubespan.talos.dev")

IdentityType is type of Identity resource.

View Source
const LocalIdentity = resource.ID("local")

LocalIdentity is the resource ID for the local node KubeSpan identity.

View Source
const NamespaceName resource.Namespace = "kubespan"

NamespaceName contains resources related to KubeSpan.

View Source
const PeerSpecType = resource.Type("KubeSpanPeerSpecs.kubespan.talos.dev")

PeerSpecType is type of PeerSpec resource.

View Source
const PeerStatusType = resource.Type("KubeSpanPeerStatuses.kubespan.talos.dev")

PeerStatusType is type of PeerStatus resource.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

Config resource holds KubeSpan configuration.

func NewConfig

func NewConfig(namespace resource.Namespace, id resource.ID) *Config

NewConfig initializes a Config resource.

type ConfigExtension added in v1.4.0

type ConfigExtension struct{}

ConfigExtension provides auxiliary methods for Config.

func (ConfigExtension) ResourceDefinition added in v1.4.0

func (ConfigExtension) ResourceDefinition() meta.ResourceDefinitionSpec

ResourceDefinition implements typed.Extension interface.

type ConfigSpec

type ConfigSpec struct {
	Enabled      bool   `yaml:"enabled" protobuf:"1"`
	ClusterID    string `yaml:"clusterId" protobuf:"2"`
	SharedSecret string `yaml:"sharedSecret" protobuf:"3"`
	// Force routing via KubeSpan even if the peer connection is not up.
	ForceRouting bool `yaml:"forceRouting" protobuf:"4"`
	// Advertise Kubernetes pod networks or skip it completely.
	AdvertiseKubernetesNetworks bool `yaml:"advertiseKubernetesNetworks" protobuf:"5"`
	// Force kubeSpan MTU size.
	MTU uint32 `yaml:"mtu,omitempty" protobuf:"6"`
	// If not empty, filter advertised endpoints using the list of CIDRs.
	EndpointFilters []string `yaml:"endpointFilters,omitempty" protobuf:"7"`
	// Harvest endpoints from the peer statuses.
	HarvestExtraEndpoints bool `yaml:"harvestExtraEndpoints" protobuf:"8"`
	// Extra endpoints to announce.
	ExtraEndpoints []netip.AddrPort `yaml:"extraEndpoints,omitempty" protobuf:"9"`
}

ConfigSpec describes KubeSpan configuration..

func (ConfigSpec) DeepCopy

func (o ConfigSpec) DeepCopy() ConfigSpec

DeepCopy generates a deep copy of ConfigSpec.

type Endpoint

Endpoint is produced from KubeSpanPeerStatuses by mapping back discovered endpoints to the affiliates.

Endpoint is identified by the public key of the peer.

func NewEndpoint

func NewEndpoint(namespace resource.Namespace, id resource.ID) *Endpoint

NewEndpoint initializes a Endpoint resource.

type EndpointExtension added in v1.4.0

type EndpointExtension struct{}

EndpointExtension provides auxiliary methods for Endpoint.

func (EndpointExtension) ResourceDefinition added in v1.4.0

func (EndpointExtension) ResourceDefinition() meta.ResourceDefinitionSpec

ResourceDefinition implements typed.Extension interface.

type EndpointSpec

type EndpointSpec struct {
	AffiliateID string         `yaml:"affiliateID" protobuf:"1"`
	Endpoint    netip.AddrPort `yaml:"endpoint" protobuf:"2"`
}

EndpointSpec describes Endpoint state.

func (EndpointSpec) DeepCopy

func (o EndpointSpec) DeepCopy() EndpointSpec

DeepCopy generates a deep copy of EndpointSpec.

type Identity

Identity resource holds node identity (as a member of the cluster).

func NewIdentity

func NewIdentity(namespace resource.Namespace, id resource.ID) *Identity

NewIdentity initializes a Identity resource.

type IdentityExtension added in v1.4.0

type IdentityExtension struct{}

IdentityExtension provides auxiliary methods for Identity.

func (IdentityExtension) ResourceDefinition added in v1.4.0

func (IdentityExtension) ResourceDefinition() meta.ResourceDefinitionSpec

ResourceDefinition implements typed.Extension interface.

type IdentitySpec

type IdentitySpec struct {
	// Address of the node on the Wireguard network.
	Address netip.Prefix `yaml:"address" protobuf:"1"`
	Subnet  netip.Prefix `yaml:"subnet" protobuf:"2"`
	// Public and private Wireguard keys.
	PrivateKey string `yaml:"privateKey" protobuf:"3"`
	PublicKey  string `yaml:"publicKey" protobuf:"4"`
}

IdentitySpec describes KubeSpan keys and address.

Note: IdentitySpec is persisted on disk in the STATE partition, so YAML serialization should be kept backwards compatible.

func (IdentitySpec) DeepCopy

func (o IdentitySpec) DeepCopy() IdentitySpec

DeepCopy generates a deep copy of IdentitySpec.

type PeerSpec

PeerSpec is produced from cluster.Affiliate which has KubeSpan information attached.

PeerSpec is identified by the public key.

func NewPeerSpec

func NewPeerSpec(namespace resource.Namespace, id resource.ID) *PeerSpec

NewPeerSpec initializes a PeerSpec resource.

type PeerSpecExtension added in v1.4.0

type PeerSpecExtension struct{}

PeerSpecExtension provides auxiliary methods for PeerSpec.

func (PeerSpecExtension) ResourceDefinition added in v1.4.0

func (PeerSpecExtension) ResourceDefinition() meta.ResourceDefinitionSpec

ResourceDefinition implements typed.Extension interface.

type PeerSpecSpec

type PeerSpecSpec struct {
	Address    netip.Addr       `yaml:"address" protobuf:"1"`
	AllowedIPs []netip.Prefix   `yaml:"allowedIPs" protobuf:"2"`
	Endpoints  []netip.AddrPort `yaml:"endpoints" protobuf:"3"`
	Label      string           `yaml:"label" protobuf:"4"`
}

PeerSpecSpec describes PeerSpec state.

func (PeerSpecSpec) DeepCopy

func (o PeerSpecSpec) DeepCopy() PeerSpecSpec

DeepCopy generates a deep copy of PeerSpecSpec.

type PeerState

type PeerState int

PeerState is KubeSpan peer current state.

const (
	PeerStateUnknown PeerState = iota // unknown
	PeerStateUp                       // up
	PeerStateDown                     // down
)

PeerState constants.

func (PeerState) MarshalText

func (v PeerState) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (PeerState) String

func (i PeerState) String() string

func (*PeerState) UnmarshalText

func (v *PeerState) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type PeerStatus

PeerStatus the Wireguard peer state for KubeSpan.

PeerStatus is identified by the public key.

func NewPeerStatus

func NewPeerStatus(namespace resource.Namespace, id resource.ID) *PeerStatus

NewPeerStatus initializes a PeerStatus resource.

type PeerStatusExtension added in v1.4.0

type PeerStatusExtension struct{}

PeerStatusExtension provides auxiliary methods for PeerStatus.

func (PeerStatusExtension) ResourceDefinition added in v1.4.0

func (PeerStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec

ResourceDefinition implements typed.Extension interface.

type PeerStatusSpec

type PeerStatusSpec struct {
	// Active endpoint as seen by the Wireguard.
	Endpoint netip.AddrPort `yaml:"endpoint" protobuf:"1"`
	// Label derived from the peer spec.
	Label string `yaml:"label" protobuf:"2"`
	// Calculated state.
	State PeerState `yaml:"state" protobuf:"3"`
	// Tx/Rx bytes.
	ReceiveBytes  int64 `yaml:"receiveBytes" protobuf:"4"`
	TransmitBytes int64 `yaml:"transmitBytes" protobuf:"5"`
	// Handshake.
	LastHandshakeTime time.Time `yaml:"lastHandshakeTime" protobuf:"6"`
	// Endpoint selection input.
	LastUsedEndpoint   netip.AddrPort `yaml:"lastUsedEndpoint" protobuf:"7"`
	LastEndpointChange time.Time      `yaml:"lastEndpointChange" protobuf:"8"`
}

PeerStatusSpec describes PeerStatus state.

func (PeerStatusSpec) DeepCopy

func (o PeerStatusSpec) DeepCopy() PeerStatusSpec

DeepCopy generates a deep copy of PeerStatusSpec.

Jump to

Keyboard shortcuts

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