Skip to content

Commit

Permalink
Make virtualbox DNS settings configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe VILA authored and medyagh committed Jun 28, 2019
1 parent 7fe2247 commit 8cd3895
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ const (
embedCerts = "embed-certs"
noVTXCheck = "no-vtx-check"
downloadOnly = "download-only"
dnsProxy = "dns-proxy"
hostDNSResolver = "host-dns-resolver"
)

var (
Expand Down Expand Up @@ -158,6 +160,8 @@ func init() {
startCmd.Flags().Bool(gpu, false, "Enable experimental NVIDIA GPU support in minikube (works only with kvm2 driver on Linux)")
startCmd.Flags().Bool(hidden, false, "Hide the hypervisor signature from the guest in minikube (works only with kvm2 driver on Linux)")
startCmd.Flags().Bool(noVTXCheck, false, "Disable checking for the availability of hardware virtualization before the vm is started (virtualbox)")
startCmd.Flags().Bool(dnsProxy, false, "Enable proxy for NAT DNS requests (virtualbox)")
startCmd.Flags().Bool(hostDNSResolver, true, "Enable host resolver for NAT DNS requests (virtualbox)")
if err := viper.BindPFlags(startCmd.Flags()); err != nil {
exit.WithError("unable to bind flags", err)
}
Expand Down Expand Up @@ -530,6 +534,8 @@ func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
GPU: viper.GetBool(gpu),
Hidden: viper.GetBool(hidden),
NoVTXCheck: viper.GetBool(noVTXCheck),
DNSProxy: viper.GetBool(dnsProxy),
HostDNSResolver: viper.GetBool(hostDNSResolver),
},
KubernetesConfig: cfg.KubernetesConfig{
KubernetesVersion: k8sVersion,
Expand Down
2 changes: 2 additions & 0 deletions pkg/minikube/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ type MachineConfig struct {
GPU bool // Only used by kvm2
Hidden bool // Only used by kvm2
NoVTXCheck bool // Only used by virtualbox
DNSProxy bool // Only used by virtualbox
HostDNSResolver bool // Only used by virtualbox
}

// KubernetesConfig contains the parameters used to configure the VM Kubernetes.
Expand Down
4 changes: 2 additions & 2 deletions pkg/minikube/drivers/virtualbox/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func createVirtualboxHost(config cfg.MachineConfig) interface{} {
d.NoVTXCheck = config.NoVTXCheck
d.NatNicType = defaultVirtualboxNicType
d.HostOnlyNicType = defaultVirtualboxNicType
d.DNSProxy = false
d.HostDNSResolver = true
d.DNSProxy = config.DNSProxy
d.HostDNSResolver = config.HostDNSResolver

return d
}

0 comments on commit 8cd3895

Please sign in to comment.