Kind: Error: failed to load image: exit status 1

Created on 30 Aug 2019  路  5Comments  路  Source: kubernetes-sigs/kind

What happened:

I try to load a custom image in the "multinode" kind cluster I just created and it fails.
See the following:

export KUBECONFIG="$(kind get kubeconfig-path --name="multinode")"
docker build -t my-custom-image:latest .
kind load --loglevel trace docker-image my-custom-image

And the output:

DEBU[16:44:19] Running: /usr/bin/docker [docker image inspect -f {{ .Id }} my-custom-image] 
DEBU[16:44:19] 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"}}] 
DEBU[16:44:19] 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[16:44:19] Running: /usr/bin/docker [docker inspect -f {{index .Config.Labels "io.k8s.sigs.kind.role"}} kind-control-plane] 
DEBU[16:44:19] Running: /usr/bin/docker [docker exec --privileged kind-control-plane crictl inspecti my-custom-image] 
DEBU[16:44:19] Image: "my-custom-image" with ID "sha256:f10d051301f9c8a90be2fd2fe085d1d6d6629f6d1229d141b06d0541ae9d3a3f" not present on node "kind-control-plane" 
DEBU[16:44:19] Running: /usr/bin/docker [docker save -o /tmp/image-tar685445440/image.tar my-custom-image] 
DEBU[16:44:20] Running: /usr/bin/docker [docker exec --privileged -i kind-control-plane ctr --namespace=k8s.io images import -] 
Error: failed to load image: exit status 1

What you expected to happen:

The docker image to be successfully loaded in the cluster.

How to reproduce it (as minimally and precisely as possible):

Create the following file config.yaml

kind: Cluster
apiVersion: kind.sigs.k8s.io/v1alpha3
nodes:
- role: control-plane
- role: worker
- role: worker

Create the cluster:

kind create cluster --config config.yaml --name multinode

Try to load any image:

docker pull ubuntu
export KUBECONFIG="$(kind get kubeconfig-path --name="multinode")"
kind load --loglevel trace docker-image ubuntu

Environment:

  • kind version: (use kind version):
    v0.5.1
  • Kubernetes version: (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-20T18:57:36Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
  • Docker version: (use docker info):
Client:
 Debug Mode: false

Server:
 Containers: 41
  Running: 4
  Paused: 0
  Stopped: 37
 Images: 231
 Server Version: 19.03.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 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: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 3.10.0-957.27.2.el7.x86_64
 Operating System: Red Hat Enterprise Linux Workstation 7.6 (Maipo)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 30.94GiB
 Name: oc4204838823
 ID: Y66Q:IIGC:GNPE:JC5V:MQ7H:K7VE:2MZC:SROQ:NK2R:A24Y:YZH3:6XH5
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
  • OS (e.g. from /etc/os-release):
NAME="Red Hat Enterprise Linux Workstation"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Workstation"
VARIANT_ID="workstation"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Workstation 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:workstation"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"
kinsupport

Most helpful comment

kind load --loglevel trace docker-image my-custom-image

should be:
kind load --loglevel trace docker-image --name=multinode my-custom-image

All 5 comments

kind load --loglevel trace docker-image my-custom-image

should be:
kind load --loglevel trace docker-image --name=multinode my-custom-image

--name keys your cluster, if you don't use the default cluster name then you need to specify it for any cluster operations.

we should give a better error message here but we have broader tracking issues for that (and I'm working on that today, after bug triage etc... 馃槄 )

Ahhh apologies, didn't realize I had to specify the name when loading!
It works as expected with --name parameter
Maybe it should be mentioned in the documentation?

I agree, we should update the image loading documentation :sweat_smile:

Was this page helpful?
0 / 5 - 0 ratings