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 default interface for VIP #289

Merged
merged 2 commits into from
Oct 19, 2021
Merged

Conversation

thebsdbox
Copy link
Collaborator

This adds a --autoInterface cmdline that is used to generate manifests and to start kube-vip, when this is used it will look at the default Gateway and use that interface for VIPs moving forward.

@thebsdbox thebsdbox requested a review from yastij as a code owner October 19, 2021 10:19
@thebsdbox thebsdbox requested a review from yaocw2020 October 19, 2021 10:19
@thebsdbox thebsdbox added control plane outside-cluster enhancement New feature or request labels Oct 19, 2021
@thebsdbox
Copy link
Collaborator Author

Fixes #273

@@ -63,6 +63,9 @@ type Config struct {
// Interface is the network interface to bind to (default: First Adapter)
Interface string `yaml:"interface,omitempty"`

// AutoInterface is the network interface to bind to (Adapter is determined from Default Gateway)
AutoInterface bool `yaml:"interface,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

yaml tag should be autoInterface

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

if initConfig.Interface == "" {
cmd.Help()
log.Fatalln("No interface is specified for kube-vip to bind to")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

From my perspective, it's more user-friendly to get the default interface if users don't set the VIP interface, rather than users have to set autoInterface env as true.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done !

@yaocw2020
Copy link
Contributor

LGTM

@thebsdbox thebsdbox merged commit 70f14a5 into kube-vip:main Oct 19, 2021
@thebsdbox thebsdbox deleted the main branch October 19, 2021 15:05
yaocw2020 added a commit to marthydavid/kube-vip-helm-charts that referenced this pull request Dec 21, 2021
After the pr kube-vip/kube-vip#289 merged, the
kube-vip supports default interface.

Signed-off-by: yaocw2020 <[email protected]>
yaocw2020 added a commit to marthydavid/kube-vip-helm-charts that referenced this pull request Dec 21, 2021
After the pr kube-vip/kube-vip#289 merged, the
kube-vip supports default interface.

Signed-off-by: yaocw2020 <[email protected]>
yaocw2020 added a commit to yaocw2020/helm-charts that referenced this pull request Jan 14, 2022
After the pr kube-vip/kube-vip#289 merged, the
kube-vip supports default interface.

Signed-off-by: yaocw2020 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control plane outside-cluster enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants