kubernetes-sigs / kind

Kubernetes IN Docker - local clusters for testing Kubernetes
https://kind.sigs.k8s.io/
Apache License 2.0
13.22k stars 1.53k forks source link

ERROR: failed to create cluster: failed to generate kubeadm config content: failed to get kubernetes version from node: file should only be one line, got 0 lines #3528

Open younes-io opened 6 months ago

younes-io commented 6 months ago

I have just installed KIND. Really having trouble creating a basic cluster because of this annoying error:

āžœ  Camunda kind create cluster --name camunda-local
Creating cluster "camunda-local" ...
 āœ“ Ensuring node image (kindest/node:v1.29.2) šŸ–¼
 āœ“ Preparing nodes šŸ“¦
 āœ— Writing configuration šŸ“œ
Deleted nodes: ["camunda-local-control-plane"]
ERROR: failed to create cluster: failed to generate kubeadm config content: failed to get kubernetes version from node: file should only be one line, got 0 lines
āžœ  Camunda kind create cluster
Creating cluster "kind" ...
 āœ“ Ensuring node image (kindest/node:v1.29.2) šŸ–¼
 āœ“ Preparing nodes šŸ“¦
 āœ— Writing configuration šŸ“œ
Deleted nodes: ["kind-control-plane"]
ERROR: failed to create cluster: failed to generate kubeadm config content: failed to get kubernetes version from node: file should only be one line, got 0 lines
āžœ  Camunda

EDIT:

āžœ  Camunda kind version
kind v0.22.0 go1.20.13 linux/amd64
āžœ  Camunda docker info
Client:
 Version:    24.0.7-rd
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.0
    Path:     /home/onto/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.3
    Path:     /home/onto/.docker/cli-plugins/docker-compose

Server:
 Containers: 19
  Running: 8
  Paused: 0
  Stopped: 11
 Images: 13
 Server Version: 23.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 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 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 0cae528dd6cb557f7201036e9f43420650207b58
 runc version: 51d5e94601ceffbbd85688df1c928ecccbfa4685
 init version:
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 5.15.133.1-microsoft-standard-WSL2
 Operating System: Rancher Desktop WSL Distribution
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.49GiB
 Name: uoy-npf3
 ID: 56b673cb-fa03-4826-b076-0c14583dc166
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
āžœ  Camunda
āžœ  Camunda sudo cat /etc/os-release
[sudo] password for onto:
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
āžœ  Camunda kubectl version
Client Version: v1.29.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.6+k3s2
āžœ  Camunda
āžœ  Camunda cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.24.48.1
āžœ  Camunda
stmcginnis commented 6 months ago

Definitely will need more details than that to help troubleshoot. Can you fill in the rest of the prompts from the issue template:



It looks like you are using WSL. There are various issues that are commonly encountered, depending on how you have things set up. But if you can provide a little more detail, that might help narrow things down.

younes-io commented 6 months ago

@stmcginnis done =)

BenTheElder commented 4 months ago

We're going to need kind create cluster --retain && kind export logs && kind delete cluster, something with this host is causing the node containers to exit early most likely, given we fail to cat a static file right after starting them ...

pedro-cs-ribeiro commented 4 weeks ago

Hello @BenTheElder BenTheElder @younes-io I'm also getting the same issue. Here are the logs reproducing the issue:

PS C:\Users\PedroRibeiro> kind create cluster --retain
Creating cluster "kind" ...
 ā€¢ Ensuring node image (kindest/node:v1.30.0) šŸ–¼  ...
 āœ“ Ensuring node image (kindest/node:v1.30.0) šŸ–¼
 ā€¢ Preparing nodes šŸ“¦   ...
 āœ“ Preparing nodes šŸ“¦
 ā€¢ Writing configuration šŸ“œ  ...
 āœ— Writing configuration šŸ“œ
ERROR: failed to create cluster: failed to generate kubeadm config content: failed to get kubernetes version from node: file should only be one line, got 0 lines
PS C:\Users\PedroRibeiro> kind export logs
Exporting logs for cluster "kind" to:
C:\Users\PEDROR~1\AppData\Local\Temp\3666541512
PS C:\Users\PedroRibeiro> kind delete cluster
Deleting cluster "kind" ...
Deleted nodes: ["kind-control-plane"]

Here are the logs: 3666541512.zip

Here's my setup information:

C:\Users\PedroRibeiro>kind version
kind v0.23.0 go1.21.10 windows/amd64

C:\Users\PedroRibeiro>docker info
Client:
 Version:    27.1.1
 Context:    wsl
 Debug Mode: false

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 2
 Server Version: 27.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 5.15.153.1-microsoft-standard-WSL2
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 18.96GiB
 Name: CJ-PF4PHDLA
 ID: 80ffacf3-6c6f-4588-ae41-7cdbcfd61c5c
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

[DEPRECATION NOTICE]: API is accessible on http://0.0.0.0:2375 without encryption.
         Access to the remote API is equivalent to root access on the host. Refer
         to the 'Docker daemon attack surface' section in the documentation for
         more information: https://docs.docker.com/go/attack-surface/
In future versions this will be a hard failure preventing the daemon from starting! Learn more at: https://docs.docker.com/go/api-security/
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support

C:\Users\PedroRibeiro>kubectl version
Client Version: v1.30.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

I also just installed kind and I got this error

stmcginnis commented 4 weeks ago

I highly recommend using cgroupv2 instead of v1.