I know it's possible to run locally on Apple's M1 processor an amd64 image by using the --platform linux/amd64 flag on docker run.
But how do I deploy that same image on a local Minikube cluster, running on this same M1 hardware?
Output when trying is:
Failed to pull image "registry/image:tag":
rpc error: code = Unknown desc = no matching manifest for linux/arm64/v8 in the manifest list entries
How do I tell Minikube to cause the same effect as --platform linux/amd64 flag on its deployment?
I ran into the same issue. My solution was to:
docker pull registry/image:tag --platform linux/amd64.imagePullPolicy to Never, which makes it get the image locally rather than pulling it from the registry:spec:
containers:
- name: container-name
image: registry/image:tag
imagePullPolicy: Never # or IfNotPresent
Both kind and minikube set the imagePullPolicy to Always whenever an image with the latest tag is used, so manually setting it to Never forces the node to use your already downloaded image.
Not sure with Docker Desktop, but if you use Colima, you can select the arch for the lima VM.
Once you have a docker engine running in a VM with arch x86_64 on the M1, it will pull amd64 images.
use colima start --arch x86_64 on startup to use that arch.
You can then run MiniKube on Colima, or just use the Colima built-in kubernetes cluster.
Note: You may need to use the --runtime containerd to make this work. I have had issues with using the default runtime (docker)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With