network

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package network provides resources which describe networking subsystem state.

Index

Constants

View Source
const (
	LinkKindVLAN      = "vlan"
	LinkKindBond      = "bond"
	LinkKindBridge    = "bridge"
	LinkKindWireguard = "wireguard"
)

Link kinds.

View Source
const (
	// Default node address (should be a single address in the spec).
	//
	// Used to set for example published etcd peer address.
	NodeAddressDefaultID = "default"
	// Current node addresses (as seen at the moment).
	//
	// Shows a list of addresses for the node for the UP interfaces.
	NodeAddressCurrentID = "current"
	// Accumulative list of the addresses node had over time.
	//
	// If some address is no longer present, it will be still kept in the accumulative list.
	NodeAddressAccumulativeID = "accumulative"
	// Routed current node addresses (as seen at the moment).
	//
	// This is current addresses minus 'external' IPs, and SideroLink IPs.
	//
	// This list is used to pick advertised/listen addresses for different services.
	NodeAddressRoutedID = "routed"
)

NodeAddress well-known IDs.

View Source
const (
	// ULAUnknown indicates an unknown ULA Purpose.
	ULAUnknown = 0x00

	// ULABootstrap is the Unique Local Addressing space key for the Talos Self-Bootstrapping protocol.
	ULABootstrap = 0x01

	// ULAKubeSpan is the Unique Local Addressing space key for the Talos KubeSpan feature.
	ULAKubeSpan = 0x02

	// ULASideroLink is the Unique Local Addressing space key for the SideroLink feature.
	ULASideroLink = 0x03
)
View Source
const AddressSpecType = resource.Type("AddressSpecs.net.talos.dev")

AddressSpecType is type of AddressSpec resource.

View Source
const AddressStatusType = resource.Type("AddressStatuses.net.talos.dev")

AddressStatusType is type of AddressStatus resource.

View Source
const ConfigNamespaceName resource.Namespace = "network-config"

ConfigNamespaceName contains umerged resources related to networking generate from the configuration.

Resources in the ConfigNamespaceName namespace are merged to produce final versions in the NamespaceName namespace.

View Source
const DeviceConfigSpecType = resource.Type("DeviceConfigSpecs.net.talos.dev")

DeviceConfigSpecType is type of DeviceConfigSpec resource.

View Source
const FirstHardwareAddr = resource.ID("first")

FirstHardwareAddr is a resource ID for the first NIC HW addr.

View Source
const HardwareAddrType = resource.Type("HardwareAddresses.net.talos.dev")

HardwareAddrType is type of HardwareAddr resource.

View Source
const HostnameID resource.ID = "hostname"

HostnameID is the ID of the singleton instance.

View Source
const HostnameSpecType = resource.Type("HostnameSpecs.net.talos.dev")

HostnameSpecType is type of HostnameSpec resource.

View Source
const HostnameStatusType = resource.Type("HostnameStatuses.net.talos.dev")

HostnameStatusType is type of HostnameStatus resource.

View Source
const LinkRefreshType = resource.Type("LinkRefreshes.net.talos.dev")

LinkRefreshType is type of LinkRefresh resource.

View Source
const LinkSpecType = resource.Type("LinkSpecs.net.talos.dev")

LinkSpecType is type of LinkSpec resource.

View Source
const LinkStatusType = resource.Type("LinkStatuses.net.talos.dev")

LinkStatusType is type of LinkStatus resource.

View Source
const NamespaceName resource.Namespace = "network"

NamespaceName contains resources related to networking.

View Source
const NodeAddressFilterType = resource.Type("NodeAddressFilters.net.talos.dev")

NodeAddressFilterType is type of NodeAddressFilter resource.

View Source
const NodeAddressType = resource.Type("NodeAddresses.net.talos.dev")

NodeAddressType is type of NodeAddress resource.

View Source
const OperatorSpecType = resource.Type("OperatorSpecs.net.talos.dev")

OperatorSpecType is type of OperatorSpec resource.

View Source
const ResolverID resource.ID = "resolvers"

ResolverID is the ID of the singleton instance.

View Source
const ResolverSpecType = resource.Type("ResolverSpecs.net.talos.dev")

ResolverSpecType is type of ResolverSpec resource.

View Source
const ResolverStatusType = resource.Type("ResolverStatuses.net.talos.dev")

ResolverStatusType is type of ResolverStatus resource.

View Source
const RouteSpecType = resource.Type("RouteSpecs.net.talos.dev")

RouteSpecType is type of RouteSpec resource.

View Source
const RouteStatusType = resource.Type("RouteStatuses.net.talos.dev")

RouteStatusType is type of RouteStatus resource.

View Source
const StatusID resource.ID = "status"

StatusID is the resource ID of the singleton instance.

View Source
const StatusType = resource.Type("NetworkStatuses.net.talos.dev")

StatusType is type of Status resource.

View Source
const TimeServerID resource.ID = "timeservers"

TimeServerID is the ID of the singleton instance.

View Source
const TimeServerSpecType = resource.Type("TimeServerSpecs.net.talos.dev")

TimeServerSpecType is type of TimeServerSpec resource.

View Source
const TimeServerStatusType = resource.Type("TimeServerStatuses.net.talos.dev")

TimeServerStatusType is type of TimeServerStatus resource.

Variables

This section is empty.

Functions

func AddressID

func AddressID(linkName string, addr netaddr.IPPrefix) string

AddressID builds ID (primary key) for the address.

func AddressReady

func AddressReady(spec *StatusSpec) bool

AddressReady checks if address is ready.

func ConnectivityReady

func ConnectivityReady(spec *StatusSpec) bool

ConnectivityReady checks if connectivity is ready.

func EtcFilesReady

func EtcFilesReady(spec *StatusSpec) bool

EtcFilesReady checks if etc files are ready.

