<p>I'm trying to install and run a single-node lightweight kubernetes cluster, to play around with on my Raspberry pi4, of which I found k3s. However, from what I've read or seen, I'm probably missing something, but haven't found reference to the exact problem I'm getting (testing with simple kubectl command after installation):</p>
<pre><code>$ kubectl get nodes
Error from server (ServiceUnavailable): the server is currently unable to handle the request
</code></pre>
<p>The installations that I've referenced:</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=N4bfNefjBSw&amp;ab_channel=JeffGeerling" rel="nofollow noreferrer">Turing Pis, multi-node cluster</a>
-&gt; The part of knowing and using Ansible currently seems like bit of a overkill)</li>
<li><a href="https://collabnix.com/get-started-with-k3s-a-lightweight-kubernetes-distribution-for-raspberry-pi-cluster/" rel="nofollow noreferrer">Pi setup &amp; k3s install</a> -&gt; Good tutorial, but not having similar config responses?</li>
</ul>
<pre><code>$ sudo k3s server
INFO[2020-09-30T06:58:13.488363192+01:00] Starting k3s v1.18.9+k3s1 (630bebf9)
INFO[2020-09-30T06:58:13.489450500+01:00] Cluster bootstrap already complete
FATA[2020-09-30T06:58:13.535582640+01:00] starting kubernetes: preparing server: start cluster and https: listen tcp :6443: bind: address already in use
</code></pre>
<blockquote>
<p>Presumed that this isn't necessary anymore then, based on the newer installation version.</p>
</blockquote>
<ul>
<li><a href="https://www.youtube.com/watch?v=FrGpJNI8na4&amp;ab_channel=RancherLabs" rel="nofollow noreferrer">complete k3s 101 youtube</a> -&gt;  Still not magically working, as shown.</li>
</ul>
<p>So if anyone is able to please help me, or guide me in a direction to better debug and display the problem so that I understand and can fix the problem.</p>
<p>Feedback from the installation didn't display that anything went wrong:</p>
<pre><code>$ sudo curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC=&quot;--write-kubeconfig-mode 664&quot; sh -
[INFO]  Finding release for channel stable
[INFO]  Using v1.18.9+k3s1 as release
[INFO]  Downloading hash https://github.com/rancher/k3s/releases/download/v1.18.9+k3s1/sha256sum-arm.txt
[INFO]  Downloading binary https://github.com/rancher/k3s/releases/download/v1.18.9+k3s1/k3s-armhf
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s
</code></pre>
<p>After that, trying commands:</p>
<pre><code>$ k3s --version
k3s version v1.18.9+k3s1 (630bebf9)
$ kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18&quot;, GitVersion:&quot;v1.18.9+k3s1&quot;, GitCommit:&quot;630bebf94b9dce6b8cd3d402644ed023b3af8f90&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-09-17T19:04:57Z&quot;, GoVersion:&quot;go1.13.15&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/arm&quot;}
Error from server (ServiceUnavailable): the server is currently unable to handle the request
$ sudo kubectl get nodes
Error from server (ServiceUnavailable): the server is currently unable to handle the request
$ sudo k3s kubectl get nodes
The connection to the server 127.0.0.1:6443 was refused - did you specify the right host or port?
</code></pre>
<p>And looking with htop, definitely 'something' is happening with k3s servers:</p>
<p><a href="https://i.stack.imgur.com/Eyj1l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Eyj1l.png" alt="k3s with htop" /></a></p>
<p>Not sure if anything is missing, or must be changed to hosts, for k3s server + agent on device:</p>
<pre><code>127.0.0.1   localhost
::1     localhost ip6-localhost ip6-loopback
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

127.0.1.1       raspberrypi
</code></pre>
<p>... No clue what to debug further??</p>

Paul
<p>After learning a bit more of the installation process, by watching this video (<a href="https://www.youtube.com/watch?v=DjpVtNjiXSU&amp;ab_channel=AlexEllis" rel="noreferrer">k3s install on Pi4 - live walkthrough</a>), I noticed that k3s runs as a service on raspbian.</p>
<p>meaning you're able to:</p>
<pre><code># see all listed services, to find the name of the running k3s service
$ systemctl --type=service

# service name ironically being 'k3s', and being able to follow the logs for service
$ journalctl -u k3s -f
</code></pre>
<p><a href="https://i.stack.imgur.com/KuCGO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KuCGO.png" alt="k3s-logs error" /></a></p>
<p>However, looking in '/boot/cmdline.txt', these cgroup values where in the file, but after a endline-character, which prohibited the k3s service sufficiently reading from the file. File content required to be:</p>
<pre><code>$ sudo cat /boot/cmdline.txt

console=serial0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait cgroup_enable=1 cgroup_memory=1 cgroup_enable=memory
</code></pre>
<p>With that done, I checked journalctl again for the logs, and noticed significantly other logs, regarding pod's containers etc. Master node being functional!:</p>
<pre><code>$ sudo kubectl get nodes
NAME          STATUS   ROLES    AGE     VERSION
raspberrypi   Ready    master   3m52s   v1.18.9+k3s1
</code></pre>
<blockquote>
<p>If this still doesn't work, I also saw a recent blog post regarding the same issue (due to raspbian kernal update), where fix is also suggested -&gt; <a href="https://blog.codybunch.com/2020/07/31/Fixing-cgroup-memory-on-Raspbian-Buster-for-Kernel-54x/" rel="noreferrer">post</a></p>
</blockquote>
