Skip to content
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

Add support for setting VLAN in network devices through config #329

Open
wants to merge 1 commit into
base: 0.7
Choose a base branch
from

Conversation

Luzifer
Copy link

@Luzifer Luzifer commented Nov 19, 2024

Issue #, if available: #303

Description of changes:

  • Add VLAN, SECONDARY_VLAN and EXT_SERVICE_VLAN variables to the template to configure VLAN on the network devices

Testing performed:

  • Tested generation of template with and without VLAN set: Expected behavior, without ENV-var a kubectl describe shows no configured vlan, with VLAN set to 2 it shows vlan: 2.

@Luzifer Luzifer self-assigned this Nov 19, 2024
Copy link
Member

@mcbenjemaa mcbenjemaa left a comment

Choose a reason for hiding this comment

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

LGTM

@mcbenjemaa
Copy link
Member

anything missing?

docs/Usage.md Show resolved Hide resolved
@@ -91,6 +91,7 @@ GATEWAY: "10.10.10.1" # The gateway for
IP_PREFIX: "25" # Subnet Mask in CIDR notation for your node IP ranges
DNS_SERVERS: "[8.8.8.8,8.8.4.4]" # The dns nameservers for the machines network-config.
BRIDGE: "vmbr1" # The network bridge device for Proxmox VE VMs
VLAN: "2" # (optional) The VLAN to put the bridge device into
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
VLAN: "2" # (optional) The VLAN to put the bridge device into
VLAN: "2" # The VLAN to put the bridge device into

Copy link
Member

Choose a reason for hiding this comment

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

if you want, you can also set the default value in the template. so it's considered optional.

Copy link
Author

@Luzifer Luzifer Nov 22, 2024

Choose a reason for hiding this comment

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

I think setting it mandatory would break the previous flow as existing configs used to generate the templates will complain. Need to have a look which default works here. From *uint16 it should be null… 🤔

Copy link
Author

Choose a reason for hiding this comment

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

Updated the templates to have a null default value.

Copy link
Member

Choose a reason for hiding this comment

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

the null will not work for most cases,
and you don't need to add VLAN to all cluster templates.

Copy link
Author

Choose a reason for hiding this comment

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

Why will the null not work? The default of an unset pointer is null and the type is a *uint16… 🤔

@Luzifer Luzifer linked an issue Nov 25, 2024 that may be closed by this pull request
@Luzifer Luzifer added this to the v0.7.0 milestone Nov 26, 2024
Copy link
Collaborator

@65278 65278 left a comment

Choose a reason for hiding this comment

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

The "VLAN" field doesn't actually select or add a vlan, it only adds a tag. It's basically broken, and we should fix documentation on this (or remove). This is also why it's not in the templates.

Edit: I'll word it more clearly, this tells the bridge in proxmox (on the hypervisor) to tag with a vlan id, which only works in certain hypervisor configurations. In general you're expected to create a bridge per vlan id you want.

@Luzifer
Copy link
Author

Luzifer commented Nov 27, 2024

It's basically broken, and we should fix documentation on this (or remove). This is also why it's not in the templates.

So if it is basically broken, we can close this PR and the related issue?

@65278
Copy link
Collaborator

65278 commented Nov 27, 2024

It may or may not work depending on how you set up your proxmox servers, it's like tagging a port in a switch, rather than creating a vlan in the deployed machine.
I'm okay with the PR in general, but please clarify the docs on this in the CRD if you push it into the templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add vlan to 'clusterctl generate'
3 participants