Skip to content

[feat] Add support for new network interfaces #821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions api/v1alpha2/linodemachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ type LinodeMachineSpec struct {
BackupID int `json:"backupID,omitempty"`
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Image string `json:"image,omitempty"`
// Interfaces is a list of legacy network interfaces to use for the instance.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Interfaces []InstanceConfigInterfaceCreateOptions `json:"interfaces,omitempty"`
// LinodeInterfaces is a list of Linode network interfaces to use for the instance. Requires Linode Interfaces beta opt-in to use.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
// +kubebuilder:object:generate=true
LinodeInterfaces []LinodeInterfaceCreateOptions `json:"linodeInterfaces,omitempty"`
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
BackupsEnabled bool `json:"backupsEnabled,omitempty"`
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
Expand Down Expand Up @@ -125,6 +130,13 @@ type LinodeMachineSpec struct {
// For more information, see https://techdocs.akamai.com/cloud-computing/docs/automatically-configure-networking
// Defaults to true.
NetworkHelper *bool `json:"networkHelper,omitempty"`

// InterfaceGeneration is the generation of the interface to use for the cluster's

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling to parse that. Should that be "...for the cluster's nodes IF interface / linodeInterface are not specified for a LinodeMachine"? If not, I'm not sure what it means. But then again, I don't really know what I'm talking about in this domain...

Feel free to resolve this comment into oblivion.

// nodes in interface / linodeInterface are not specified for a LinodeMachine.
// If not set, defaults to "legacy_config".
// +kubebuilder:validation:Enum=legacy_config;linode
// +kubebuilder:default=legacy_config
InterfaceGeneration linodego.InterfaceGeneration `json:"interfaceGeneration,omitempty"`
}

// IPv6CreateOptions defines the IPv6 options for the instance.
Expand Down Expand Up @@ -194,6 +206,96 @@ type InstanceConfigInterfaceCreateOptions struct {
IPRanges []string `json:"ipRanges,omitempty"`
}

// LinodeInterfaceCreateOptions defines the linode network interface config
type LinodeInterfaceCreateOptions struct {
FirewallID *int `json:"firewall_id,omitempty"`
DefaultRoute *InterfaceDefaultRoute `json:"default_route,omitempty"`
Public *PublicInterfaceCreateOptions `json:"public,omitempty"`
VPC *VPCInterfaceCreateOptions `json:"vpc,omitempty"`
VLAN *VLANInterface `json:"vlan,omitempty"`
}

// InterfaceDefaultRoute defines the default IPv4 and IPv6 routes for an interface
type InterfaceDefaultRoute struct {
IPv4 *bool `json:"ipv4,omitempty"`
IPv6 *bool `json:"ipv6,omitempty"`
}

// PublicInterfaceCreateOptions defines the IPv4 and IPv6 public interface create options
type PublicInterfaceCreateOptions struct {
IPv4 *PublicInterfaceIPv4CreateOptions `json:"ipv4,omitempty"`
IPv6 *PublicInterfaceIPv6CreateOptions `json:"ipv6,omitempty"`
}

// PublicInterfaceIPv4CreateOptions defines the PublicInterfaceIPv4AddressCreateOptions for addresses
type PublicInterfaceIPv4CreateOptions struct {
Addresses []PublicInterfaceIPv4AddressCreateOptions `json:"addresses,omitempty"`
}

// PublicInterfaceIPv4AddressCreateOptions defines the public IPv4 address and whether it is primary
type PublicInterfaceIPv4AddressCreateOptions struct {
Address string `json:"address"`
Primary *bool `json:"primary,omitempty"`
}

// PublicInterfaceIPv6CreateOptions defines the PublicInterfaceIPv6RangeCreateOptions
type PublicInterfaceIPv6CreateOptions struct {
Ranges []PublicInterfaceIPv6RangeCreateOptions `json:"ranges,omitempty"`
}

// PublicInterfaceIPv6RangeCreateOptions defines the IPv6 range for a public interface
type PublicInterfaceIPv6RangeCreateOptions struct {
Range string `json:"range"`
}

// VPCInterfaceCreateOptions defines the VPC interface configuration for an instance
type VPCInterfaceCreateOptions struct {
SubnetID int `json:"subnet_id"`
IPv4 *VPCInterfaceIPv4CreateOptions `json:"ipv4,omitempty"`
IPv6 *VPCInterfaceIPv6CreateOptions `json:"ipv6,omitempty"`
}

// VPCInterfaceIPv6CreateOptions defines the IPv6 configuration for a VPC interface
type VPCInterfaceIPv6CreateOptions struct {
SLAAC []VPCInterfaceIPv6SLAACCreateOptions `json:"slaac,omitempty"`
Ranges []VPCInterfaceIPv6RangeCreateOptions `json:"ranges,omitempty"`
IsPublic bool `json:"is_public"`
}

// VPCInterfaceIPv6SLAACCreateOptions defines the Range for IPv6 SLAAC
type VPCInterfaceIPv6SLAACCreateOptions struct {
Range string `json:"range"`
}

// VPCInterfaceIPv6RangeCreateOptions defines the IPv6 range for a VPC interface
type VPCInterfaceIPv6RangeCreateOptions struct {
Range string `json:"range"`
}

// VPCInterfaceIPv4CreateOptions defines the IPv4 address and range configuration for a VPC interface
type VPCInterfaceIPv4CreateOptions struct {
Addresses []VPCInterfaceIPv4AddressCreateOptions `json:"addresses,omitempty"`
Ranges []VPCInterfaceIPv4RangeCreateOptions `json:"ranges,omitempty"`
}

// VPCInterfaceIPv4AddressCreateOptions defines the IPv4 configuration for a VPC interface
type VPCInterfaceIPv4AddressCreateOptions struct {
Address string `json:"address"`
Primary *bool `json:"primary,omitempty"`
NAT1To1Address *string `json:"nat_1_1_address,omitempty"`
}

// VPCInterfaceIPv4RangeCreateOptions defines the IPv4 range for a VPC interface
type VPCInterfaceIPv4RangeCreateOptions struct {
Range string `json:"range"`
}

// VLANInterface defines the VLAN interface configuration for an instance
type VLANInterface struct {
VLANLabel string `json:"vlan_label"`
IPAMAddress *string `json:"ipam_address,omitempty"`
}

// VPCIPv4 defines VPC IPV4 settings
type VPCIPv4 struct {
VPC string `json:"vpc,omitempty"`
Expand Down
Loading
Loading