<p>I am trying to install kubernetes with kubeadm in my laptop which has <strong>Ubuntu 16.04</strong>. I have disabled swap, since kubelet does not work with swap on. The command I used is :</p>

<p><code>swapoff -a</code></p>

<p>I also commented out the reference to swap in <code>/etc/fstab</code>.</p>

<pre><code># /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;    &lt;dump&gt;  &lt;pass&gt;
# / was on /dev/sda1 during installation
UUID=1d343a19-bd75-47a6-899d-7c8bc93e28ff /            ext4 errors=remount-ro 0    1
# swap was on /dev/sda5 during installation
#UUID=d0200036-b211-4e6e-a194-ac2e51dfb27d none         swap sw           0    0
</code></pre>

<p>I confirmed swap is turned off by running the following:</p>

<pre><code>free -m
              total        used        free      shared  buff/cache   available
Mem:          15936        2108        9433         954        4394       12465
Swap:             0           0           0
</code></pre>

<p>When I start kubeadm, I get the following error:</p>

<pre><code>kubeadm init --pod-network-cidr=10.244.0.0/16
[init] Using Kubernetes version: v1.14.2
[preflight] Running pre-flight checks
    [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
error execution phase preflight: [preflight] Some fatal errors occurred:
    [ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
</code></pre>

<p>I also tried restarting my laptop, but I get the same error. What could the reason be?</p>

Pravin Kumar
<p>below was the root cause.</p>

<p>detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd".</p>

<p>you need to update the docker cgroup driver.</p>

<p>follow the below fix</p>

<pre><code>cat &gt; /etc/docker/daemon.json &lt;&lt;EOF
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "storage-driver": "overlay2",
  "storage-opts": [
    "overlay2.override_kernel_check=true"
  ]
}
EOF

mkdir -p /etc/systemd/system/docker.service.d

# Restart Docker
systemctl daemon-reload
systemctl restart docker
</code></pre>
