-
Notifications
You must be signed in to change notification settings - Fork 56
Description
v1alpha1 has problems in the networking department which will require breaking changes.
Specifically, ProxmoxMachines have a split of default network device and additional network devices for no reason that I can discern. This duplicates code pathes everywhere and actually removes possibilities (due to how network interfaces are structured in the API, default doesn't have options that other interfaces have).
On top of that, the split of IPv4 and IPv6 pools is arbitrary (makes no sense), and we can simply get away with having an array of IPPools. This also allows multiple IPPools per interface, a feature which we can not support yet. On top of that, we possibly want to support network interfaces without IPPools attached (DHCP, BGP exclusively).
For now I'd change the API of ProxmoxMachines in the following way:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: ProxmoxMachineTemplate
metadata:
name: test-cluster-control-plane
namespace: default
spec:
template:
spec:
disks:
bootVolume:
disk: scsi0
sizeGb: 100
format: qcow2
full: true
memoryMiB: 4096
network:
networkDevices:
- bridge: vmbr128
model: virtio
mtu: 9000
- bridge: vmbr129
dnsServers:
- 10.4.1.1
ipPoolRef:
- apiGroup: ipam.cluster.x-k8s.io
kind: GlobalInClusterIPPool
name: shared-int-service-v4-inclusterippool
- apiGroup: ipam.cluster.x-k8s.io
kind: GlobalInClusterIPPool
name: shared-int-service-v6-inclusterippool
model: virtio
name: net1
linkMtu: 9000
numCores: 4
numSockets: 2
sourceNode: proxmox1
templateID: 100I would resolve the conflicts about the first network device by appending the InclusterIPPool in front of the ipPoolRef array. There's no need for the first device to be called net0, but we can make the webhook add names automatically as per their position in the array.
Regarding ProxmoxCluster, I'd leave the API as is, because a Cluster can only have an IPv4 and/or an IPv6 pool. Potentially, we want to add DHCP there, but that's not a breaking change as far as I can see. We can discuss turning IPv4Pool and IPv6Pool into an actual pool reference that we supply with the cluster, which I think is the better choice, but this would be just breakage for breakages sake (we only get better validation on the to be created pool).
Anything else you would like to add:
If you have any more things you'd like to change about the API, lets coordinate here. Feedback very welcome.