From 1921801b697924aaf77942476d4a23fea6580e48 Mon Sep 17 00:00:00 2001 From: Jiefeng He Date: Sun, 21 Feb 2021 00:12:31 -0800 Subject: [PATCH 1/2] disable minikube-scheduled-stop.service until a user schedules a stop --- .../minikube-iso/package/scheduled-stop/scheduled-stop.mk | 4 ---- deploy/kicbase/Dockerfile | 4 +--- pkg/minikube/schedule/daemonize_windows.go | 8 ++++++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/deploy/iso/minikube-iso/package/scheduled-stop/scheduled-stop.mk b/deploy/iso/minikube-iso/package/scheduled-stop/scheduled-stop.mk index ca1dc31f5302..f775e9e417a3 100644 --- a/deploy/iso/minikube-iso/package/scheduled-stop/scheduled-stop.mk +++ b/deploy/iso/minikube-iso/package/scheduled-stop/scheduled-stop.mk @@ -8,10 +8,6 @@ define SCHEDULED_STOP_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 \ $(SCHEDULED_STOP_PKGDIR)/minikube-scheduled-stop.service \ $(TARGET_DIR)/usr/lib/systemd/system/minikube-scheduled-stop.service - - mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants - ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \ - $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/minikube-scheduled-stop.service endef define SCHEDULED_STOP_INSTALL_TARGET_CMDS diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 994fb93db5f7..614fcd1174b7 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -155,9 +155,7 @@ RUN ln -fs /usr/lib/systemd/system/minikube-automount.service \ # scheduled stop service COPY scheduled-stop/minikube-scheduled-stop /var/lib/minikube/scheduled-stop/minikube-scheduled-stop COPY scheduled-stop/minikube-scheduled-stop.service /usr/lib/systemd/system/minikube-scheduled-stop.service -RUN ln -fs /usr/lib/systemd/system/minikube-scheduled-stop.service \ - /etc/systemd/system/multi-user.target.wants/minikube-scheduled-stop.service && \ - chmod +x /var/lib/minikube/scheduled-stop/minikube-scheduled-stop +RUN chmod +x /var/lib/minikube/scheduled-stop/minikube-scheduled-stop # disable non-docker runtimes by default RUN systemctl disable containerd && systemctl disable crio && rm /etc/crictl.yaml diff --git a/pkg/minikube/schedule/daemonize_windows.go b/pkg/minikube/schedule/daemonize_windows.go index d4b077fce049..d4660f6897dc 100644 --- a/pkg/minikube/schedule/daemonize_windows.go +++ b/pkg/minikube/schedule/daemonize_windows.go @@ -100,8 +100,12 @@ func startSystemdService(profile string, duration time.Duration) error { return errors.Wrap(err, "copying scheduled stop env file") } // restart scheduled stop service in container - sysManger := sysinit.New(runner) - return sysManger.Restart(constants.ScheduledStopSystemdService) + sysManager := sysinit.New(runner) + // enable scheduled stop service + if err := sysManager.Enable(constants.ScheduledStopSystemdService); err != nil { + return err + } + return sysManager.Restart(constants.ScheduledStopSystemdService) } // return the contents of the environment file for minikube-scheduled-stop systemd service From d6e9174435dae708624abc96d7405113125a12f0 Mon Sep 17 00:00:00 2001 From: Jiefeng He Date: Sun, 21 Feb 2021 17:27:24 -0800 Subject: [PATCH 2/2] update new tag, SHA, and doc due to new kicbase image --- pkg/drivers/kic/types.go | 4 ++-- site/content/en/docs/commands/start.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/drivers/kic/types.go b/pkg/drivers/kic/types.go index e993c5f5757b..042f5e546914 100644 --- a/pkg/drivers/kic/types.go +++ b/pkg/drivers/kic/types.go @@ -24,9 +24,9 @@ import ( const ( // Version is the current version of kic - Version = "v0.0.17-1613846643-10477" + Version = "v0.0.17-1613934488-10548" // SHA of the kic base image - baseImageSHA = "1c101a31d1b5dca98f49be85bc0a673ff902428b969fd2dc0535c34cb38533a4" + baseImageSHA = "5cacd48d07f699a171eedf65ef1490bd59a523ffcd90662e3b66eb838c5a1b5d" // The name of the GCR kicbase repository gcrRepo = "gcr.io/k8s-minikube/kicbase-builds" // The name of the Dockerhub kicbase repository diff --git a/site/content/en/docs/commands/start.md b/site/content/en/docs/commands/start.md index 63377395eddd..c4784a6d4078 100644 --- a/site/content/en/docs/commands/start.md +++ b/site/content/en/docs/commands/start.md @@ -26,7 +26,7 @@ minikube start [flags] --apiserver-names strings A set of apiserver names which are used in the generated certificate for kubernetes. This can be used if you want to make the apiserver available from outside the machine --apiserver-port int The apiserver listening port (default 8443) --auto-update-drivers If set, automatically updates drivers to the latest version. Defaults to true. (default true) - --base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase-builds:v0.0.17-1613846643-10477@sha256:1c101a31d1b5dca98f49be85bc0a673ff902428b969fd2dc0535c34cb38533a4") + --base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase-builds:v0.0.17-1613934488-10548@sha256:5cacd48d07f699a171eedf65ef1490bd59a523ffcd90662e3b66eb838c5a1b5d") --cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none. (default true) --cni string CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto) --container-runtime string The container runtime to be used (docker, cri-o, containerd). (default "docker")