Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create cluster on Mac M1 when DOCKER_DEFAULT_PLATFORM=linux/amd64 #2978

Closed
DaazKu opened this issue Oct 25, 2022 · 2 comments
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/duplicate Indicates an issue is a duplicate of other open issue.

Comments

@DaazKu
Copy link

DaazKu commented Oct 25, 2022

What happened:
I tried to create a simple cluster using kind create cluster but it failed.

Output:

Creating cluster "kind" ...
 βœ“ Ensuring node image (kindest/node:v1.25.2) πŸ–Ό 
 βœ— Preparing nodes πŸ“¦  

Logs:

INFO: ensuring we can execute mount/umount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: detected cgroup v2
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: setting iptables to detected mode: legacy
iptables-save v1.8.7 (legacy): Cannot initialize: iptables who? (do you need to insmod?)

What you expected to happen: I was expecting it to work :)

How to reproduce it (as minimally and precisely as possible):
On a Mac with an M1 chip:

DOCKER_DEFAULT_PLATFORM=linux/amd64 kind create cluster

Anything else we need to know?:
I have DOCKER_DEFAULT_PLATFORM=linux/amd64 exported by default for my day to day use of docker.
I have to do DOCKER_DEFAULT_PLATFORM=linux/arm64 kind create cluster for the cluster to work but the problem is that I do not want to be using the arm architecture.

Environment:

  • kind version: (use kind version): 0.16.0
  • Kubernetes version: (use kubectl version):
    Client Version: v1.25.0
    Kustomize Version: v4.5.7
    Server Version: v1.25.2
    
  • Docker version: (use docker info):
    Client:
     Context:    default
     Debug Mode: false
     Plugins:
      buildx: Docker Buildx (Docker Inc., v0.9.1)
      compose: Docker Compose (Docker Inc., v2.10.2)
      extension: Manages Docker extensions (Docker Inc., v0.2.9)
      sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
      scan: Docker Scan (Docker Inc., v0.19.0)
    
    Server:
     Containers: 1
      Running: 1
      Paused: 0
      Stopped: 0
     Images: 1
     Server Version: 20.10.17
     Storage Driver: overlay2
      Backing Filesystem: extfs
      Supports d_type: true
      Native Overlay Diff: true
      userxattr: false
     Logging Driver: json-file
     Cgroup Driver: cgroupfs
     Cgroup Version: 2
     Plugins:
      Volume: local
      Network: bridge host ipvlan macvlan null overlay
      Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
     Swarm: inactive
     Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
     Default Runtime: runc
     Init Binary: docker-init
     containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
     runc version: v1.1.4-0-g5fd4c4d
     init version: de40ad0
     Security Options:
      seccomp
       Profile: default
      cgroupns
     Kernel Version: 5.10.124-linuxkit
     Operating System: Docker Desktop
     OSType: linux
     Architecture: aarch64
     CPUs: 4
     Total Memory: 7.667GiB
     Name: docker-desktop
     ID: 3CG6:SQV5:LHJX:WXGJ:YV5C:36IS:AVPD:WRLE:E5JN:YUWR:LJUM:7AED
     Docker Root Dir: /var/lib/docker
     Debug Mode: false
     HTTP Proxy: http.docker.internal:3128
     HTTPS Proxy: http.docker.internal:3128
     No Proxy: hubproxy.docker.internal
     Registry: https://index.docker.io/v1/
     Labels:
     Experimental: false
     Insecure Registries:
      hubproxy.docker.internal:5000
      127.0.0.0/8
     Live Restore Enabled: false
    
  • OS (e.g. from /etc/os-release):
    image
@DaazKu DaazKu added the kind/bug Categorizes issue or PR as related to a bug. label Oct 25, 2022
@BenTheElder
Copy link
Member

This is a duplicate of #2718

@BenTheElder BenTheElder added the triage/duplicate Indicates an issue is a duplicate of other open issue. label Oct 26, 2022
@BenTheElder
Copy link
Member

I have to do DOCKER_DEFAULT_PLATFORM=linux/arm64 kind create cluster for the cluster to work but the problem is that I do not want to be using the arm architecture.

See the other issue. It is not possible to run a kind cluster with a different architecture than the host*

  • you could run a VM of a different architecture and run kind inside that, but kind considers the VM the host then. whatever platform docker is running on, kind must run this way.

There's way more detail on the other issue, but basically: the way docker runs images across architectures is an incomplete emulation that is not capable of running a complex workload like a Kubernetes cluster. There's nothing we can do about that.

We should however, do something about users with this env set to an incompatible value (warning, override it, drop it, etc) but the solution is not clear yet. In the meantime, please ensure when invoking kind that this isn't set or matches the host platform, and see the existing issue for more discussion.

@BenTheElder BenTheElder self-assigned this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/duplicate Indicates an issue is a duplicate of other open issue.
Projects
None yet
Development

No branches or pull requests

2 participants