Minikube to deploy linux/amd64 images on M1 hardware
Asked Answered
H

2

15

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?

Hydrate answered 20/5, 2022 at 23:6 Comment(5)
Do you found a solution ? I have the same issue.Gaussmeter
can you add the whole command/yaml that you use to run the image?Pondweed
Just curious, is that still an issue that you can reproduce, because I couldn't --> yelling.cloud/posts/docker_and_minikubePondweed
@RickRackow I followed your blog and also could not reproduce it with your examples. But can you try and run kubectl run timescale --image timescale/timescaledb-ha:pg15.3-ts2.10.3-all? This is single arch amd64 and it does fail for me like for OP.Rashida
Nevermind. Seems to be a timescale specific problem, since they are in the middle of supporting multi-arch images...Rashida
Z
2

I ran into the same issue. My solution was to:

  1. Pull the image locally as you described with docker pull registry/image:tag --platform linux/amd64.
  2. Set your containers spec's 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.

Zashin answered 5/5, 2023 at 12:41 Comment(0)
E
2

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)

Exercitation answered 7/6, 2023 at 21:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.