What happened:
I used go get to install kind and tried to run kind create cluster:
$ GO111MODULE="on" go get sigs.k8s.io/[email protected]
# ...
# works fine
$ kind create cluster --loglevel=debug
DEBU[12:59:47] Running: /usr/bin/docker [docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format {{.Names}}\t{{.Label "io.k8s.sigs.kind.cluster"}}]
Creating cluster "kind" ...
DEBU[12:59:47] Running: /usr/bin/docker [docker inspect --type=image kindest/node:v1.15.0]
INFO[12:59:47] Image: kindest/node:v1.15.0 present locally
✓ Ensuring node image (kindest/node:v1.15.0) 🖼
DEBU[12:59:47] Running: /usr/bin/docker [docker info --format '{{json .SecurityOptions}}']
DEBU[12:59:48] Running: /usr/bin/docker [docker run -d -t --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname kind-control-plane --name kind-control-plane --label io.k8s.sigs.kind.cluster=kind --label io.k8s.sigs.kind.role=control-plane --expose 39099 --publish=127.0.0.1:39099:6443 kindest/node:v1.15.0@sha256:b4d092fd2b507843dd096fe6c85d06a27a0cbd740a0b32a880fe61aba24bb478]
ERRO[12:59:50] 74699034a1aeaaac75f9edf05ef7cc31d73928c89c2f31cc91c0343f6f1f1c27
ERRO[12:59:50] docker: Error response from daemon: driver failed programming external connectivity on endpoint kind-control-plane (25a639eeb40ae0b76d6d0d86a35f7b0ae41a5291e29057e524cbad2a60e161f1): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 127.0.0.1 --dport 39099 -j DNAT --to-destination 172.17.0.2:6443 ! -i docker0: iptables v1.8.2 (nf_tables): Chain 'DOCKER' does not exist
ERRO[12:59:50] (exit status 1)).
✗ Preparing nodes 📦
ERRO[12:59:50] docker run error: exit status 125
DEBU[12:59:50] Running: /usr/bin/docker [docker ps -q -a --no-trunc --filter label=io.k8s.sigs.kind.cluster --format {{.Names}}\t{{.Label "io.k8s.sigs.kind.cluster"}} --filter label=io.k8s.sigs.kind.cluster=kind]
DEBU[12:59:50] Running: /usr/bin/docker [docker rm -f -v kind-control-plane]
Error: failed to create cluster: docker run error: exit status 125
What you expected to happen:
Cluster creation.
How to reproduce it (as minimally and precisely as possible):
Run the commands above.
Anything else we need to know?:
This looks similar to https://github.com/kubernetes-sigs/kind/issues/567, but the error I'm getting is a bit different and the solution to that issue is not working for me (the second command described here doesn't appear to be valid).
Environment:
kind version): v0.4.0kubectl version):Client Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.9-gke.7", GitCommit:"b6001a5d99c235723fc19342d347eee4394f2005", GitTreeState:"clean", BuildDate:"2019-06-24T19:27:39Z", GoVersion:"go1.10.8b4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.7-gke.25", GitCommit:"d4c79083ab6dea5d26ef4ed8d50b145268349bc3", GitTreeState:"clean", BuildDate:"2019-06-22T16:10:31Z", GoVersion:"go1.10.8b4", Compiler:"gc", Platform:"linux/amd64"}
docker info): Server Version: 18.09.3/etc/os-release): Debian GNU/Linux 10 (buster)/assign @BenTheElder
ERRO[12:59:50] docker: Error response from daemon: driver failed programming external connectivity on endpoint kind-control-plane (25a639eeb40ae0b76d6d0d86a35f7b0ae41a5291e29057e524cbad2a60e161f1): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 127.0.0.1 --dport 39099 -j DNAT --to-destination 172.17.0.2:6443 ! -i docker0: iptables v1.8.2 (nf_tables): Chain 'DOCKER' does not exist
that's a problem with your docker installation preventing port forwarding from working
sudo service docker restart is one possible work around
That did it! Thanks Ben!
Most helpful comment
sudo service docker restartis one possible work around