-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Conversation
Fixes #273 |
pkg/kubevip/config_types.go
Outdated
@@ -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"` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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") | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done !
LGTM |
After the pr kube-vip/kube-vip#289 merged, the kube-vip supports default interface. Signed-off-by: yaocw2020 <[email protected]>
After the pr kube-vip/kube-vip#289 merged, the kube-vip supports default interface. Signed-off-by: yaocw2020 <[email protected]>
After the pr kube-vip/kube-vip#289 merged, the kube-vip supports default interface. Signed-off-by: yaocw2020 <[email protected]>
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.