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

Dynamic value for LocalAPIEndpoint.AdvertiseAddress #98

Open
kreeuwijk opened this issue Sep 26, 2023 · 0 comments
Open

Dynamic value for LocalAPIEndpoint.AdvertiseAddress #98

kreeuwijk opened this issue Sep 26, 2023 · 0 comments

Comments

@kreeuwijk
Copy link

kreeuwijk commented Sep 26, 2023

Can we make initCfg.LocalAPIEndpoint and joinCfg.LocalAPIEndpoint more dynamic?

Currently the kubeadm init and join automation hardcode the AdvertiseAddress:

LocalAPIEndpoint: kubeadmapiv3.APIEndpoint{
	AdvertiseAddress: "0.0.0.0",
},

This will make kubeadm auto-detect the network interface to use and results in the interface containing the default gateway to be selected. But in situations where that is undesirable, we have no way of changing it as no option is provided to inform the provider that we want a different value.

For example, I’m working on a setup where the Kubernetes cluster runs on a VXLAN interface, allowing the host nodes to run on DHCP networks with changing addresses, while the IP addressing for the cluster remains static on the VXLAN. This requires the AdvertiseAddress to be the host’s VXLAN IP and not the regular IP.

Can we add an option for the user to provide the CIDR of the desired network interface to be used, and Kairos retrieving the IP from the system that matches the CIDR and passing that IP to LocalAPIEndpoint.AdvertiseAddress?

E.g. if the NIC layout is like this

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:b2:05:35 brd ff:ff:ff:ff:ff:ff
    inet 192.168.250.21/24 brd 192.168.250.255 scope global eth0
       valid_lft forever preferred_lft forever
3: vxlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 32:c4:48:df:03:11 brd ff:ff:ff:ff:ff:ff
    inet 100.64.192.11/24 brd 100.64.192.255 scope global vxlan0
       valid_lft forever preferred_lft forever

and the user specifies 100.64.192.0/24 as the desired CIDR, then the AdvertiseAddress should become 100.64.192.11 for this node.

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

No branches or pull requests

1 participant