ionos-cloud / cluster-api-provider-proxmox

Cluster API Provider for Proxmox VE (CAPMOX)
Apache License 2.0
182 stars 24 forks source link

Would it be possible to add vlan tag support? #175

Closed CloudFireSrl closed 5 months ago

CloudFireSrl commented 6 months ago
          Would it be possible to add vlan tag support at the same time?

Originally posted by @mkamsikad2 in https://github.com/ionos-cloud/cluster-api-provider-proxmox/issues/29#issuecomment-1906072942

Hi everyone, as @mkamsikad2 mentioned some months ago, can vlan tag support be added during VM's creation?

It could be handy feature.

Thank you, Fabio

CiraciNicolo commented 6 months ago

Hi! The PR #133 implements just that ☺️

wikkyk commented 5 months ago

VLAN tag support contributed by @CiraciNicolo has been released with 0.4.0. Enjoy!

lnxu303 commented 5 months ago

Hello,

@CiraciNicolo / @wikkyk thank you very much for adding support for VLAN tagging! Could you please explain how to make use of this feature? I tried to add VLAN: XY to the networking config in clusterctl.yaml but to no avail. After executing clusterctl generate cluster proxmox-quickstart ... > cluster.yaml there was no mention of VLANs in the generated manifests. I then tried to add the property vlan manually to the ProxmoxMachineTemplate spec (network.default.vlan: 16) after reviewing the changes from the PR but when I try to kubectl apply -f cluster.yaml, I get the following error:

kubectl apply -f cluster.yaml
cluster.cluster.x-k8s.io/proxmox-quickstart created
proxmoxcluster.infrastructure.cluster.x-k8s.io/proxmox-quickstart created
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/proxmox-quickstart-control-plane created
proxmoxmachinetemplate.infrastructure.cluster.x-k8s.io/proxmox-quickstart-control-plane created
machinedeployment.cluster.x-k8s.io/proxmox-quickstart-workers created
error: error parsing cluster.yaml: error converting YAML to JSON: yaml: line 19: did not find expected key

The source of the error seems to be in the ProxmoxMachineTemplate proxmox-quickstart-worker. I'm confused, as this seems to work for control plane nodes. Am I missing something obvious here?

Thanks for your help!

CiraciNicolo commented 5 months ago

Can you please post your generated files? And maybe describe a little bit more what you are doing? Thanks.

lnxu303 commented 5 months ago

Nevermind, it was just a missing space. Sorry for bothering you. Thanks for your work on this project :) After adding vlan: XY to the generated manifest, the cloned VMs had their VLAN tag set correctly 🎉