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

Auto-detect the default BYOH interface for hosts #466

Open
sachinkumarsingh092 opened this issue Apr 1, 2022 · 6 comments
Open

Auto-detect the default BYOH interface for hosts #466

sachinkumarsingh092 opened this issue Apr 1, 2022 · 6 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@sachinkumarsingh092
Copy link
Contributor

sachinkumarsingh092 commented Apr 1, 2022

Describe the solution you'd like
We have upgraded kube-vip images to v0.4.1 (#462). This version has features to auto-detect the default interface for VIP (related PR) using --autoInterface option.
Currently, we detect and update the host network interface manually (agent/host_registrar.go#L86-L131). Having upgraded to the given version, we can now leverage the auto-detection feature and refactor the agent to use this instead of manual detection and updates.

Environment:

  • Cluster-api-provider-bringyourownhost version:
  • Kubernetes version: (use kubectl version --short):
  • OS (e.g. from /etc/os-release): Ubuntu 20.04.4 LTS (Focal Fossa)
@anusha94 anusha94 added this to the Next milestone Apr 1, 2022
@sachinkumarsingh092 sachinkumarsingh092 added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 4, 2022
@VibhorChinda
Copy link
Contributor

Hii @sachinkumarsingh092 @anusha94 I would love to work on this issue.

Reading the description I understand as of now the codebase is used to detect and update the host network interface manually but with upgradation of kube-vip images to v0.4.1 we could use --autoInterface option.

Could anyone point where I should make changes to leverage the required things :))
Thanks.

@anusha94
Copy link
Contributor

anusha94 commented Apr 5, 2022

/assign @VibhorChinda

@sachinkumarsingh092
Copy link
Contributor Author

Hey @VibhorChinda, thanks for your interest in this!

So the way we currently detect the interface for the BYOH host is shown in this function (it traverses all the interfaces and matches the default network IP for the default gateway and assigns the default Interface name). This is saved as DefaultNetworkInterfaceName and used in our templates with the vip_interface environment variable. All the places where we have updated the kube-vip image can be referenced in #462.

The --autoInterface option hasn't been updated in the docs but you can just remove the --interface flag or the vip_interface in our case to achieve similar results.
(See this thread: https://kubernetes.slack.com/archives/C01RXPHDATB/p1638969848103800?thread_ts=1638965549.102100&cid=C01RXPHDATB)

So for now you can start by trying if you can still achieve this without the vip_interface variable.

@anusha94 please correct me if I missed anything.

@VibhorChinda
Copy link
Contributor

So what I have understood is I have to remove the env variable (vip_interface) from the file [Line-82, 83]

And it will automatically detect right ?

@sachinkumarsingh092
Copy link
Contributor Author

Make similar changes for the other templates mentioned in PR #462.
After that, we can refactor the section that finds and sets the network interface name in agent/registration/host_registrar.go.

@anusha94
Copy link
Contributor

anusha94 commented Jul 8, 2022

/unassign @VibhorChinda
/assign @anusha94

@github-actions github-actions bot assigned anusha94 and unassigned VibhorChinda Jul 8, 2022
@anusha94 anusha94 modified the milestones: Next, v0.3.1 Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants