Skip to content

Commit 5a17d80

Browse files
authored
Merge pull request #11019 from medyagh/autopause_vm
Add auto-pause to VMs
2 parents 11a2d0a + ffba51f commit 5a17d80

File tree

9 files changed

+21
-15
lines changed

9 files changed

+21
-15
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ _testmain.go
2626
*.test
2727
*.prof
2828

29+
/deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/bin/auto-pause
2930
/deploy/kicbase/auto-pause
3031
/deploy/addons/auto-pause/auto-pause-hook
3132
/out

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ KUBERNETES_VERSION ?= $(shell egrep "DefaultKubernetesVersion =" pkg/minikube/co
2323
KIC_VERSION ?= $(shell egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f2)
2424

2525
# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
26-
ISO_VERSION ?= v1.19.0
26+
ISO_VERSION ?= v1.19.0-1617859429-11019
2727
# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
2828
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
2929
DEB_REVISION ?= 0
@@ -261,7 +261,7 @@ out/e2e-%: out/minikube-%
261261
out/e2e-windows-amd64.exe: out/e2e-windows-amd64
262262
cp $< $@
263263

264-
minikube_iso: # old target kept for making tests happy
264+
minikube_iso: deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/bin/auto-pause # build minikube iso
265265
echo $(ISO_VERSION) > deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION
266266
if [ ! -d $(BUILD_DIR)/buildroot ]; then \
267267
mkdir -p $(BUILD_DIR); \
@@ -834,6 +834,11 @@ out/mkcmp:
834834
deploy/kicbase/auto-pause: $(SOURCE_GENERATED) $(SOURCE_FILES)
835835
GOOS=linux GOARCH=$(GOARCH) go build -o $@ cmd/auto-pause/auto-pause.go
836836

837+
# auto pause binary to be used for ISO
838+
deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/bin/auto-pause: $(SOURCE_GENERATED) $(SOURCE_FILES)
839+
GOOS=linux GOARCH=$(GOARCH) go build -o $@ cmd/auto-pause/auto-pause.go
840+
841+
837842
.PHONY: deploy/addons/auto-pause/auto-pause-hook
838843
deploy/addons/auto-pause/auto-pause-hook: $(SOURCE_GENERATED) ## Build auto-pause hook addon
839844
$(if $(quiet),@echo " GO $@")

deploy/addons/auto-pause/auto-pause.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Description=Auto Pause Service
33

44
[Service]
55
Type=simple
6-
ExecStart=/usr/local/bin/auto-pause
6+
ExecStart=/bin/auto-pause
77
Restart=always
88

99
[Install]

deploy/kicbase/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ COPY 10-network-security.conf /etc/sysctl.d/10-network-security.conf
2828
COPY 11-tcp-mtu-probing.conf /etc/sysctl.d/11-tcp-mtu-probing.conf
2929
COPY clean-install /usr/local/bin/clean-install
3030
COPY entrypoint /usr/local/bin/entrypoint
31-
# must first run make out/auto-pause
32-
COPY auto-pause /usr/local/bin/auto-pause
31+
# must first run `make deploy/kicbase/auto-pause`
32+
COPY auto-pause /bin/auto-pause
3333

3434
# Install dependencies, first from apt, then from release tarballs.
3535
# NOTE: we use one RUN to minimize layers.

hack/jenkins/kicbase_auto_build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -x -o pipefail
17+
set -x
1818

1919
# Make sure docker is installed and configured
2020
./hack/jenkins/installers/check_install_docker.sh

pkg/addons/addons_autopause.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func enableOrDisableAutoPause(cc *config.ClusterConfig, name string, val string)
4343
out.Infof("auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.")
4444
out.Infof("https://github.com/kubernetes/minikube/labels/co%2Fauto-pause")
4545

46-
if !driver.IsKIC(cc.Driver) || runtime.GOARCH != "amd64" {
47-
exit.Message(reason.Usage, `auto-pause currently is only supported on docker driver/docker runtime/amd64. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601`)
46+
if cc.KubernetesConfig.ContainerRuntime != "docker" || runtime.GOARCH != "amd64" {
47+
exit.Message(reason.Usage, `auto-pause currently is only supported on docker runtime and amd64. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601`)
4848
}
4949
co := mustload.Running(cc.Name)
5050
if enable {

pkg/drivers/kic/types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ import (
2424

2525
const (
2626
// Version is the current version of kic
27-
Version = "v0.0.19"
27+
Version = "v0.0.19-1617905290-11019"
2828
// SHA of the kic base image
29-
baseImageSHA = "4d7ca4cd5eda77ade1a15fb898d22ed0111d76106858d1cae25be9b110ec4b4a"
29+
baseImageSHA = "f52f5c903f19f6ad4767954309d3127280dbf0b9255b840fe665c34d5bb3c1c6"
3030
// The name of the GCR kicbase repository
31-
gcrRepo = "gcr.io/k8s-minikube/kicbase"
31+
gcrRepo = "gcr.io/k8s-minikube/kicbase-builds"
3232
// The name of the Dockerhub kicbase repository
33-
dockerhubRepo = "kicbase/stable"
33+
dockerhubRepo = "kicbase/build"
3434
)
3535

3636
var (

pkg/minikube/download/iso.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const fileScheme = "file"
4040
// DefaultISOURLs returns a list of ISO URL's to consult by default, in priority order
4141
func DefaultISOURLs() []string {
4242
v := version.GetISOVersion()
43-
isoBucket := "minikube/iso"
43+
isoBucket := "minikube-builds/iso/11019"
4444
return []string{
4545
fmt.Sprintf("https://storage.googleapis.com/%s/minikube-%s.iso", isoBucket, v),
4646
fmt.Sprintf("https://github.com/kubernetes/minikube/releases/download/%s/minikube-%s.iso", v, v),

site/content/en/docs/commands/start.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ minikube start [flags]
2626
--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
2727
--apiserver-port int The apiserver listening port (default 8443)
2828
--auto-update-drivers If set, automatically updates drivers to the latest version. Defaults to true. (default true)
29-
--base-image string The base image to use for docker/podman drivers. Intended for local development. (default "gcr.io/k8s-minikube/kicbase:v0.0.19@sha256:4d7ca4cd5eda77ade1a15fb898d22ed0111d76106858d1cae25be9b110ec4b4a")
29+
--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.19-1617905290-11019@sha256:f52f5c903f19f6ad4767954309d3127280dbf0b9255b840fe665c34d5bb3c1c6")
3030
--cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none. (default true)
3131
--cni string CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)
3232
--container-runtime string The container runtime to be used (docker, cri-o, containerd). (default "docker")
@@ -64,7 +64,7 @@ minikube start [flags]
6464
--insecure-registry strings Insecure Docker registries to pass to the Docker daemon. The default service CIDR range will automatically be added.
6565
--install-addons If set, install addons. Defaults to true. (default true)
6666
--interactive Allow user prompts for more information (default true)
67-
--iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube/iso/minikube-v1.19.0.iso,https://github.com/kubernetes/minikube/releases/download/v1.19.0/minikube-v1.19.0.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.19.0.iso])
67+
--iso-url strings Locations to fetch the minikube ISO from. (default [https://storage.googleapis.com/minikube-builds/iso/11019/minikube-v1.19.0-1617859429-11019.iso,https://github.com/kubernetes/minikube/releases/download/v1.19.0-1617859429-11019/minikube-v1.19.0-1617859429-11019.iso,https://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/iso/minikube-v1.19.0-1617859429-11019.iso])
6868
--keep-context This will keep the existing kubectl context and will create a minikube context.
6969
--kubernetes-version string The Kubernetes version that the minikube VM will use (ex: v1.2.3, 'stable' for v1.20.2, 'latest' for v1.20.5-rc.0). Defaults to 'stable'.
7070
--kvm-gpu Enable experimental NVIDIA GPU support in minikube

0 commit comments

Comments
 (0)