add extra options to minikube start directly

pull/12237/head
Sharif Elgamal 2021-08-20 15:34:53 -07:00
parent daff8762be
commit fe6cbc4e42
2 changed files with 7 additions and 4 deletions

View File

@ -35,6 +35,7 @@ import (
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/pkg/minikube/cruntime"
"k8s.io/minikube/pkg/minikube/detect"
"k8s.io/minikube/pkg/minikube/download"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/exit"
@ -480,6 +481,11 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, drvName s
cc.ContainerVolumeMounts = []string{viper.GetString(mountString)}
}
if detect.IsCloudShell() {
cc.KubernetesConfig.ExtraOptions.Set("kubelet.cgroups-per-qos=false")
cc.KubernetesConfig.ExtraOptions.Set("kubelet.enforce-node-allocatable=\"\"")
}
return cc
}

View File

@ -83,10 +83,7 @@ func TestStartStop(t *testing.T) {
version string
args []string
}{
{"cloud-shell", constants.DefaultKubernetesVersion, []string{
"--extra-config=kubelet.cgroups-per-qos=false",
"--extra-config=kubelet.enforce-node-allocatable=\"\"",
}},
{"cloud-shell", constants.DefaultKubernetesVersion, []string{}},
}
}