From 738c09992ad60aa0b30cc0224deeb2d96fc6168a Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 28 Jul 2020 13:32:50 -0700 Subject: [PATCH 1/7] update kicbase to ubuntu 2020 --- deploy/kicbase/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index fc7f7db8b8e6..28715ccd7a5e 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -1,8 +1,8 @@ ARG COMMIT_SHA -# using base image created by kind https://github.com/kubernetes-sigs/kind/blob/master/images/base/Dockerfile -# which is an ubuntu 19.10 with an entry-point that helps running systemd +# using base image created by kind https://github.com/kubernetes-sigs/kind/blob/v0.8.1/images/base/Dockerfile +# which is an ubuntu 20.04 with an entry-point that helps running systemd # could be changed to any debian that can run systemd -FROM kindest/base:v20200317-92225082 as base +FROM kindest/base:v20200430-2c0eee40 as base USER root # specify version of everything explicitly using 'apt-cache policy' RUN apt-get update && apt-get install -y --no-install-recommends \ From 1bcbc67d98622de1a4f1bffc9fab22c1764f6088 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Tue, 28 Jul 2020 13:38:35 -0700 Subject: [PATCH 2/7] update kicbase to ubuntu 20.04 --- deploy/kicbase/Dockerfile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 28715ccd7a5e..1b2fb1a27094 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -6,27 +6,28 @@ FROM kindest/base:v20200430-2c0eee40 as base USER root # specify version of everything explicitly using 'apt-cache policy' RUN apt-get update && apt-get install -y --no-install-recommends \ - lz4=1.9.1-1 \ - gnupg=2.2.12-1ubuntu3 \ - sudo=1.8.27-1ubuntu4.1 \ - docker.io=19.03.2-0ubuntu1 \ - openssh-server=1:8.0p1-6build1 \ - dnsutils=1:9.11.5.P4+dfsg-5.1ubuntu2.2 \ + lz4 \ + gnupg \ + sudo \ + docker.io \ + openssh-server \ + dnsutils \ # libglib2.0-0 is required for conmon, which is required for podman - libglib2.0-0=2.62.1-1 \ + libglib2.0-0 \ + # removing kind's crictl config && rm /etc/crictl.yaml # install cri-o based on https://github.com/cri-o/cri-o/commit/96b0c34b31a9fc181e46d7d8e34fb8ee6c4dc4e1#diff-04c6e90faac2675aa89e2176d2eec7d8R128 -RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_19.10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ - curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_19.10/Release.key && \ +RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ + curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \ apt-key add - < Release.key && apt-get update && \ apt-get install -y --no-install-recommends cri-o-1.17 # install podman -RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman eoan main' > /etc/apt/sources.list.d/podman.list" && \ +RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman focal main' > /etc/apt/sources.list.d/podman.list" && \ curl -L https://bintray.com/user/downloadSubjectPublicKey?username=afbjorklund -o afbjorklund-public.key.asc && \ apt-key add - < afbjorklund-public.key.asc && apt-get update && \ - apt-get install -y --no-install-recommends podman=1.9.3~1 + apt-get install -y --no-install-recommends podman=1.8.2~2 # install varlink RUN apt-get install -y --no-install-recommends varlink From 61583d62492e2be0387563f460c56b1afba264c1 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 30 Jul 2020 15:11:30 -0700 Subject: [PATCH 3/7] upgrade crio to 1.18.3, ubuntu to 20.04 and add terrible hack to fix restarts for cri-o --- cmd/minikube/cmd/start.go | 7 ++++++ cmd/minikube/cmd/stop.go | 46 ++++++++++++++++++++++----------------- deploy/kicbase/Dockerfile | 18 ++++++++++----- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 75b9618e997b..11bc37c298dc 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -202,6 +202,13 @@ func runStart(cmd *cobra.Command, args []string) { } } + if existing != nil && existing.KubernetesConfig.ContainerRuntime == "crio" && driver.IsKIC(existing.Driver) { + // Stop and start again if it's crio because crio is bad and dumb + out.WarningT("CRI-O currently has an issue and your cluster needs to be restarted.") + stopProfile(existing.Name) + starter, err = provisionWithDriver(cmd, ds, existing) + } + kubeconfig, err := startWithDriver(cmd, starter, existing) if err != nil { node.MaybeExitWithAdvice(err) diff --git a/cmd/minikube/cmd/stop.go b/cmd/minikube/cmd/stop.go index 6f5493bc80ee..d27d11247806 100644 --- a/cmd/minikube/cmd/stop.go +++ b/cmd/minikube/cmd/stop.go @@ -80,36 +80,42 @@ func runStop(cmd *cobra.Command, args []string) { } stoppedNodes := 0 - for _, profile := range profilesToStop { - register.Reg.SetStep(register.Stopping) + stoppedNodes = stopProfile(profile) + } - // end new code - api, cc := mustload.Partial(profile) - defer api.Close() + register.Reg.SetStep(register.Done) + if stoppedNodes > 0 { + out.T(out.Stopped, `{{.count}} nodes stopped.`, out.V{"count": stoppedNodes}) + } +} - for _, n := range cc.Nodes { - machineName := driver.MachineName(*cc, n) +func stopProfile(profile string) int { + stoppedNodes := 0 + register.Reg.SetStep(register.Stopping) - nonexistent := stop(api, machineName) - if !nonexistent { - stoppedNodes++ - } - } + // end new code + api, cc := mustload.Partial(profile) + defer api.Close() - if err := killMountProcess(); err != nil { - out.WarningT("Unable to kill mount process: {{.error}}", out.V{"error": err}) - } + for _, n := range cc.Nodes { + machineName := driver.MachineName(*cc, n) - if err := kubeconfig.UnsetCurrentContext(profile, kubeconfig.PathFromEnv()); err != nil { - exit.WithError("update config", err) + nonexistent := stop(api, machineName) + if !nonexistent { + stoppedNodes++ } } - register.Reg.SetStep(register.Done) - if stoppedNodes > 0 { - out.T(out.Stopped, `{{.count}} nodes stopped.`, out.V{"count": stoppedNodes}) + if err := killMountProcess(); err != nil { + out.WarningT("Unable to kill mount process: {{.error}}", out.V{"error": err}) + } + + if err := kubeconfig.UnsetCurrentContext(profile, kubeconfig.PathFromEnv()); err != nil { + exit.WithError("update config", err) } + + return stoppedNodes } func stop(api libmachine.API, machineName string) bool { diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 1b2fb1a27094..5862441895bd 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -12,25 +12,31 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ docker.io \ openssh-server \ dnsutils \ + runc \ # libglib2.0-0 is required for conmon, which is required for podman libglib2.0-0 \ # removing kind's crictl config && rm /etc/crictl.yaml -# install cri-o based on https://github.com/cri-o/cri-o/commit/96b0c34b31a9fc181e46d7d8e34fb8ee6c4dc4e1#diff-04c6e90faac2675aa89e2176d2eec7d8R128 -RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ +# Install cri-o/podman dependencies: +RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \ apt-key add - < Release.key && apt-get update && \ - apt-get install -y --no-install-recommends cri-o-1.17 + apt-get install -y --no-install-recommends containers-common catatonit conmon containernetworking-plugins podman-plugins varlink + +# install cri-o based on https://github.com/cri-o/cri-o/commit/96b0c34b31a9fc181e46d7d8e34fb8ee6c4dc4e1#diff-04c6e90faac2675aa89e2176d2eec7d8R128 +RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.3/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ + curl -LO https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.3/xUbuntu_20.04/Release.key && \ + apt-key add - < Release.key && apt-get update && \ + apt-get install -y --no-install-recommends cri-o=1.18.3~2 # install podman RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman focal main' > /etc/apt/sources.list.d/podman.list" && \ curl -L https://bintray.com/user/downloadSubjectPublicKey?username=afbjorklund -o afbjorklund-public.key.asc && \ apt-key add - < afbjorklund-public.key.asc && apt-get update && \ - apt-get install -y --no-install-recommends podman=1.8.2~2 + apt-get install -y --no-install-recommends podman=1.9.3~1 -# install varlink -RUN apt-get install -y --no-install-recommends varlink +RUN mkdir -p /usr/lib/cri-o-runc/sbin && cp /usr/local/sbin/runc /usr/lib/cri-o-runc/sbin/runc COPY entrypoint /usr/local/bin/entrypoint # automount service From 7a08028c1e4f5721bc73e53262df3ad721dba901 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 30 Jul 2020 15:21:43 -0700 Subject: [PATCH 4/7] fix lint --- cmd/minikube/cmd/start.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 11bc37c298dc..4722faa35b3f 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -207,6 +207,9 @@ func runStart(cmd *cobra.Command, args []string) { out.WarningT("CRI-O currently has an issue and your cluster needs to be restarted.") stopProfile(existing.Name) starter, err = provisionWithDriver(cmd, ds, existing) + if err != nil { + exit.WithError("error provisioning host", err) + } } kubeconfig, err := startWithDriver(cmd, starter, existing) From 6e9e0b7866e6dc777ce4f50d4efb8bfb91145000 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 30 Jul 2020 16:43:59 -0700 Subject: [PATCH 5/7] better message output --- cmd/minikube/cmd/start.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 4722faa35b3f..d28bce2fa422 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -204,7 +204,8 @@ func runStart(cmd *cobra.Command, args []string) { if existing != nil && existing.KubernetesConfig.ContainerRuntime == "crio" && driver.IsKIC(existing.Driver) { // Stop and start again if it's crio because crio is bad and dumb - out.WarningT("CRI-O currently has an issue and your cluster needs to be restarted.") + out.WarningT("Due to issues with CRI-O post v1.17.3, we need to restart your cluster.") + out.WarningT("See details at https://github.com/kubernetes/minikube/issues/8861") stopProfile(existing.Name) starter, err = provisionWithDriver(cmd, ds, existing) if err != nil { From 43d23b8937c0a9358175f8a54b5a5f269cb50900 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 30 Jul 2020 21:40:45 -0700 Subject: [PATCH 6/7] change bad comment --- cmd/minikube/cmd/start.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index d28bce2fa422..660fa0444b5e 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -203,7 +203,7 @@ func runStart(cmd *cobra.Command, args []string) { } if existing != nil && existing.KubernetesConfig.ContainerRuntime == "crio" && driver.IsKIC(existing.Driver) { - // Stop and start again if it's crio because crio is bad and dumb + // Stop and start again if it's crio becuase it's broken above v1.17.3 out.WarningT("Due to issues with CRI-O post v1.17.3, we need to restart your cluster.") out.WarningT("See details at https://github.com/kubernetes/minikube/issues/8861") stopProfile(existing.Name) From 9b86b40536717f6c8ca5a03ed664bfa5944f6c08 Mon Sep 17 00:00:00 2001 From: Sharif Elgamal Date: Thu, 30 Jul 2020 22:16:32 -0700 Subject: [PATCH 7/7] misspelling --- cmd/minikube/cmd/start.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 660fa0444b5e..7189231565d8 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -203,7 +203,7 @@ func runStart(cmd *cobra.Command, args []string) { } if existing != nil && existing.KubernetesConfig.ContainerRuntime == "crio" && driver.IsKIC(existing.Driver) { - // Stop and start again if it's crio becuase it's broken above v1.17.3 + // Stop and start again if it's crio because it's broken above v1.17.3 out.WarningT("Due to issues with CRI-O post v1.17.3, we need to restart your cluster.") out.WarningT("See details at https://github.com/kubernetes/minikube/issues/8861") stopProfile(existing.Name)