Kind: Errors while building and running kind

Created on 6 May 2019  ·  9Comments  ·  Source: kubernetes-sigs/kind

What happened:
Hitting with the following error:

ERROR1: Error while building base-image:

INFO[09:03:55] Building in kind-build-d0e9e8e8-853e-4095-9c0d-d82d67689c2a
DEBU[09:03:55] Running: /usr/bin/docker [docker exec kind-build-d0e9e8e8-853e-4095-9c0d-d82d67689c2a mkdir /kind/]
DEBU[09:03:55] Running: /usr/bin/docker [docker exec kind-build-d0e9e8e8-853e-4095-9c0d-d82d67689c2a rsync -r /build/bits/ /kind/]
DEBU[09:03:55] Running: /usr/bin/docker [docker exec kind-build-d0e9e8e8-853e-4095-9c0d-d82d67689c2a /bin/sh -c curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -]
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
ERRO[09:03:56] Adding Kubernetes apt key failed! exit status 255
ERRO[09:03:56] Image build Failed! Failed to install Kubernetes: exit status 255
DEBU[09:03:56] Running: /usr/bin/docker [docker rm -f -v kind-build-d0e9e8e8-853e-4095-9c0d-d82d67689c2a]
Error: error building node image: exit status 255
root@ip9-114-192-229:~/kind_ws/src/sigs.k8s.io/kind#

ERROR2: Error while running create cluster:

./kind create cluster --loglevel debug --image node:latest


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 35230 -p 127.0.0.1:35230:6443 node:latest

# docker logs 096465b64473
Initializing machine ID from random generator.
mount: /sys/class/dmi/id/product_name: mount point does not exist.
root@ip9-114-192-229:~/kind_ws/src/sigs.k8s.io/kind#
kinbug

All 9 comments

@mkumatag the base image changed recently #461 , please fetch the latest sources and try to build again the base image.

@mkumatag the base image changed recently #461 , please fetch the latest sources and try to build again the base image.

@aojea I have the latest master code, and even submitted a PR to fix the issues I mentioned.

ERROR1 is happening while building the base-image via apt method, this is happening because of the following thing:

failing while adding the apt-key:

DEBU[09:03:55] Running: /usr/bin/docker [docker exec kind-build-d0e9e8e8-853e-4095-9c0d-d82d67689c2a /bin/sh -c curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -]
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
ERRO[09:03:56] Adding Kubernetes apt key failed! exit status 255
ERRO[09:03:56] Image build Failed! Failed to install Kubernetes: exit status 255
DEBU[09:03:56] Running: /usr/bin/docker [docker rm -f -v kind-build-d0e9e8e8-853e-4095-9c0d-d82d67689c2a]
Error: error building node image: exit status 255

somehow gnupg is missing somehow in ubuntu:19.04 release and we need to install it manually to add the apt keys.

╰─ docker run -ti ubuntu:19.04 bash
root@c1cf9af7ba35:/#
root@c1cf9af7ba35:/# dpkg -l | grep gnupg
root@c1cf9af7ba35:/#

ERROR2 is happening because of mount command at
https://github.com/kubernetes-sigs/kind/blob/master/images/base/entrypoint#L65 which creates a problem if that directory does not exist in another environment(e.g: some stand alone env not in google cloud)

/cc @BenTheElder

awesome,
regarding ERROR1 Ben is leaning toward deprecating the apt build, see #491, but I found it useful too :)

Regarding ERROR2 is something I can't understand because I think that all linux hosts have that folder /sys/class/dmi/id/product_name

error1: has some prior discussion 😁

error2: We can add a check for if /sys/class/dmi/id/product_name exists, but it's a VFS and should exist 🤔

error1: has some prior discussion 😁

I understand the concern here, but other methods like docker does not work other non-amd architectures at the moment, so apt is the only solution at the moment :( So we can support timebeing till we get some other way of building the images(tar, docker etc)

error2: We can add a check for if /sys/class/dmi/id/product_name exists, but it's a VFS and should exist 🤔

This is based on the SMBIOS support matrics! currently this sys class file will be populated only for following archs and will not be there for ppc64le and s390x

 IA-32 (x86),
388  x64 (x86-64, Intel64, AMD64, EM64T),
389  Intel® Itanium® architecture,
390  32-bit ARM (Aarch32),
391  64-bit ARM (Aarch64).

Ref: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.0.0.pdf

error1: yes, I'd like to get tar, but let's fix apt until the tarball support is in.

err2: thanks! I was just digging into that. unless we expect code to detect architecture based on this, I think I'll come back and ensure the entire directory is fake for CI <-> local consistency.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mithunvikram picture mithunvikram  ·  3Comments

cjwagner picture cjwagner  ·  3Comments

tommyknows picture tommyknows  ·  3Comments

BenTheElder picture BenTheElder  ·  4Comments

philipstaffordwood picture philipstaffordwood  ·  4Comments