Skip to content

Kind cluster creation fails on final port mapping step if using a macvlan docker network #4047

@saffronjam

Description

@saffronjam

What happened:

We tried to create a Kind cluster using a pre-created docker network named kind of type macvlan.

Since a macvlan docker network does not support port mapping, the final step in the Kind cluster creation fails.

What you expected to happen:

To skip the final port mapping step.

fyi: Omitting the port mapping behavior in the source code and building it ourselves solves this issue for us, and is our current work around. But it would be nice to not need to do that.

How to reproduce it:

  1. Create a docker network of type macvlan, must be named kind
docker network create -d macvlan --subnet=... --ip-range=... --gateway=... -o parent=... kind
  1. Create a Kind cluster

  2. Wait for it to fail in the end of creation:

ERROR: failed to create cluster: failed to get api server port: command "docker inspect --format '{{ with (index (index .NetworkSettings.Ports "6443/tcp") 0) }}{{ printf "%s	%s" .HostIp .HostPort }}{{ end }}' test-control-plane" failed with error: exit status 1

Environment:

  • kind version: 0.30.0
  • Runtime info: Docker 28.5.1
  • OS: Ubuntu 24.04
  • Kubernetes version: v1.34.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions