未验证 提交 8b6a0eb4 编写于 作者: M Medya Ghazizadeh 提交者: GitHub

Merge pull request #8948 from kadern0/issue-8897

Added startHostTimeout flag
......@@ -114,7 +114,6 @@ func initMinikubeFlags() {
// e.g. iso-url => $ENVPREFIX_ISO_URL
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
viper.AutomaticEnv()
startCmd.Flags().Bool(force, false, "Force minikube to perform possibly dangerous operations")
startCmd.Flags().Bool(interactive, true, "Allow user prompts for more information")
startCmd.Flags().Bool(dryRun, false, "dry-run mode. Validates configuration, but does not mutate system state")
......@@ -137,7 +136,7 @@ func initMinikubeFlags() {
startCmd.Flags().Bool(enableDefaultCNI, false, "DEPRECATED: Replaced by --cni=bridge")
startCmd.Flags().String(cniFlag, "", "CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)")
startCmd.Flags().StringSlice(waitComponents, kverify.DefaultWaitList, fmt.Sprintf("comma separated list of Kubernetes components to verify and wait for after starting a cluster. defaults to %q, available options: %q . other acceptable values are 'all' or 'none', 'true' and 'false'", strings.Join(kverify.DefaultWaitList, ","), strings.Join(kverify.AllComponentsList, ",")))
startCmd.Flags().Duration(waitTimeout, 6*time.Minute, "max time to wait per Kubernetes core services to be healthy.")
startCmd.Flags().Duration(waitTimeout, 6*time.Minute, "max time to wait per Kubernetes or host to be healthy.")
startCmd.Flags().Bool(nativeSSH, true, "Use native Golang SSH client (default true). Set to 'false' to use the command line 'ssh' command when accessing the docker machine. Useful for the machine drivers when they will not start with 'Waiting for SSH'.")
startCmd.Flags().Bool(autoUpdate, true, "If set, automatically updates drivers to the latest version. Defaults to true.")
startCmd.Flags().Bool(installAddons, true, "If set, install addons. Defaults to true.")
......@@ -309,6 +308,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
HostDNSResolver: viper.GetBool(hostDNSResolver),
HostOnlyNicType: viper.GetString(hostOnlyNicType),
NatNicType: viper.GetString(natNicType),
StartHostTimeout: viper.GetDuration(waitTimeout),
KubernetesConfig: config.KubernetesConfig{
KubernetesVersion: k8sVersion,
ClusterName: ClusterFlagValue(),
......
......@@ -18,6 +18,7 @@ package config
import (
"net"
"time"
"github.com/blang/semver"
)
......@@ -68,6 +69,7 @@ type ClusterConfig struct {
Nodes []Node
Addons map[string]bool
VerifyComponents map[string]bool // map of components to verify and wait for after start.
StartHostTimeout time.Duration
}
// KubernetesConfig contains the parameters used to configure the VM Kubernetes.
......
......@@ -157,7 +157,10 @@ func createHost(api libmachine.API, cfg *config.ClusterConfig, n *config.Node) (
cstart := time.Now()
glog.Infof("libmachine.API.Create for %q (driver=%q)", cfg.Name, cfg.Driver)
if err := timedCreateHost(h, api, 4*time.Minute); err != nil {
if cfg.StartHostTimeout == 0 {
cfg.StartHostTimeout = 6 * time.Minute
}
if err := timedCreateHost(h, api, cfg.StartHostTimeout); err != nil {
return nil, errors.Wrap(err, "creating host")
}
glog.Infof("duration metric: libmachine.API.Create for %q took %s", cfg.Name, time.Since(cstart))
......
......@@ -91,7 +91,7 @@ minikube start [flags]
--vm Filter to use only VM Drivers
--vm-driver driver DEPRECATED, use driver instead.
--wait strings comma separated list of Kubernetes components to verify and wait for after starting a cluster. defaults to "apiserver,system_pods", available options: "apiserver,system_pods,default_sa,apps_running,node_ready" . other acceptable values are 'all' or 'none', 'true' and 'false' (default [apiserver,system_pods])
--wait-timeout duration max time to wait per Kubernetes core services to be healthy. (default 6m0s)
--wait-timeout duration max time to wait per Kubernetes or host to be healthy. (default 6m0s)
```
### Options inherited from parent commands
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册