Documentation ¶
Index ¶
Constants ¶
const ConfigID = resource.ID("kubespan")
ConfigID the singleton config resource ID.
const ConfigType = resource.Type("KubeSpanConfigs.kubespan.talos.dev")
ConfigType is type of Config resource.
const EndpointType = resource.Type("KubeSpanEndpoints.kubespan.talos.dev")
EndpointType is type of Endpoint resource.
const IdentityType = resource.Type("KubeSpanIdentities.kubespan.talos.dev")
IdentityType is type of Identity resource.
const LocalIdentity = resource.ID("local")
LocalIdentity is the resource ID for the local node KubeSpan identity.
const NamespaceName resource.Namespace = "kubespan"
NamespaceName contains resources related to KubeSpan.
const PeerSpecType = resource.Type("KubeSpanPeerSpecs.kubespan.talos.dev")
PeerSpecType is type of PeerSpec resource.
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 ¶
type Config = typed.Resource[ConfigSpec, ConfigExtension]
Config resource holds KubeSpan configuration.
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"` // 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"` }
ConfigSpec describes KubeSpan configuration..
func (ConfigSpec) DeepCopy ¶
func (o ConfigSpec) DeepCopy() ConfigSpec
DeepCopy generates a deep copy of ConfigSpec.
type Endpoint ¶
type Endpoint = typed.Resource[EndpointSpec, EndpointExtension]
Endpoint is produced from KubeSpanPeerStatuses by mapping back discovered endpoints to the affiliates.
Endpoint is identified by the public key of the peer.
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 ¶
type Identity = typed.Resource[IdentitySpec, IdentityExtension]
Identity resource holds node identity (as a member of the cluster).
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 ¶
type PeerSpec = typed.Resource[PeerSpecSpec, PeerSpecExtension]
PeerSpec is produced from cluster.Affiliate which has KubeSpan information attached.
PeerSpec is identified by the public key.
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.
PeerState constants.
func (PeerState) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*PeerState) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type PeerStatus ¶
type PeerStatus = typed.Resource[PeerStatusSpec, PeerStatusExtension]
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.