Cannot connect to the Docker daemon at unix:///var/run/docker.sock. (CKAD)

7/21/2020

I'm following the Certified Kubernetes Application Developer (CKAD) Certification, and in their manual they are providing a bash file to deploy a master node using Kubeadm, and this is it's content :

https://gofile.io/d/d2l1UJ

But when I run this bash file using: sudo bash deploy.sh I get an error message as shown in this screenshot:

enter image description here

I tried to start docker using: sudo systemctl start docker but I get this error:

Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

So then I run systemctl status docker.service and I get this:

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-07-21 05:31:17 PDT; 1min 0s ago
     Docs: https://docs.docker.com
  Process: 10196 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 10196 (code=exited, status=1/FAILURE)

Jul 21 05:31:15 master systemd[1]: Failed to start Docker Application Container Engine.
Jul 21 05:31:17 master systemd[1]: docker.service: Service hold-off time over, scheduling restart.
Jul 21 05:31:17 master systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Jul 21 05:31:17 master systemd[1]: Stopped Docker Application Container Engine.
Jul 21 05:31:17 master systemd[1]: docker.service: Start request repeated too quickly.
Jul 21 05:31:17 master systemd[1]: docker.service: Failed with result 'exit-code'.
Jul 21 05:31:17 master systemd[1]: Failed to start Docker Application Container Engine.

And when I run journalctl -xe:

-- Unit kubelet.service has finished starting up.
--
-- The start-up result is RESULT.
Jul 21 05:32:46 master kubelet[10531]: F0721 05:32:46.664769   10531 server.go:199] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml",
Jul 21 05:32:46 master systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Jul 21 05:32:46 master systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 21 05:32:56 master systemd[1]: kubelet.service: Service hold-off time over, scheduling restart.
Jul 21 05:32:56 master systemd[1]: kubelet.service: Scheduled restart job, restart counter is at 189.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit kubelet.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jul 21 05:32:56 master systemd[1]: Stopped kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished shutting down.
Jul 21 05:32:56 master systemd[1]: Started kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished starting up.
--
-- The start-up result is RESULT.
Jul 21 05:32:56 master kubelet[10562]: F0721 05:32:56.915762   10562 server.go:199] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml",
Jul 21 05:32:56 master systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Jul 21 05:32:56 master systemd[1]: kubelet.service: Failed with result 'exit-code'.
Jul 21 05:33:07 master systemd[1]: kubelet.service: Service hold-off time over, scheduling restart.
Jul 21 05:33:07 master systemd[1]: kubelet.service: Scheduled restart job, restart counter is at 190.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Automatic restarting of the unit kubelet.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jul 21 05:33:07 master systemd[1]: Stopped kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished shutting down
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished shutting down.
Jul 21 05:33:07 master systemd[1]: Started kubelet: The Kubernetes Node Agent.
-- Subject: Unit kubelet.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit kubelet.service has finished starting up.
--
-- The start-up result is RESULT.
Jul 21 05:33:07 master kubelet[10594]: F0721 05:33:07.167571   10594 server.go:199] failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml",
Jul 21 05:33:07 master systemd[1]: kubelet.service: Main process exited, code=exited, status=255/n/a
Jul 21 05:33:07 master systemd[1]: kubelet.service: Failed with result 'exit-code'.

#Edit:

It seems that my host configuration is fine, when I run the bash file to check for the host config before starting the CKAD course I get this:

Checking that this computer is suitable for LFD459: Kubernetes for App Developers
--------------------------------------------------------------------------------
PASS: CPU architecture is x86_64
PASS: 4 core CPU
PASS: Your CPU appears powerful enough (currently at 28800 BogoMIPS cumulatively)
PASS: 8 GiB RAM
PASS: 18 GiB free disk space in /home/student
PASS: 18544 MiB free disk space in /boot
PASS: Linux distribution architecture is x86_64
NOTE: Currently running Ubuntu 18.04.4 LTS (supported)
PASS: Internet is available (which is required in this case)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
NOTE: Verifying LFD459_V1.18.1_SOLUTIONS.tar.bz2...
LFD459_V1.18.1_SOLUTIONS.tar.bz2 can be found in /home/student/LFT (matches md5sum)
--------------------------------------------------------------------------------
PASS: You are ready for the course! W00t!
NOTE: Make sure to follow the instructions above to fix any issues found
-- Croviajo
docker
kubernetes
ubuntu-18.04

0 Answers