Skip to content

feat(): layer2 support for CAPP #787

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

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
05cbc0c
API and CRD changes for adding layer2 support
rahulii Aug 22, 2024
15aaba7
json tag fix
rahulii Aug 22, 2024
ebfddac
change ipAddressReservation to address
rahulii Aug 29, 2024
1d2b71e
make changes to the api as per design doc changes
rahulii Sep 17, 2024
e1a19b5
minor change
rahulii Sep 17, 2024
cdf7155
api changes and user-data implementation
rahulii Sep 25, 2024
4cfb7b8
add IPAddressManagement Service
rahulii Sep 26, 2024
f762e5b
merge bootstrap and layer2 cloud configs
rahulii Oct 8, 2024
a452289
add unit test cases
rahulii Oct 8, 2024
5f33a86
ipam support
vardhaman-surana Oct 8, 2024
aad4223
added rbac
vardhaman-surana Oct 8, 2024
25510bd
minor fix
rahulii Oct 9, 2024
16fdf8d
reconcile port settings for layer2 and bonded port
rahulii Oct 10, 2024
b7e1120
minor fix
rahulii Oct 11, 2024
fcfcaac
refactor code and add static routes
rahulii Oct 11, 2024
b7e871a
bug fix
rahulii Oct 11, 2024
ddf37d9
Merge pull request #1 from rahulii/ipam
rahulii Oct 11, 2024
d901fe6
delete unused code
rahulii Oct 11, 2024
c55ea3f
minor fix
rahulii Oct 14, 2024
4c64c5d
minor fix
rahulii Oct 14, 2024
d4d4b25
change failure to failed in state
rahulii Oct 14, 2024
4d30dcc
added ipaddress claim deletion
vardhaman-surana Oct 14, 2024
4f9c8fc
Merge pull request #2 from vardhaman-surana/ipaddressclaim-deletion
rahulii Oct 14, 2024
4efbfd8
add logs
rahulii Oct 14, 2024
07516df
add routes at network file and change user-data to make them persistent
rahulii Oct 15, 2024
6207973
fix a bug where multiple vxlans are involved
rahulii Oct 16, 2024
7e68faf
update design docs
rahulii Oct 21, 2024
475365c
update design docs
rahulii Oct 22, 2024
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
29 changes: 29 additions & 0 deletions api/v1beta1/packetmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,35 @@ type PacketMachineSpec struct {
// Tags is an optional set of tags to add to Packet resources managed by the Packet provider.
// +optional
Tags Tags `json:"tags,omitempty"`

// Ports is an optional set of configurations for configuring layer2 seetings in a machine.
// +optional
Ports []Port `json:"ports,omitempty"`
}
// Port defines the Layer2(VLAN) Configuration that needs to be done on a port (eg: bond0)
type Port struct {
// name of the port e.g bond0,eth0 and eth1 for 2 NIC servers.
Name string `json:"name"`
// port bonded or not.
Bonded bool `json:"bonded,omitempty"`
// convert port to layer 2. is false by default on new devices. changes result in /ports/id/convert/layer-[2|3] API calls
Layer2 bool `json:"layer2,omitempty"`
// IPAddress configurations associated with this port
// These are typically IP Reservations carved out of VRF.
IPAddresses []IPAddress `json:"ipAddresses,omitempty"`
}
// IPAddress represents an IP address configuration on the Port.
type IPAddress struct {
// IPAddressReservation to reserve for these cluster nodes.
// for eg: can be carved out of a VRF IP Range.
IPAddressReservation string `json:"ipAddressReservation"`
// VLANs for EM API to find by vxlan, project, and metro match then attach to device. OS userdata template will also configure this VLAN on the bond device
VXLANIDs []string `json:"vxlanIDs,omitempty"`
// UUID of VLANs to which this port should be assigned.
// Either VXLANID or VLANID should be provided.
VLANIDs []string `json:"vlanIDs,omitempty"`
// IP Address of the gateway
Gateway string `json:"gateway,omitempty"`
}

// PacketMachineStatus defines the observed state of PacketMachine.
Expand Down
54 changes: 54 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,63 @@ spec:
type: string
os:
type: string
ports:
description: Ports is an optional set of configurations for configuring
layer2 seetings in a machine.
items:
description: 'Port defines the Layer2(VLAN) Configuration that needs
to be done on a port (eg: bond0)'
properties:
bonded:
description: port bonded or not.
type: boolean
ipAddresses:
description: |-
IPAddress configurations associated with this port
These are typically IP Reservations carved out of VRF.
items:
description: IPAddress represents an IP address configuration
on the Port.
properties:
gateway:
description: IP Address of the gateway
type: string
ipAddressReservation:
description: |-
IPAddressReservation to reserve for these cluster nodes.
for eg: can be carved out of a VRF IP Range.
type: string
vlanIDs:
description: |-
UUID of VLANs to which this port should be assigned.
Either VXLANID or VLANID should be provided.
items:
type: string
type: array
vxlanIDs:
description: VLANs for EM API to find by vxlan, project,
and metro match then attach to device. OS userdata template
will also configure this VLAN on the bond device
items:
type: string
type: array
required:
- ipAddressReservation
type: object
type: array
layer2:
description: convert port to layer 2. is false by default on
new devices. changes result in /ports/id/convert/layer-[2|3]
API calls
type: boolean
name:
description: name of the port e.g bond0,eth0 and eth1 for 2
NIC servers.
type: string
required:
- name
type: object
type: array
providerID:
description: ProviderID is the unique identifier as specified by the
cloud provider.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,64 @@ spec:
type: string
os:
type: string
ports:
description: Ports is an optional set of configurations for
configuring layer2 seetings in a machine.
items:
description: 'Port defines the Layer2(VLAN) Configuration
that needs to be done on a port (eg: bond0)'
properties:
bonded:
description: port bonded or not.
type: boolean
ipAddresses:
description: |-
IPAddress configurations associated with this port
These are typically IP Reservations carved out of VRF.
items:
description: IPAddress represents an IP address configuration
on the Port.
properties:
gateway:
description: IP Address of the gateway
type: string
ipAddressReservation:
description: |-
IPAddressReservation to reserve for these cluster nodes.
for eg: can be carved out of a VRF IP Range.
type: string
vlanIDs:
description: |-
UUID of VLANs to which this port should be assigned.
Either VXLANID or VLANID should be provided.
items:
type: string
type: array
vxlanIDs:
description: VLANs for EM API to find by vxlan,
project, and metro match then attach to device.
OS userdata template will also configure this
VLAN on the bond device
items:
type: string
type: array
required:
- ipAddressReservation
type: object
type: array
layer2:
description: convert port to layer 2. is false by default
on new devices. changes result in /ports/id/convert/layer-[2|3]
API calls
type: boolean
name:
description: name of the port e.g bond0,eth0 and eth1
for 2 NIC servers.
type: string
required:
- name
type: object
type: array
providerID:
description: ProviderID is the unique identifier as specified
by the cloud provider.
Expand Down