Kubeadm: Crictl not contained in kubeadm and kubelet snaps, not obvious how to install it

Created on 15 Jul 2018  路  12Comments  路  Source: kubernetes/kubeadm

Crictl is not contained in kubeadm and kubelet snaps leading to the error [ERROR FileExisting-crictl]: crictl not found in system path, and it's not obvious how to install it. Some people claim go get github.com/kubernetes-incubator/cri-tools/cmd/crictl fixes it, but that runs through without an error for me and I still get the preflight error.

Therefore, I suggest that if you're involved in packaging the snaps (or even if not) you help them address this issue somehow.

Versions

kubeadm version (use kubeadm version):

# kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:14:41Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}

snap version / snap info kubeadm:

# snap info kubeadm
name:      kubeadm
summary:   easily bootstrap a secure Kubernetes cluster
publisher: canonical
contact:   [email protected]
license:   unknown
description: |
  easily bootstrap a secure Kubernetes cluster
commands:
  - kubeadm
snap-id:      QwW3AXRUWqQDuZKdaCDQqiGKH4K3Cr5w
tracking:     stable
refresh-date: today at 13:57 CEST
channels:                           
  stable:         1.11.0 (448) 11MB classic
  candidate:      1.11.0 (448) 11MB classic
  beta:           1.11.0 (448) 11MB classic
  edge:           1.11.0 (448) 11MB classic
  1.10/stable:    1.10.5 (447) 24MB classic
  1.10/candidate: 1.10.5 (457) 24MB classic
  1.10/beta:      1.10.5 (457) 24MB classic
  1.10/edge:      1.10.5 (457) 24MB classic
  1.11/stable:    1.11.0 (448) 11MB classic
  1.11/candidate: 1.11.0 (448) 11MB classic
  1.11/beta:      1.11.0 (448) 11MB classic
  1.11/edge:      1.11.0 (448) 11MB classic
  1.6/stable:     1.6.13 (234) 11MB classic
  1.6/candidate:  1.6.13 (234) 11MB classic
  1.6/beta:       1.6.13 (234) 11MB classic
  1.6/edge:       1.6.13 (234) 11MB classic
  1.7/stable:     1.7.16 (396) 12MB classic
  1.7/candidate:  1.7.16 (396) 12MB classic
  1.7/beta:       1.7.16 (396) 12MB classic
  1.7/edge:       1.7.16 (396) 12MB classic
  1.8/stable:     1.8.15 (456) 21MB classic
  1.8/candidate:  1.8.15 (456) 21MB classic
  1.8/beta:       1.8.15 (456) 21MB classic
  1.8/edge:       1.8.15 (456) 21MB classic
  1.9/stable:     1.9.9  (445) 23MB classic
  1.9/candidate:  1.9.9  (445) 23MB classic
  1.9/beta:       1.9.9  (445) 23MB classic
  1.9/edge:       1.9.9  (445) 23MB classic
installed:        1.11.0 (448) 11MB classic

Environment:

  • Kubernetes version (use kubectl version):
  • Cloud provider or hardware configuration: hetzner cloud
  • OS Ubuntu 18.04 LTS
  • Kernel (e.g. uname -a): Linux kubernetes-test-1 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

What happened?

# kubeadm init
I0715 14:39:34.435856   10931 feature_gate.go:230] feature gates: &{map[]}
[init] using Kubernetes version: v1.11.0
[preflight] running pre-flight checks
    [WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
    [WARNING FileExisting-socat]: socat not found in system path
I0715 14:39:34.505805   10931 kernel_validator.go:81] Validating kernel version
I0715 14:39:34.506016   10931 kernel_validator.go:96] Validating kernel config
    [WARNING SystemVerification]: docker version is greater than the most recently validated version. Docker version: 17.12.1-ce. Max validated version: 17.03
    [WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'
[preflight] Some fatal errors occurred:
    [ERROR FileExisting-crictl]: crictl not found in system path
    [ERROR Port-10250]: Port 10250 is in use
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

What you expected to happen?

It works, or it is more obvious how to install crictl:

# snap install crictl
error: snap "crictl" not found
# apt install crictl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package crictl

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

Install Ubuntu 18.04 LTS, then:

apt update --fix-missing && apt upgrade -y
apt install -y docker.io daemonize
snap install --classic kubelet
daemonize kubelet
snap install --classic kubeadm
kubeadm init

(sorry if I forgot a step, but it should be pretty complete)

Anything else we need to know?

areecosystem

Most helpful comment

@JonasT
how about downloading cri-tools from here and copying the crictl binary to /usr/bin:
https://github.com/kubernetes-incubator/cri-tools/releases

this is the file for your system:
crictl-v1.11.1-linux-amd64.tar.gz

All 12 comments

snap is not supported.

i think the packaged binaries you are using are done by a third party, because the official packages should include crictl:
https://kubernetes.io/docs/tasks/tools/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl

when you do go get check where the generated binary is placed. typically it's in $GOPATH/bin/ directory. Then ensure that the directory is in your PATH and see if that helps

@all This is yet another example of user confusion caused by artificial dependency to crictl. Most of users don't have CRI configured, but kubeadm still insists on installng crictl, which is absolutely not needed in such a cases.

but how would the kubelet work if the user doesn't have a CRI configured?

right now, kubeadm uses crictl for pulling images and it's going to be used for more things in the future -
therefore the dependency in 1.11.
if it's not part of our 1.11 debs and rpms i think we should fix that.

but how would the kubelet work if the user doesn't have a CRI configured?

It will work with docker. So far it has been most usable scenario. The confusion I'm talking about was started when kubeadm started to require crictl installed on the system.

Considering CoreOS is a supported platform (at least kubeadm documentation prominently features it) and crictl is not easily available on it, this change could have been communicated better IMHO. It should have been mentioned in the Changelog at the very least (only mentions the packages ship it now).

The last comment available on this very topic is this which indicates the check is _not_ being promoted to an error in my eyes.

@JonasT This issue should be at least partly fixed by this PR. Can you test the latest master code to confirm that it's fixed?

The only kubernetes install paths I'm familiar with is apt (which has it packaged) and snap (which I don't know how to update to the latest master), both combined with kubeadm, so I'm not fully sure how to do that

@JonasT never mind then. I'll test it after this PR is approved.

@JonasT
how about downloading cri-tools from here and copying the crictl binary to /usr/bin:
https://github.com/kubernetes-incubator/cri-tools/releases

this is the file for your system:
crictl-v1.11.1-linux-amd64.tar.gz

@neolit123 I did manage to install it by copying it over from the go get compilation, so I'm no longer "stuck". Thanks for the help though!

thank you. good to know!

Was this page helpful?
0 / 5 - 0 ratings