func FilteredNodeAddressID

func FilteredNodeAddressID(kind resource.ID, filterID string) resource.ID

FilteredNodeAddressID returns resource ID for node addresses with filter applied.

func HostnameReady

func HostnameReady(spec *StatusSpec) bool

HostnameReady checks if hostname is ready.

func IsStdULA

func IsStdULA(ip net.IP, purpose ULAPurpose) bool

IsStdULA implements IsULA for stdlib net.IP.

func IsULA

func IsULA(ip netaddr.IP, purpose ULAPurpose) bool

IsULA checks whether IP address is a Unique Local Address with the specific purpose.

func LayeredID

func LayeredID(layer ConfigLayer, id string) string

LayeredID builds configuration for the entity at some layer.

func LinkID

func LinkID(linkName string) string

LinkID builds ID (primary key) for the link (interface).

func NotSideroLinkIP added in v1.2.0

func NotSideroLinkIP(ip netaddr.IP) bool

NotSideroLinkIP is a shorthand for !IsULA(ip, ULASideroLink).

func NotSideroLinkStdIP

func NotSideroLinkStdIP(ip net.IP) bool

NotSideroLinkStdIP is a shorthand for !IsStdULA(ip, ULASideroLink).

func OperatorID

func OperatorID(operator Operator, linkName string) string

OperatorID builds ID (primary key) for the operators.

func RouteID

func RouteID(table nethelpers.RoutingTable, family nethelpers.Family, destination netaddr.IPPrefix, gateway netaddr.IP, priority uint32) string

RouteID builds ID (primary key) for the route.

func ULAPrefix

func ULAPrefix(clusterID string, purpose ULAPurpose) netaddr.IPPrefix

ULAPrefix calculates and returns a Talos-specific Unique Local Address prefix for the given purpose. This implements a Talos-specific implementation of RFC4193. The Talos implementation uses a combination of a 48-bit cluster-unique portion with an 8-bit purpose portion.

Types

type AddressSpec

AddressSpec resource holds physical network link status.

func NewAddressSpec

func NewAddressSpec(namespace resource.Namespace, id resource.ID) *AddressSpec

NewAddressSpec initializes a AddressSpec resource.

type AddressSpecRD added in v1.1.0

type AddressSpecRD struct{}

AddressSpecRD provides auxiliary methods for AddressSpec.

