diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index 9f79c9861a4a..fd84ffa24605 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -124,6 +124,7 @@ const ( listenAddress = "listen-address" extraDisks = "extra-disks" certExpiration = "cert-expiration" + kubeBinariesMirror = "kube-binaries-mirror" ) var ( @@ -173,6 +174,7 @@ func initMinikubeFlags() { startCmd.Flags().StringP(trace, "", "", "Send trace events. Options include: [gcp]") startCmd.Flags().Int(extraDisks, 0, "Number of extra disks created and attached to the minikube VM (currently only implemented for hyperkit and kvm2 drivers)") startCmd.Flags().Duration(certExpiration, constants.DefaultCertExpiration, "Duration until minikube certificate expiration, defaults to three years (26280h).") + startCmd.Flags().String(kubeBinariesMirror, "", "Location to fetch kubectl, kubelet, & kubeadm binaries from.") } // initKubernetesFlags inits the commandline flags for Kubernetes related options @@ -466,6 +468,7 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, drvName s CertExpiration: viper.GetDuration(certExpiration), Mount: viper.GetBool(createMount), MountString: viper.GetString(mountString), + KubeBinariesMirror: viper.GetString(kubeBinariesMirror), KubernetesConfig: config.KubernetesConfig{ KubernetesVersion: k8sVersion, ClusterName: ClusterFlagValue(), @@ -668,6 +671,7 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC updateDurationFromFlag(cmd, &cc.CertExpiration, certExpiration) updateBoolFromFlag(cmd, &cc.Mount, createMount) updateStringFromFlag(cmd, &cc.MountString, mountString) + updateStringFromFlag(cmd, &cc.KubeBinariesMirror, kubeBinariesMirror) if cmd.Flags().Changed(kubernetesVersion) { cc.KubernetesConfig.KubernetesVersion = getKubernetesVersion(existing) diff --git a/pkg/minikube/config/types.go b/pkg/minikube/config/types.go index 0e6b7a3f3d6d..a93dc4971db8 100644 --- a/pkg/minikube/config/types.go +++ b/pkg/minikube/config/types.go @@ -87,6 +87,7 @@ type ClusterConfig struct { CertExpiration time.Duration Mount bool MountString string + KubeBinariesMirror string // Mirror location for kube binaries (kubectl, kubelet, & kubeadm) } // KubernetesConfig contains the parameters used to configure the VM Kubernetes.