kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.45k stars 4.88k forks source link

minikube can't start an amd64 container on Apple Sillicon #16530

Open iqHpi opened 1 year ago

iqHpi commented 1 year ago

What Happened?

I have installed amd64 minikube on my machine (M1 Mac) using below command -

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube

Then I started the cluster using -

minikube start

It was able to successfully start a minikube container in docker -

➜  ~ docker ps
CONTAINER ID   IMAGE                                 COMMAND                  CREATED         STATUS         PORTS                                                                                                                                  NAMES
37eb01d3f8fa   gcr.io/k8s-minikube/kicbase:v0.0.39   "/usr/local/bin/entr…"   3 minutes ago   Up 3 minutes   127.0.0.1:64125->22/tcp, 127.0.0.1:64126->2376/tcp, 127.0.0.1:64128->5000/tcp, 127.0.0.1:64129->8443/tcp, 127.0.0.1:64127->32443/tcp   minikube

Then, I checked the architecture of the running container and found out it was not amd64.

➜  ~ docker exec -it 37eb01d3f8fa uname -m
aarch64

And, since the minikube container is running as aarch64 I can't run amd64 pods inside it. 😭

It looks like a bug to me, since my amd64 minikube actually tried to download and run an amd64 kickbase image but ended up running the aarch64 one.

Screenshot 2023-05-18 at 6 14 17 p m

Here's my Docker info if that helps -

➜  ~ docker version
Client:
 Cloud integration: v1.0.31
 Version:           23.0.5
 API version:       1.42
 Go version:        go1.19.8
 Git commit:        bc4487a
 Built:             Wed Apr 26 16:12:52 2023
 OS/Arch:           darwin/arm64
 Context:           default

Server: Docker Desktop 4.19.0 (106363)
 Engine:
  Version:          23.0.5
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.8
  Git commit:       94d3ad6
  Built:            Wed Apr 26 16:17:14 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.20
  GitCommit:        2806fc1057397dbaeefbea0e4e17bddfbd388f38
 runc:
  Version:          1.1.5
  GitCommit:        v1.1.5-0-gf19387a
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Attach the log file

Here are the logs.

Operating System

macOS (Default)

Driver

Docker

Jaff commented 1 year ago

I've installed amd64 minikube on M1 MacBook Pro and when I start I get:

minikube start --driver=docker
[1]    6528 segmentation fault  minikube start --driver=docker
Dogacel commented 10 months ago

Same issue,

I am new to kubernetes and I am following a set of tutorials. I wish minikube supported amd64 emulation so I could have just used the images provided by the tutorial 😆

It also makes a lot of sense in development scenarios. I wish minikube supported rosetta vz pass-through for containers which do not support arm64. Such as docker run --platform=linux/amd64 my-image:v1 works under an aarch64 virtual machine (let's say colima). When I don't specify platform, vz doesn't work thus image is not working. Emulation is a much better choice for devex.

I'll probably end-up using kind because my x86-64 docker containers work pretty well under rosetta emulation.

tanvirrb commented 9 months ago

Facing the same issue. Can't run amd64 images in minikube.

afbjorklund commented 8 months ago

Minikube should allow running the node container in emulation.

At least for as long as it takes Kubernetes to update the tutorials...

wSedlacek commented 7 months ago

Installing qemu-user-static in the minikube container worked for me when using the podman driver on macOS.

minikube ssh "sudo apt-get update && sudo apt-get -y install qemu-user-static"
minikube stop
minikube start 
k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

jpsugar-flow commented 2 weeks ago

/remove-lifecycle rotten