func (AddressSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type AddressSpecSpec

type AddressSpecSpec struct {
	Address         netaddr.IPPrefix        `yaml:"address" protobuf:"1"`
	LinkName        string                  `yaml:"linkName" protobuf:"2"`
	Family          nethelpers.Family       `yaml:"family" protobuf:"3"`
	Scope           nethelpers.Scope        `yaml:"scope" protobuf:"4"`
	Flags           nethelpers.AddressFlags `yaml:"flags" protobuf:"5"`
	AnnounceWithARP bool                    `yaml:"announceWithARP,omitempty" protobuf:"6"`
	ConfigLayer     ConfigLayer             `yaml:"layer" protobuf:"7"`
}

AddressSpecSpec describes status of rendered secrets.

func (AddressSpecSpec) DeepCopy added in v1.1.0

func (o AddressSpecSpec) DeepCopy() AddressSpecSpec

DeepCopy generates a deep copy of AddressSpecSpec.

type AddressStatus

AddressStatus resource holds physical network link status.

func NewAddressStatus

func NewAddressStatus(namespace resource.Namespace, id resource.ID) *AddressStatus

NewAddressStatus initializes a AddressStatus resource.

type AddressStatusRD added in v1.1.0

type AddressStatusRD struct{}

AddressStatusRD provides auxiliary methods for AddressStatus.

func (AddressStatusRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type AddressStatusSpec

type AddressStatusSpec struct {
	Address   netaddr.IPPrefix        `yaml:"address" protobuf:"1"`
	Local     netaddr.IP              `yaml:"local,omitempty" protobuf:"2"`
	Broadcast netaddr.IP              `yaml:"broadcast,omitempty" protobuf:"3"`
	Anycast   netaddr.IP              `yaml:"anycast,omitempty" protobuf:"4"`
	Multicast netaddr.IP              `yaml:"multicast,omitempty" protobuf:"5"`
	LinkIndex uint32                  `yaml:"linkIndex" protobuf:"6"`
	LinkName  string                  `yaml:"linkName" protobuf:"7"`
	Family    nethelpers.Family       `yaml:"family" protobuf:"8"`
	Scope     nethelpers.Scope        `yaml:"scope" protobuf:"9"`
	Flags     nethelpers.AddressFlags `yaml:"flags" protobuf:"10"`
}

AddressStatusSpec describes status of rendered secrets.

func (AddressStatusSpec) DeepCopy added in v1.1.0

func (o AddressStatusSpec) DeepCopy() AddressStatusSpec

DeepCopy generates a deep copy of AddressStatusSpec.

type BondMasterSpec

type BondMasterSpec struct {
	Mode            nethelpers.BondMode           `yaml:"mode" protobuf:"1"`
	HashPolicy      nethelpers.BondXmitHashPolicy `yaml:"xmitHashPolicy" protobuf:"2"`
	LACPRate        nethelpers.LACPRate           `yaml:"lacpRate" protobuf:"3"`
	ARPValidate     nethelpers.ARPValidate        `yaml:"arpValidate" protobuf:"4"`
	ARPAllTargets   nethelpers.ARPAllTargets      `yaml:"arpAllTargets" protobuf:"5"`
	PrimaryIndex    uint32                        `yaml:"primary,omitempty" protobuf:"6"`
	PrimaryReselect nethelpers.PrimaryReselect    `yaml:"primaryReselect" protobuf:"7"`
	FailOverMac     nethelpers.FailOverMAC        `yaml:"failOverMac" protobuf:"8"`
	ADSelect        nethelpers.ADSelect           `yaml:"adSelect,omitempty" protobuf:"9"`
	MIIMon          uint32                        `yaml:"miimon,omitempty" protobuf:"10"`
	UpDelay         uint32                        `yaml:"updelay,omitempty" protobuf:"11"`
	DownDelay       uint32                        `yaml:"downdelay,omitempty" protobuf:"12"`
	ARPInterval     uint32                        `yaml:"arpInterval,omitempty" protobuf:"13"`
	ResendIGMP      uint32                        `yaml:"resendIgmp,omitempty" protobuf:"14"`
	MinLinks        uint32                        `yaml:"minLinks,omitempty" protobuf:"15"`
	LPInterval      uint32                        `yaml:"lpInterval,omitempty" protobuf:"16"`
	PacketsPerSlave uint32                        `yaml:"packetsPerSlave,omitempty" protobuf:"17"`
	NumPeerNotif    uint8                         `yaml:"numPeerNotif,omitempty" protobuf:"18"`
	TLBDynamicLB    uint8                         `yaml:"tlbLogicalLb,omitempty" protobuf:"19"`
	AllSlavesActive uint8                         `yaml:"allSlavesActive,omitempty" protobuf:"20"`
	UseCarrier      bool                          `yaml:"useCarrier,omitempty" protobuf:"21"`
	ADActorSysPrio  uint16                        `yaml:"adActorSysPrio,omitempty" protobuf:"22"`
	ADUserPortKey   uint16                        `yaml:"adUserPortKey,omitempty" protobuf:"23"`
	PeerNotifyDelay uint32                        `yaml:"peerNotifyDelay,omitempty" protobuf:"24"`
}

BondMasterSpec describes bond settings if Kind == "bond".

type BondSlave added in v1.1.0

type BondSlave struct {
	// MasterName indicates master link for enslaved bonded interfaces.
	MasterName string `yaml:"masterName,omitempty" protobuf:"1"`

	// SlaveIndex indicates a slave's position in bond.
	SlaveIndex int `yaml:"slaveIndex,omitempty" protobuf:"2"`
}

BondSlave contains a bond's master name and slave index.

type BridgeMasterSpec added in v1.2.0

type BridgeMasterSpec struct {
	STP STPSpec `yaml:"stp,omitempty" protobuf:"1"`
}

BridgeMasterSpec describes bridge settings if Kind == "bridge".

type BridgeSlave added in v1.2.0

type BridgeSlave struct {
	// MasterName indicates master link for enslaved bridged interfaces.
	MasterName string `yaml:"masterName,omitempty" protobuf:"1"`
}

BridgeSlave contains a bond's master name and slave index.

type ConfigLayer

type ConfigLayer int

ConfigLayer describes network configuration layers, with lowest priority first.

const (
	ConfigDefault              ConfigLayer = iota // default
	ConfigCmdline                                 // cmdline
	ConfigPlatform                                // platform
	ConfigOperator                                // operator
	ConfigMachineConfiguration                    // configuration
)

Configuration layers.

func ConfigLayerString added in v1.0.0

func ConfigLayerString(s string) (ConfigLayer, error)

ConfigLayerString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ConfigLayerValues added in v1.0.0

func ConfigLayerValues() []ConfigLayer

ConfigLayerValues returns all values of the enum

func (ConfigLayer) IsAConfigLayer added in v1.0.0

func (i ConfigLayer) IsAConfigLayer() bool

IsAConfigLayer returns "true" if the value is listed in the enum definition. "false" otherwise

func (ConfigLayer) MarshalText added in v1.0.0

func (i ConfigLayer) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for ConfigLayer

func (ConfigLayer) String

func (i ConfigLayer) String() string

func (*ConfigLayer) UnmarshalText added in v1.0.0

func (i *ConfigLayer) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for ConfigLayer

type DHCP4OperatorSpec

type DHCP4OperatorSpec struct {
	RouteMetric uint32 `yaml:"routeMetric" protobuf:"1"`
}

DHCP4OperatorSpec describes DHCP4 operator options.

type DHCP6OperatorSpec

type DHCP6OperatorSpec struct {
	DUID        string `yaml:"DUID,omitempty" protobuf:"1"`
	RouteMetric uint32 `yaml:"routeMetric" protobuf:"2"`
}

DHCP6OperatorSpec describes DHCP6 operator options.

type DeviceConfigSpec added in v1.1.0

DeviceConfigSpec resource holds network interface configs.

func NewDeviceConfig added in v1.1.0

func NewDeviceConfig(id resource.ID, device config.Device) *DeviceConfigSpec

NewDeviceConfig creates new interface config.

type DeviceConfigSpecRD added in v1.1.0

type DeviceConfigSpecRD struct{}

DeviceConfigSpecRD providers auxiliary methods for DeviceConfigSpec.

func (DeviceConfigSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type DeviceConfigSpecSpec added in v1.1.0

type DeviceConfigSpecSpec struct {
	Device config.Device `protobuf:"1"`
}

DeviceConfigSpecSpec contains the spec of a device config.

func (DeviceConfigSpecSpec) DeepCopy added in v1.1.0

DeepCopy generates a deep copy of DeviceConfigSpecSpec.

func (*DeviceConfigSpecSpec) MarshalProto added in v1.2.0

func (spec *DeviceConfigSpecSpec) MarshalProto() ([]byte, error)

MarshalProto implements ProtoMarshaler.

func (*DeviceConfigSpecSpec) UnmarshalProto added in v1.2.0

func (spec *DeviceConfigSpecSpec) UnmarshalProto(protoBytes []byte) error

UnmarshalProto implements protobuf.ResourceUnmarshaler.

type HardwareAddr

HardwareAddr resource describes hardware address of the physical links.

func NewHardwareAddr

func NewHardwareAddr(namespace resource.Namespace, id resource.ID) *HardwareAddr

NewHardwareAddr initializes a HardwareAddr resource.

type HardwareAddrRD added in v1.1.0

type HardwareAddrRD struct{}

HardwareAddrRD provides auxiliary methods for HardwareAddr.

func (HardwareAddrRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type HardwareAddrSpec

type HardwareAddrSpec struct {
	// Name defines link name
	Name string `yaml:"name" protobuf:"1"`

	// Hardware address
	HardwareAddr nethelpers.HardwareAddr `yaml:"hardwareAddr" protobuf:"2"`
}

HardwareAddrSpec describes spec for the link.

func (HardwareAddrSpec) DeepCopy added in v1.1.0

func (o HardwareAddrSpec) DeepCopy() HardwareAddrSpec

DeepCopy generates a deep copy of HardwareAddrSpec.

type HostnameSpec

HostnameSpec resource holds node hostname.

func NewHostnameSpec

func NewHostnameSpec(namespace resource.Namespace, id resource.ID) *HostnameSpec

NewHostnameSpec initializes a HostnameSpec resource.

type HostnameSpecRD added in v1.1.0

type HostnameSpecRD struct{}

HostnameSpecRD provides auxiliary methods for HostnameSpec.

func (HostnameSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type HostnameSpecSpec

type HostnameSpecSpec struct {
	Hostname    string      `yaml:"hostname" protobuf:"1"`
	Domainname  string      `yaml:"domainname" protobuf:"2"`
	ConfigLayer ConfigLayer `yaml:"layer" protobuf:"3"`
}

HostnameSpecSpec describes node nostname.

func (HostnameSpecSpec) DeepCopy added in v1.1.0

func (o HostnameSpecSpec) DeepCopy() HostnameSpecSpec

DeepCopy generates a deep copy of HostnameSpecSpec.

func (*HostnameSpecSpec) FQDN

func (spec *HostnameSpecSpec) FQDN() string

FQDN returns the fully-qualified domain name.

func (*HostnameSpecSpec) ParseFQDN

func (spec *HostnameSpecSpec) ParseFQDN(fqdn string) error

ParseFQDN into parts and validate it.

func (*HostnameSpecSpec) Validate

func (spec *HostnameSpecSpec) Validate() error

Validate the hostname.

type HostnameStatus

HostnameStatus resource holds node hostname.

func NewHostnameStatus

func NewHostnameStatus(namespace resource.Namespace, id resource.ID) *HostnameStatus

NewHostnameStatus initializes a HostnameStatus resource.

type HostnameStatusRD added in v1.1.0

type HostnameStatusRD struct{}

HostnameStatusRD provides auxiliary methods for HostnameStatus.

func (HostnameStatusRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type HostnameStatusSpec

type HostnameStatusSpec struct {
	Hostname   string `yaml:"hostname" protobuf:"1"`
	Domainname string `yaml:"domainname" protobuf:"2"`
}

HostnameStatusSpec describes node nostname.

func (*HostnameStatusSpec) DNSNames

func (spec *HostnameStatusSpec) DNSNames() []string

DNSNames returns DNS names to be added to the certificate based on the hostname and fqdn.

func (HostnameStatusSpec) DeepCopy added in v1.1.0

DeepCopy generates a deep copy of HostnameStatusSpec.

func (*HostnameStatusSpec) FQDN

func (spec *HostnameStatusSpec) FQDN() string

FQDN returns the fully-qualified domain name.

type LinkRefresh

LinkRefresh resource is used to communicate link changes which can't be subscribed to via netlink.

The only usecase for now is the Wireguards, as there's no way subscribe to wireguard updates via the netlink API.

Whenever Wireguard interface is updated, LinkRefresh resource is modified to trigger a reconcile loop in the LinkStatusController.

func NewLinkRefresh

func NewLinkRefresh(namespace resource.Namespace, id resource.ID) *LinkRefresh

NewLinkRefresh initializes a LinkRefresh resource.

type LinkRefreshRD added in v1.1.0

type LinkRefreshRD struct{}

LinkRefreshRD provides auxiliary methods for LinkRefresh.

func (LinkRefreshRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type LinkRefreshSpec

type LinkRefreshSpec struct {
	Generation int `yaml:"generation" protobuf:"1"`
}

LinkRefreshSpec describes status of rendered secrets.

func (*LinkRefreshSpec) Bump added in v1.1.0

func (s *LinkRefreshSpec) Bump()

Bump performs an update.

func (LinkRefreshSpec) DeepCopy added in v1.1.0

func (o LinkRefreshSpec) DeepCopy() LinkRefreshSpec

DeepCopy generates a deep copy of LinkRefreshSpec.

type LinkSpec

LinkSpec resource describes desired state of the link (network interface).

func NewLinkSpec

func NewLinkSpec(namespace resource.Namespace, id resource.ID) *LinkSpec

NewLinkSpec initializes a LinkSpec resource.

type LinkSpecRD added in v1.1.0

type LinkSpecRD struct{}

LinkSpecRD provides auxiliary methods for LinkSpec.

func (LinkSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type LinkSpecSpec

type LinkSpecSpec struct {
	// Name defines link name
	Name string `yaml:"name" protobuf:"1"`

	// Logical describes if the interface should be created on the fly if it doesn't exist.
	Logical bool `yaml:"logical" protobuf:"2"`

	// If Up is true, bring interface up, otherwise bring interface down.
	//
	// TODO: make *bool ?
	Up bool `yaml:"up" protobuf:"3"`

	// Interface MTU (always applies).
	MTU uint32 `yaml:"mtu" protobuf:"4"`

	// Kind and Type are only required for Logical interfaces.
	Kind string              `yaml:"kind" protobuf:"5"`
	Type nethelpers.LinkType `yaml:"type" protobuf:"6"`

	// ParentName indicates link parent for VLAN interfaces.
	ParentName string `yaml:"parentName,omitempty" protobuf:"7"`

	// MasterName indicates master link for enslaved bonded interfaces.
	BondSlave BondSlave `yaml:",omitempty,inline" protobuf:"8"`

	// BridgeSlave indicates master link for bridged interfaces.
	BridgeSlave BridgeSlave `yaml:"bridgeSlave,omitempty" protobuf:"9"`

	// These structures are present depending on "Kind" for Logical interfaces.
	VLAN         VLANSpec         `yaml:"vlan,omitempty" protobuf:"10"`
	BondMaster   BondMasterSpec   `yaml:"bondMaster,omitempty" protobuf:"11"`
	BridgeMaster BridgeMasterSpec `yaml:"bridgeMaster,omitempty" protobuf:"12"`
	Wireguard    WireguardSpec    `yaml:"wireguard,omitempty" protobuf:"13"`

	// Configuration layer.
	ConfigLayer ConfigLayer `yaml:"layer" protobuf:"14"`
}

LinkSpecSpec describes spec for the link.

func (LinkSpecSpec) DeepCopy added in v1.1.0

func (o LinkSpecSpec) DeepCopy() LinkSpecSpec

DeepCopy generates a deep copy of LinkSpecSpec.

func (*LinkSpecSpec) Merge

func (spec *LinkSpecSpec) Merge(other *LinkSpecSpec) error

Merge with other, overwriting fields from other if set.

type LinkStatus

LinkStatus resource holds physical network link status.

func NewLinkStatus

func NewLinkStatus(namespace resource.Namespace, id resource.ID) *LinkStatus

NewLinkStatus initializes a LinkStatus resource.

type LinkStatusRD added in v1.1.0

type LinkStatusRD struct{}

LinkStatusRD provides auxiliary methods for LinkStatus.

func (LinkStatusRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type LinkStatusSpec

type LinkStatusSpec struct {
	// Fields coming from rtnetlink API.
	Index            uint32                      `yaml:"index" protobuf:"1"`
	Type             nethelpers.LinkType         `yaml:"type" protobuf:"2"`
	LinkIndex        uint32                      `yaml:"linkIndex" protobuf:"3"`
	Flags            nethelpers.LinkFlags        `yaml:"flags" protobuf:"4"`
	HardwareAddr     nethelpers.HardwareAddr     `yaml:"hardwareAddr" protobuf:"5"`
	PermanentAddr    nethelpers.HardwareAddr     `yaml:"permanentAddr" protobuf:"30"`
	BroadcastAddr    nethelpers.HardwareAddr     `yaml:"broadcastAddr" protobuf:"6"`
	MTU              uint32                      `yaml:"mtu" protobuf:"7"`
	QueueDisc        string                      `yaml:"queueDisc" protobuf:"8"`
	MasterIndex      uint32                      `yaml:"masterIndex,omitempty" protobuf:"9"`
	OperationalState nethelpers.OperationalState `yaml:"operationalState" protobuf:"10"`
	Kind             string                      `yaml:"kind" protobuf:"11"`
	SlaveKind        string                      `yaml:"slaveKind" protobuf:"12"`
	BusPath          string                      `yaml:"busPath,omitempty" protobuf:"13"`
	PCIID            string                      `yaml:"pciID,omitempty" protobuf:"14"`
	Driver           string                      `yaml:"driver,omitempty" protobuf:"15"`
	DriverVersion    string                      `yaml:"driverVersion,omitempty" protobuf:"16"`
	FirmwareVersion  string                      `yaml:"firmwareVersion,omitempty" protobuf:"17"`
	ProductID        string                      `yaml:"productID,omitempty" protobuf:"18"`
	VendorID         string                      `yaml:"vendorID,omitempty" protobuf:"19"`
	Product          string                      `yaml:"product,omitempty" protobuf:"20"`
	Vendor           string                      `yaml:"vendor,omitempty" protobuf:"21"`
	// Fields coming from ethtool API.
	LinkState     bool              `yaml:"linkState" protobuf:"22"`
	SpeedMegabits int               `yaml:"speedMbit,omitempty" protobuf:"23"`
	Port          nethelpers.Port   `yaml:"port" protobuf:"24"`
	Duplex        nethelpers.Duplex `yaml:"duplex" protobuf:"25"`
	// Following fields are only populated with respective Kind.
	VLAN         VLANSpec         `yaml:"vlan,omitempty" protobuf:"26"`
	BridgeMaster BridgeMasterSpec `yaml:"bridgeMaster,omitempty" protobuf:"27"`
	BondMaster   BondMasterSpec   `yaml:"bondMaster,omitempty" protobuf:"28"`
	Wireguard    WireguardSpec    `yaml:"wireguard,omitempty" protobuf:"29"`
}

LinkStatusSpec describes status of rendered secrets.

func (LinkStatusSpec) DeepCopy added in v1.1.0

func (o LinkStatusSpec) DeepCopy() LinkStatusSpec

DeepCopy generates a deep copy of LinkStatusSpec.

func (LinkStatusSpec) Physical added in v1.1.0

func (s LinkStatusSpec) Physical() bool

Physical checks if the link is physical ethernet.

type NodeAddress

NodeAddress resource holds physical network link status.

func NewNodeAddress

func NewNodeAddress(namespace resource.Namespace, id resource.ID) *NodeAddress

NewNodeAddress initializes a NodeAddress resource.

type NodeAddressFilter

NodeAddressFilter resource holds filter for NodeAddress resources.

func NewNodeAddressFilter

func NewNodeAddressFilter(namespace resource.Namespace, id resource.ID) *NodeAddressFilter

NewNodeAddressFilter initializes a NodeAddressFilter resource.

type NodeAddressFilterRD added in v1.1.0

type NodeAddressFilterRD struct{}

NodeAddressFilterRD provides auxiliary methods for NodeAddressFilter.

func (NodeAddressFilterRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type NodeAddressFilterSpec

type NodeAddressFilterSpec struct {
	// Address is skipped if it doesn't match any of the includeSubnets (if includeSubnets is not empty).
	IncludeSubnets []netaddr.IPPrefix `yaml:"includeSubnets" protobuf:"1"`
	// Address is skipped if it matches any of the includeSubnets.
	ExcludeSubnets []netaddr.IPPrefix `yaml:"excludeSubnets" protobuf:"2"`
}

NodeAddressFilterSpec describes a filter for NodeAddresses.

func (NodeAddressFilterSpec) DeepCopy added in v1.1.0

DeepCopy generates a deep copy of NodeAddressFilterSpec.

type NodeAddressRD added in v1.1.0

type NodeAddressRD struct{}

NodeAddressRD provides auxiliary methods for NodeAddress.

func (NodeAddressRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type NodeAddressSpec

type NodeAddressSpec struct {
	Addresses []netaddr.IPPrefix `yaml:"addresses" protobuf:"1"`
}

NodeAddressSpec describes a set of node addresses.

func (NodeAddressSpec) DeepCopy added in v1.1.0

func (o NodeAddressSpec) DeepCopy() NodeAddressSpec

DeepCopy generates a deep copy of NodeAddressSpec.

func (*NodeAddressSpec) IPs

func (spec *NodeAddressSpec) IPs() []netaddr.IP

IPs returns IP without prefix.

type Operator

type Operator int

Operator enumerates Talos network operators.

const (
	OperatorDHCP4 Operator = iota // dhcp4
	OperatorDHCP6                 // dhcp6
	OperatorVIP                   // vip
)

Operator list.

func OperatorString added in v1.0.0

func OperatorString(s string) (Operator, error)

OperatorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func OperatorValues added in v1.0.0

func OperatorValues() []Operator

OperatorValues returns all values of the enum

func (Operator) IsAOperator added in v1.0.0

func (i Operator) IsAOperator() bool

IsAOperator returns "true" if the value is listed in the enum definition. "false" otherwise

func (Operator) MarshalText added in v1.0.0

func (i Operator) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for Operator

func (Operator) String

func (i Operator) String() string

func (*Operator) UnmarshalText added in v1.0.0

func (i *Operator) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for Operator

type OperatorSpec

OperatorSpec resource holds DNS resolver info.

func NewOperatorSpec

func NewOperatorSpec(namespace resource.Namespace, id resource.ID) *OperatorSpec

NewOperatorSpec initializes a OperatorSpec resource.

type OperatorSpecRD added in v1.1.0

type OperatorSpecRD struct{}

OperatorSpecRD provides auxiliary methods for OperatorSpec.

func (OperatorSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type OperatorSpecSpec

type OperatorSpecSpec struct {
	Operator  Operator `yaml:"operator" protobuf:"1"`
	LinkName  string   `yaml:"linkName" protobuf:"2"`
	RequireUp bool     `yaml:"requireUp" protobuf:"3"`

	DHCP4 DHCP4OperatorSpec `yaml:"dhcp4,omitempty" protobuf:"4"`
	DHCP6 DHCP6OperatorSpec `yaml:"dhcp6,omitempty" protobuf:"5"`
	VIP   VIPOperatorSpec   `yaml:"vip,omitempty" protobuf:"6"`

	ConfigLayer ConfigLayer `yaml:"layer" protobuf:"7"`
}

OperatorSpecSpec describes DNS resolvers.

func (OperatorSpecSpec) DeepCopy added in v1.1.0

func (o OperatorSpecSpec) DeepCopy() OperatorSpecSpec

DeepCopy generates a deep copy of OperatorSpecSpec.

type ReadyCondition

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

ReadyCondition implements condition which waits for the network to be ready.

func NewReadyCondition

func NewReadyCondition(state state.State, checks ...StatusCheck) *ReadyCondition

NewReadyCondition builds a coondition which waits for the network to be ready.

func (*ReadyCondition) String

func (condition *ReadyCondition) String() string

func (*ReadyCondition) Wait

func (condition *ReadyCondition) Wait(ctx context.Context) error

Wait implements condition interface.

type ResolverSpec

ResolverSpec resource holds DNS resolver info.

func NewResolverSpec

func NewResolverSpec(namespace resource.Namespace, id resource.ID) *ResolverSpec

NewResolverSpec initializes a ResolverSpec resource.

type ResolverSpecRD added in v1.1.0

type ResolverSpecRD struct{}

ResolverSpecRD provides auxiliary methods for ResolverSpec.

func (ResolverSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type ResolverSpecSpec

type ResolverSpecSpec struct {
	DNSServers  []netaddr.IP `yaml:"dnsServers" protobuf:"1"`
	ConfigLayer ConfigLayer  `yaml:"layer" protobuf:"2"`
}

ResolverSpecSpec describes DNS resolvers.

func (ResolverSpecSpec) DeepCopy added in v1.1.0

func (o ResolverSpecSpec) DeepCopy() ResolverSpecSpec

DeepCopy generates a deep copy of ResolverSpecSpec.

type ResolverStatus

ResolverStatus resource holds DNS resolver info.

func NewResolverStatus

func NewResolverStatus(namespace resource.Namespace, id resource.ID) *ResolverStatus

NewResolverStatus initializes a ResolverStatus resource.

type ResolverStatusRD added in v1.1.0

type ResolverStatusRD struct{}

ResolverStatusRD provides auxiliary methods for ResolverStatus.

func (ResolverStatusRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type ResolverStatusSpec

type ResolverStatusSpec struct {
	DNSServers []netaddr.IP `yaml:"dnsServers" protobuf:"1"`
}

ResolverStatusSpec describes DNS resolvers.

func (ResolverStatusSpec) DeepCopy added in v1.1.0

DeepCopy generates a deep copy of ResolverStatusSpec.

type RouteSpec

RouteSpec resource holds route specification to be applied to the kernel.

func NewRouteSpec

func NewRouteSpec(namespace resource.Namespace, id resource.ID) *RouteSpec

NewRouteSpec initializes a RouteSpec resource.

type RouteSpecRD added in v1.1.0

type RouteSpecRD struct{}

RouteSpecRD provides auxiliary methods for RouteSpec.

func (RouteSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type RouteSpecSpec

type RouteSpecSpec struct {
	Family      nethelpers.Family        `yaml:"family" protobuf:"1"`
	Destination netaddr.IPPrefix         `yaml:"dst" protobuf:"2"`
	Source      netaddr.IP               `yaml:"src" protobuf:"3"`
	Gateway     netaddr.IP               `yaml:"gateway" protobuf:"4"`
	OutLinkName string                   `yaml:"outLinkName,omitempty" protobuf:"5"`
	Table       nethelpers.RoutingTable  `yaml:"table" protobuf:"6"`
	Priority    uint32                   `yaml:"priority,omitempty" protobuf:"7"`
	Scope       nethelpers.Scope         `yaml:"scope" protobuf:"8"`
	Type        nethelpers.RouteType     `yaml:"type" protobuf:"9"`
	Flags       nethelpers.RouteFlags    `yaml:"flags" protobuf:"10"`
	Protocol    nethelpers.RouteProtocol `yaml:"protocol" protobuf:"11"`
	ConfigLayer ConfigLayer              `yaml:"layer" protobuf:"12"`
}

RouteSpecSpec describes the route.

func (RouteSpecSpec) DeepCopy added in v1.1.0

func (o RouteSpecSpec) DeepCopy() RouteSpecSpec

DeepCopy generates a deep copy of RouteSpecSpec.

func (*RouteSpecSpec) Normalize

func (route *RouteSpecSpec) Normalize()

Normalize converts 0.0.0.0 to zero value.

type RouteStatus

RouteStatus resource holds physical network link status.

func NewRouteStatus

func NewRouteStatus(namespace resource.Namespace, id resource.ID) *RouteStatus

NewRouteStatus initializes a RouteStatus resource.

type RouteStatusRD added in v1.1.0

type RouteStatusRD struct{}

RouteStatusRD provides auxiliary methods for RouteStatus.

func (RouteStatusRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type RouteStatusSpec

type RouteStatusSpec struct {
	Family       nethelpers.Family        `yaml:"family" protobuf:"1"`
	Destination  netaddr.IPPrefix         `yaml:"dst" protobuf:"2"`
	Source       netaddr.IP               `yaml:"src" protobuf:"3"`
	Gateway      netaddr.IP               `yaml:"gateway" protobuf:"4"`
	OutLinkIndex uint32                   `yaml:"outLinkIndex,omitempty" protobuf:"5"`
	OutLinkName  string                   `yaml:"outLinkName,omitempty" protobuf:"6"`
	Table        nethelpers.RoutingTable  `yaml:"table" protobuf:"7"`
	Priority     uint32                   `yaml:"priority" protobuf:"8"`
	Scope        nethelpers.Scope         `yaml:"scope" protobuf:"9"`
	Type         nethelpers.RouteType     `yaml:"type" protobuf:"10"`
	Flags        nethelpers.RouteFlags    `yaml:"flags" protobuf:"11"`
	Protocol     nethelpers.RouteProtocol `yaml:"protocol" protobuf:"12"`
}

RouteStatusSpec describes status of rendered secrets.

func (RouteStatusSpec) DeepCopy added in v1.1.0

func (o RouteStatusSpec) DeepCopy() RouteStatusSpec

DeepCopy generates a deep copy of RouteStatusSpec.

type STPSpec added in v1.2.0

type STPSpec struct {
	Enabled bool `yaml:"enabled" protobuf:"1"`
}

STPSpec describes Spanning Tree Protocol (STP) settings of a bridge.

type Status

type Status = typed.Resource[StatusSpec, StatusRD]

Status resource holds status of networking setup.

func NewStatus

func NewStatus(namespace resource.Namespace, id resource.ID) *Status

NewStatus initializes a Status resource.

type StatusCheck

type StatusCheck func(*StatusSpec) bool

StatusCheck asserts specific part of Status to be true.

func StatusChecksFromStatuses added in v1.0.0

func StatusChecksFromStatuses(statuses ...nethelpers.Status) []StatusCheck

StatusChecksFromStatuses converts nethelpers.Status list into list of checks.

type StatusRD added in v1.1.0

type StatusRD struct{}

StatusRD provides auxiliary methods for Status.

func (StatusRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type StatusSpec

type StatusSpec struct {
	AddressReady      bool `yaml:"addressReady" protobuf:"1"`
	ConnectivityReady bool `yaml:"connectivityReady" protobuf:"2"`
	HostnameReady     bool `yaml:"hostnameReady" protobuf:"3"`
	EtcFilesReady     bool `yaml:"etcFilesReady" protobuf:"4"`
}

StatusSpec describes network state.

func (StatusSpec) DeepCopy added in v1.1.0

func (o StatusSpec) DeepCopy() StatusSpec

DeepCopy generates a deep copy of StatusSpec.

type TimeServerSpec

TimeServerSpec resource holds NTP server info.

func NewTimeServerSpec

func NewTimeServerSpec(namespace resource.Namespace, id resource.ID) *TimeServerSpec

NewTimeServerSpec initializes a TimeServerSpec resource.

type TimeServerSpecRD added in v1.1.0

type TimeServerSpecRD struct{}

TimeServerSpecRD provides auxiliary methods for TimeServerSpec.

func (TimeServerSpecRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type TimeServerSpecSpec

type TimeServerSpecSpec struct {
	NTPServers  []string    `yaml:"timeServers" protobuf:"1"`
	ConfigLayer ConfigLayer `yaml:"layer" protobuf:"2"`
}

TimeServerSpecSpec describes NTP servers.

func (TimeServerSpecSpec) DeepCopy added in v1.1.0

DeepCopy generates a deep copy of TimeServerSpecSpec.

type TimeServerStatus

TimeServerStatus resource holds NTP server info.

func NewTimeServerStatus

func NewTimeServerStatus(namespace resource.Namespace, id resource.ID) *TimeServerStatus

NewTimeServerStatus initializes a TimeServerStatus resource.

type TimeServerStatusRD added in v1.1.0

type TimeServerStatusRD struct{}

TimeServerStatusRD provides auxiliary methods for TimeServerStatus.

func (TimeServerStatusRD) ResourceDefinition added in v1.1.0

ResourceDefinition implements typed.ResourceDefinition interface.

type TimeServerStatusSpec

type TimeServerStatusSpec struct {
	NTPServers []string `yaml:"timeServers" protobuf:"1"`
}

TimeServerStatusSpec describes NTP servers.

func (TimeServerStatusSpec) DeepCopy added in v1.1.0

DeepCopy generates a deep copy of TimeServerStatusSpec.

type ULAPurpose

type ULAPurpose byte

ULAPurpose is the Unique Local Addressing key for the Talos-specific purpose of the prefix.

type VIPEquinixMetalSpec

type VIPEquinixMetalSpec struct {
	ProjectID string `yaml:"projectID" protobuf:"1"`
	DeviceID  string `yaml:"deviceID" protobuf:"2"`
	APIToken  string `yaml:"apiToken" protobuf:"3"`
}

VIPEquinixMetalSpec describes virtual (elastic) IP settings for Equinix Metal.

type VIPHCloudSpec

type VIPHCloudSpec struct {
	DeviceID  int    `yaml:"deviceID" protobuf:"1"`
	NetworkID int    `yaml:"networkID" protobuf:"2"`
	APIToken  string `yaml:"apiToken" protobuf:"3"`
}

VIPHCloudSpec describes virtual (elastic) IP settings for Hetzner Cloud.

type VIPOperatorSpec

type VIPOperatorSpec struct {
	IP            netaddr.IP `yaml:"ip" protobuf:"1"`
	GratuitousARP bool       `yaml:"gratuitousARP" protobuf:"2"`

	EquinixMetal VIPEquinixMetalSpec `yaml:"equinixMetal,omitempty" protobuf:"3"`
	HCloud       VIPHCloudSpec       `yaml:"hcloud,omitempty" protobuf:"4"`
}

VIPOperatorSpec describes virtual IP operator options.

type VLANSpec

type VLANSpec struct {
	// VID is the vlan ID.
	VID uint16 `yaml:"vlanID" protobuf:"1"`

	// Protocol is the vlan protocol.
	Protocol nethelpers.VLANProtocol `yaml:"vlanProtocol" protobuf:"2"`
}

VLANSpec describes VLAN settings if Kind == "vlan".

func (VLANSpec) ID added in v1.2.0

func (vlan VLANSpec) ID() uint16

ID Returns the VID for type VLANSpec.

func (VLANSpec) MTU added in v1.2.0

func (vlan VLANSpec) MTU() uint32

MTU Returns MTU=0 for type VLANSpec.

type WireguardPeer

type WireguardPeer struct {
	PublicKey                   string             `yaml:"publicKey" protobuf:"1"`
	PresharedKey                string             `yaml:"presharedKey" protobuf:"2"`
	Endpoint                    string             `yaml:"endpoint" protobuf:"3"`
	PersistentKeepaliveInterval time.Duration      `yaml:"persistentKeepaliveInterval" protobuf:"4"`
	AllowedIPs                  []netaddr.IPPrefix `yaml:"allowedIPs" protobuf:"5"`
}

WireguardPeer describes a single peer.

func (*WireguardPeer) Equal

func (peer *WireguardPeer) Equal(other *WireguardPeer) bool

Equal checks two WireguardPeer structs for equality.

`spec` is considered to be the result of getting current Wireguard configuration, while `other` is the new (updated configuration).

type WireguardSpec

type WireguardSpec struct {
	// PrivateKey is used to configure the link, present only in the LinkSpec.
	PrivateKey string `yaml:"privateKey,omitempty" protobuf:"1"`
	// PublicKey is only used in LinkStatus to show the link status.
	PublicKey    string          `yaml:"publicKey,omitempty" protobuf:"2"`
	ListenPort   int             `yaml:"listenPort" protobuf:"3"`
	FirewallMark int             `yaml:"firewallMark" protobuf:"4"`
	Peers        []WireguardPeer `yaml:"peers" protobuf:"5"`
}

WireguardSpec describes Wireguard settings if Kind == "wireguard".

func (*WireguardSpec) Equal

func (spec *WireguardSpec) Equal(other *WireguardSpec) bool

Equal checks two WireguardSpecs for equality.

Both specs should be sorted before calling this method.

`spec` is considered to be the result of getting current Wireguard configuration, while `other` is the new (updated configuration).

func (*WireguardSpec) IsZero

func (spec *WireguardSpec) IsZero() bool

IsZero checks if the WireguardSpec is zero value.

func (*WireguardSpec) Merge

func (spec *WireguardSpec) Merge(other WireguardSpec)

Merge with other Wireguard spec overwriting non-zero values.

func (*WireguardSpec) Sort

func (spec *WireguardSpec) Sort()

Sort the spec so that comparison is possible.

Jump to

Keyboard shortcuts

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