diff --git a/cmd/auto-pause/auto-pause.go b/cmd/auto-pause/auto-pause.go index 0eb0830e8d1b..1fe405d3e9f1 100644 --- a/cmd/auto-pause/auto-pause.go +++ b/cmd/auto-pause/auto-pause.go @@ -17,6 +17,7 @@ limitations under the License. package main import ( + "flag" "fmt" "log" "net/http" @@ -39,10 +40,11 @@ var mu sync.Mutex var runtimePaused bool var version = "0.0.1" -// TODO: #10597 make this configurable to support containerd/cri-o -var runtime = "docker" +var runtime = flag.String("container-runtime", "docker", "Container runtime to use for (un)pausing") func main() { + flag.Parse() + // TODO: #10595 make this configurable const interval = time.Minute * 1 @@ -89,7 +91,7 @@ func runPause() { r := command.NewExecRunner(true) - cr, err := cruntime.New(cruntime.Config{Type: runtime, Runner: r}) + cr, err := cruntime.New(cruntime.Config{Type: *runtime, Runner: r}) if err != nil { exit.Error(reason.InternalNewRuntime, "Failed runtime", err) } @@ -111,7 +113,7 @@ func runUnpause() { r := command.NewExecRunner(true) - cr, err := cruntime.New(cruntime.Config{Type: runtime, Runner: r}) + cr, err := cruntime.New(cruntime.Config{Type: *runtime, Runner: r}) if err != nil { exit.Error(reason.InternalNewRuntime, "Failed runtime", err) } @@ -130,7 +132,7 @@ func alreadyPaused() { defer mu.Unlock() r := command.NewExecRunner(true) - cr, err := cruntime.New(cruntime.Config{Type: runtime, Runner: r}) + cr, err := cruntime.New(cruntime.Config{Type: *runtime, Runner: r}) if err != nil { exit.Error(reason.InternalNewRuntime, "Failed runtime", err) } diff --git a/deploy/addons/assets.go b/deploy/addons/assets.go index dfbdbfa379b5..9031cb4a99a8 100644 --- a/deploy/addons/assets.go +++ b/deploy/addons/assets.go @@ -21,7 +21,6 @@ import "embed" var ( // AutoPauseAssets assets for auto-pause addon //go:embed auto-pause/*.tmpl - //go:embed auto-pause/auto-pause.service //go:embed auto-pause/unpause.lua AutoPauseAssets embed.FS diff --git a/deploy/addons/auto-pause/auto-pause.service b/deploy/addons/auto-pause/auto-pause.service.tmpl similarity index 62% rename from deploy/addons/auto-pause/auto-pause.service rename to deploy/addons/auto-pause/auto-pause.service.tmpl index 7d763ca68a21..0a5260a7b434 100644 --- a/deploy/addons/auto-pause/auto-pause.service +++ b/deploy/addons/auto-pause/auto-pause.service.tmpl @@ -3,7 +3,7 @@ Description=Auto Pause Service [Service] Type=simple -ExecStart=/bin/auto-pause +ExecStart=/bin/auto-pause --container-runtime={{.ContainerRuntime}} Restart=always [Install] diff --git a/pkg/addons/addons_autopause.go b/pkg/addons/addons_autopause.go index c4ead7f7ce04..ec8836fa4f60 100644 --- a/pkg/addons/addons_autopause.go +++ b/pkg/addons/addons_autopause.go @@ -25,11 +25,9 @@ import ( "k8s.io/minikube/pkg/minikube/config" "k8s.io/minikube/pkg/minikube/constants" "k8s.io/minikube/pkg/minikube/driver" - "k8s.io/minikube/pkg/minikube/exit" "k8s.io/minikube/pkg/minikube/kubeconfig" "k8s.io/minikube/pkg/minikube/mustload" "k8s.io/minikube/pkg/minikube/out" - "k8s.io/minikube/pkg/minikube/reason" "k8s.io/minikube/pkg/minikube/sysinit" ) @@ -42,9 +40,6 @@ func enableOrDisableAutoPause(cc *config.ClusterConfig, name string, val string) out.Infof("auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.") out.Infof("https://github.com/kubernetes/minikube/labels/co/auto-pause") - if cc.KubernetesConfig.ContainerRuntime != "docker" { - exit.Message(reason.Usage, `auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601`) - } co := mustload.Running(cc.Name) if enable { if err := sysinit.New(co.CP.Runner).EnableNow("auto-pause"); err != nil { diff --git a/pkg/drivers/kic/types.go b/pkg/drivers/kic/types.go index afc5e6bf3f71..0083f7bcd9f0 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.24-1625086337-11824" + Version = "v0.0.24-1625170572-11834" // SHA of the kic base image - baseImageSHA = "9e7c8040758103e42825d78af47706a9c18b1aab2659eeac30eb417757b9b42a" + baseImageSHA = "a96e572c898eaed7aba6bf60b4d18d9f746cfad645b090023edebf960128c707" // The name of the GCR kicbase repository gcrRepo = "gcr.io/k8s-minikube/kicbase-builds" // The name of the Dockerhub kicbase repository diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 737420aff12b..d249636acc81 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -107,7 +107,7 @@ var Addons = map[string]*Addon{ "0640"), MustBinAsset( addons.AutoPauseAssets, - "auto-pause/auto-pause.service", + "auto-pause/auto-pause.service.tmpl", "/etc/systemd/system/", "auto-pause.service", "0640"), @@ -788,6 +788,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig, netInfo Net LoadBalancerStartIP string LoadBalancerEndIP string CustomIngressCert string + ContainerRuntime string Images map[string]string Registries map[string]string CustomRegistries map[string]string @@ -799,6 +800,7 @@ func GenerateTemplateData(addon *Addon, cfg config.KubernetesConfig, netInfo Net LoadBalancerStartIP: cfg.LoadBalancerStartIP, LoadBalancerEndIP: cfg.LoadBalancerEndIP, CustomIngressCert: cfg.CustomIngressCert, + ContainerRuntime: cfg.ContainerRuntime, Images: images, Registries: addon.Registries, CustomRegistries: customRegistries, diff --git a/site/content/en/docs/commands/start.md b/site/content/en/docs/commands/start.md index 93899fa9bbe8..7514bd97c1fe 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.24-1625086337-11824@sha256:9e7c8040758103e42825d78af47706a9c18b1aab2659eeac30eb417757b9b42a") + --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.24-1625170572-11834@sha256:a96e572c898eaed7aba6bf60b4d18d9f746cfad645b090023edebf960128c707") --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") diff --git a/translations/de.json b/translations/de.json index 6976192dbfa6..2a3ca500cca7 100644 --- a/translations/de.json +++ b/translations/de.json @@ -815,7 +815,6 @@ "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "", "addons modifies minikube addons files using subcommands like \"minikube addons enable dashboard\"": "", "auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.": "", - "auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601": "", "bash completion failed": "", "bash completion.": "", "call with cleanup=true to remove old tunnels": "", diff --git a/translations/es.json b/translations/es.json index b7f8fec59e90..6473cf53dd53 100644 --- a/translations/es.json +++ b/translations/es.json @@ -820,7 +820,6 @@ "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "", "addons modifies minikube addons files using subcommands like \"minikube addons enable dashboard\"": "", "auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.": "", - "auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601": "", "bash completion failed": "", "bash completion.": "", "call with cleanup=true to remove old tunnels": "", diff --git a/translations/ja.json b/translations/ja.json index a597a014ae62..40bcbd3df02b 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -822,7 +822,6 @@ "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "「 {{.name}} 」アドオンは minikube では有効なアドオンではありません。\n利用可能なアドオンの一覧を表示するためには、以下のコマンドを実行してください。 \nminikube addons list", "addons modifies minikube addons files using subcommands like \"minikube addons enable dashboard\"": "addons では以下のようにサブコマンドを使用することで、 minikube のアドオンのファイルを編集することができます。 \"minikube addons enable dashboard\"", "auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.": "", - "auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601": "", "bash completion failed": "bash の補完が失敗しました", "bash completion.": "", "call with cleanup=true to remove old tunnels": "cleanup=true で呼び出すことで、古い tunnel を削除することができます", diff --git a/translations/ko.json b/translations/ko.json index 7243b302690d..af910e720047 100644 --- a/translations/ko.json +++ b/translations/ko.json @@ -823,7 +823,6 @@ "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "", "addons modifies minikube addons files using subcommands like \"minikube addons enable dashboard\"": "", "auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.": "", - "auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601": "", "bash completion failed": "bash 자동 완성이 실패하였습니다", "bash completion.": "", "call with cleanup=true to remove old tunnels": "", diff --git a/translations/pl.json b/translations/pl.json index 2213fd15248d..5bee58934471 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -831,7 +831,6 @@ "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "", "addons modifies minikube addons files using subcommands like \"minikube addons enable dashboard\"": "", "auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.": "", - "auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601": "", "bash completion failed": "", "bash completion.": "", "call with cleanup=true to remove old tunnels": "", diff --git a/translations/strings.txt b/translations/strings.txt index e64679326087..88ca7e924960 100644 --- a/translations/strings.txt +++ b/translations/strings.txt @@ -760,7 +760,6 @@ "addon '{{.name}}' is not a valid addon packaged with minikube.\nTo see the list of available addons run:\nminikube addons list": "", "addons modifies minikube addons files using subcommands like \"minikube addons enable dashboard\"": "", "auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.": "", - "auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601": "", "bash completion failed": "", "bash completion.": "", "call with cleanup=true to remove old tunnels": "", diff --git a/translations/zh-CN.json b/translations/zh-CN.json index 3ca0057c8def..46c47326560c 100644 --- a/translations/zh-CN.json +++ b/translations/zh-CN.json @@ -937,7 +937,6 @@ "addon enable failed": "启用插件失败", "addons modifies minikube addons files using subcommands like \"minikube addons enable dashboard\"": "插件使用诸如 \"minikube addons enable dashboard\" 的子命令修改 minikube 的插件文件", "auto-pause addon is an alpha feature and still in early development. Please file issues to help us make it better.": "", - "auto-pause currently is only supported on docker runtime. Track progress of others here: https://github.com/kubernetes/minikube/issues/10601": "", "bash completion failed": "", "bash completion.": "", "call with cleanup=true to remove old tunnels": "",