diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index bfc39bda3a1f..f87fd108e654 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -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,17 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, drvName s cc.ContainerVolumeMounts = []string{viper.GetString(mountString)} } + if detect.IsCloudShell() { + err := cc.KubernetesConfig.ExtraOptions.Set("kubelet.cgroups-per-qos=false") + if err != nil { + exit.Error(reason.InternalConfigSet, "failed to set cloud shell kubelet config options", err) + } + err = cc.KubernetesConfig.ExtraOptions.Set("kubelet.enforce-node-allocatable=\"\"") + if err != nil { + exit.Error(reason.InternalConfigSet, "failed to set cloud shell kubelet config options", err) + } + } + return cc } diff --git a/hack/jenkins/cloud_shell_functional_tests_docker.sh b/hack/jenkins/cloud_shell_functional_tests_docker.sh index 70c937fd2322..6a229375c666 100755 --- a/hack/jenkins/cloud_shell_functional_tests_docker.sh +++ b/hack/jenkins/cloud_shell_functional_tests_docker.sh @@ -30,7 +30,7 @@ gcloud cloud-shell ssh --authorize-session << EOF DRIVER="docker" JOB_NAME="Docker_Cloud_Shell" CONTAINER_RUNTIME="docker" - EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons)" + EXTRA_TEST_ARGS="-test.run (TestFunctional|TestAddons|TestStartStop)" # Need to set these in cloud-shell or will not be present in common.sh MINIKUBE_LOCATION=$MINIKUBE_LOCATION diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index 85e0f0f924cc..c756965d0376 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -33,6 +33,7 @@ import ( "github.com/google/go-cmp/cmp" "k8s.io/minikube/pkg/minikube/bootstrapper/images" "k8s.io/minikube/pkg/minikube/constants" + "k8s.io/minikube/pkg/minikube/detect" ) // TestStartStop tests starting, stopping and restarting a minikube clusters with various Kubernetes versions and configurations @@ -76,6 +77,16 @@ func TestStartStop(t *testing.T) { }}, } + if detect.IsCloudShell() { + tests = []struct { + name string + version string + args []string + }{ + {"cloud-shell", constants.DefaultKubernetesVersion, []string{}}, + } + } + for _, tc := range tests { tc := tc t.Run(tc.name, func(t *testing.T) {