diff --git a/Makefile b/Makefile index 9576827c01bb..e09f760abe28 100644 --- a/Makefile +++ b/Makefile @@ -690,7 +690,7 @@ docker-multi-arch-builder: env $(X_BUILD_ENV) docker buildx rm --builder $(X_DOCKER_BUILDER) || true env $(X_BUILD_ENV) docker buildx create --name $(X_DOCKER_BUILDER) --buildkitd-flags '--debug' || true -KICBASE_ARCH = linux/amd64,linux/arm64,linux/s390x +KICBASE_ARCH ?= linux/amd64,linux/arm64,linux/s390x,linux/arm,linux/ppc64le KICBASE_IMAGE_GCR ?= $(REGISTRY)/kicbase:$(KIC_VERSION) KICBASE_IMAGE_HUB ?= kicbase/stable:$(KIC_VERSION) KICBASE_IMAGE_REGISTRIES ?= $(KICBASE_IMAGE_GCR) $(KICBASE_IMAGE_HUB) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index f3dcc21ac1ea..611245bf7f60 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1267,25 +1267,30 @@ func validateDiskSize(diskSize string) error { } // validateRuntime validates the supplied runtime -func validateRuntime(runtime string) error { +func validateRuntime(rtime string) error { validOptions := cruntime.ValidRuntimes() // `crio` is accepted as an alternative spelling to `cri-o` validOptions = append(validOptions, constants.CRIO) var validRuntime bool for _, option := range validOptions { - if runtime == option { + if rtime == option { validRuntime = true } // Convert `cri-o` to `crio` as the K8s config uses the `crio` spelling - if runtime == "cri-o" { + if rtime == "cri-o" { viper.Set(containerRuntime, constants.CRIO) } + + } + + if (rtime == "crio" || rtime == "cri-o") && (strings.HasPrefix(runtime.GOARCH, "ppc64") || detect.RuntimeArch() == "arm" || strings.HasPrefix(detect.RuntimeArch(), "arm/")) { + return errors.Errorf("The %s runtime is not compatible with the %s architecture. See https://github.com/cri-o/cri-o/issues/2467 for more details.", rtime, runtime.GOARCH) } if !validRuntime { - return errors.Errorf("Invalid Container Runtime: %s. Valid runtimes are: %s", runtime, cruntime.ValidRuntimes()) + return errors.Errorf("Invalid Container Runtime: %s. Valid runtimes are: %s", rtime, cruntime.ValidRuntimes()) } return nil } diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 4c6c9e363d7d..b5e713c2765b 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -121,7 +121,10 @@ RUN clean-install \ fuse3 # install docker -RUN sh -c "echo 'deb https://download.docker.com/linux/ubuntu focal stable' > /etc/apt/sources.list.d/docker.list" && \ +# use the bionic packages for arm32 +RUN export ARCH=$(dpkg --print-architecture | sed 's/armhf/arm-v7/') && \ + if [ "$ARCH" == "arm-v7" ]; then export DIST="bionic"; else export DIST="focal"; fi && \ + sh -c "echo 'deb https://download.docker.com/linux/ubuntu ${DIST} stable' > /etc/apt/sources.list.d/docker.list" && \ curl -L https://download.docker.com/linux/ubuntu/gpg -o docker.key && \ apt-key add - < docker.key && \ clean-install docker-ce docker-ce-cli containerd.io @@ -159,19 +162,26 @@ RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/ && systemctl enable buildkit.socket # Install cri-o/podman dependencies: -RUN sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ +RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/') && \ + sh -c "echo 'deb https://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 && \ - clean-install containers-common catatonit conmon containernetworking-plugins cri-tools podman-plugins crun + if [ "$ARCH" != "ppc64le" ]; then \ + clean-install containers-common catatonit conmon containernetworking-plugins cri-tools podman-plugins crun; \ + else \ + clean-install containers-common conmon containernetworking-plugins crun; \ + fi # install cri-o based on https://github.com/cri-o/cri-o/blob/release-1.22/README.md#installing-cri-o -RUN sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${CRIO_VERSION}/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:${CRIO_VERSION}.list" && \ +RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/armhf/arm-v7/') && \ + if [ "$ARCH" != "ppc64le" ] && [ "$ARCH" != "arm-v7" ]; then sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${CRIO_VERSION}/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:${CRIO_VERSION}.list" && \ curl -LO https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${CRIO_VERSION}/xUbuntu_20.04/Release.key && \ apt-key add - < Release.key && \ - clean-install cri-o cri-o-runc + clean-install cri-o cri-o-runc; fi # install podman -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" && \ +RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/') && \ + if [ "$ARCH" != "ppc64le" ]; then 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 && \ clean-install podman && \ @@ -181,7 +191,7 @@ RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/lib > /etc/systemd/system/podman.socket.d/override.conf && \ mkdir -p /etc/tmpfiles.d && \ echo "d /run/podman 0770 root podman" > /etc/tmpfiles.d/podman.conf && \ - systemd-tmpfiles --create + systemd-tmpfiles --create; fi # automount service COPY deploy/kicbase/automount/minikube-automount /usr/sbin/minikube-automount @@ -195,9 +205,14 @@ COPY deploy/kicbase/scheduled-stop/minikube-scheduled-stop.service /usr/lib/syst 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 +RUN systemctl disable containerd +# disable crio for archs that support it +RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/' | sed 's/armhf/arm-v7/') && \ + if [ "$ARCH" != "ppc64le" ] && [ "$ARCH" != "arm-v7" ]; then systemctl disable crio && rm /etc/crictl.yaml; fi +# enable podman socket on archs that support it +RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/') && if [ "$ARCH" != "ppc64le" ]; then systemctl enable podman.socket; fi # enable docker which is default -RUN systemctl enable docker.service && systemctl enable podman.socket +RUN systemctl enable docker.service # making SSH work for docker container # based on https://github.com/rastasheep/ubuntu-sshd/blob/master/18.04/Dockerfile RUN mkdir /var/run/sshd @@ -216,7 +231,7 @@ EXPOSE 22 # create docker user for minikube ssh. to match VM using "docker" as username RUN adduser --ingroup docker --disabled-password --gecos '' docker RUN adduser docker sudo -RUN adduser docker podman +RUN export ARCH=$(dpkg --print-architecture | sed 's/ppc64el/ppc64le/') && if [ "$ARCH" != "ppc64le" ]; then adduser docker podman; fi RUN adduser docker buildkit RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers USER docker diff --git a/pkg/drivers/kic/types.go b/pkg/drivers/kic/types.go index d8e16e1c157b..58c36f424f86 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.28-1638824847-13104" + Version = "v0.0.28-1639515145-13124" // SHA of the kic base image - baseImageSHA = "a90edc66cae8cca35685dce007b915405a2ba91d903f99f7d8f79cd9d1faabab" + baseImageSHA = "50a7fba584fcd78435535ec8407fa75d58db1612175b13fd473300d522f7ac80" // 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/driver/driver_darwin.go b/pkg/minikube/driver/driver_darwin.go index 9153e9e79d1b..195f9841c0af 100644 --- a/pkg/minikube/driver/driver_darwin.go +++ b/pkg/minikube/driver/driver_darwin.go @@ -19,6 +19,7 @@ package driver import ( "os/exec" "runtime" + "strings" ) // supportedDrivers is a list of supported drivers on Darwin. @@ -31,6 +32,18 @@ var supportedDrivers = func() []string { SSH, } } + // PowerPC does not support podman + if strings.HasPrefix(runtime.GOARCH, "ppc") { + return []string{ + VirtualBox, + Parallels, + VMwareFusion, + HyperKit, + VMware, + Docker, + SSH, + } + } return []string{ VirtualBox, Parallels, diff --git a/site/content/en/docs/commands/start.md b/site/content/en/docs/commands/start.md index 382cb8aba6b5..f2cb929daad5 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.28-1638824847-13104@sha256:a90edc66cae8cca35685dce007b915405a2ba91d903f99f7d8f79cd9d1faabab") + --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.28-1639515145-13124@sha256:50a7fba584fcd78435535ec8407fa75d58db1612175b13fd473300d522f7ac80") --cache-images If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none. (default true) --cert-expiration duration Duration until minikube certificate expiration, defaults to three years (26280h). (default 26280h0m0s) --cni string CNI plug-in to use. Valid options: auto, bridge, calico, cilium, flannel, kindnet, or path to a CNI manifest (default: auto)