<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chris Carr</title>
    <description>The latest articles on DEV Community by Chris Carr (@chriscarrau).</description>
    <link>https://dev.to/chriscarrau</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F686313%2F4f55730e-8ace-41e7-bd2b-5ac85a6f0f9e.jpeg</url>
      <title>DEV Community: Chris Carr</title>
      <link>https://dev.to/chriscarrau</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chriscarrau"/>
    <language>en</language>
    <item>
      <title>Longhorn on Raspbian 64 with WSL with Dashboard</title>
      <dc:creator>Chris Carr</dc:creator>
      <pubDate>Sun, 29 Aug 2021 09:38:22 +0000</pubDate>
      <link>https://dev.to/chriscarrau/longhorn-on-raspbian-64-with-wsl-with-dashboard-465n</link>
      <guid>https://dev.to/chriscarrau/longhorn-on-raspbian-64-with-wsl-with-dashboard-465n</guid>
      <description>&lt;p&gt;I have a Raspberry Pi cluster with three nodes including the control plane running on 3 Raspberry Pi 4's with 8Gb RAM. The control plane (k8s-pi) has a USB SSD attached from which it boots Kubernetes (well, k3s). It also runs on Raspbian 64 which is an experimental release.&lt;br&gt;
There are numerous posts already that explain how to achieve this setup. This post is specifically about how to use the control plane SSD as a persistent volume using Longhorn.&lt;br&gt;
K3s comes with Rancher’s Local Path Provisioner, but I wanted to use Longhorn, an open-source distributed block storage system for Kubernetes.&lt;br&gt;
Longhorn mentions in its' documentation that it supports ARM64 (experimental).&lt;br&gt;
Note: This cluster has not been built to run anything remotely like a production system - it's purely for my own enjoyment, so piling on the experimental features is fine.&lt;/p&gt;

&lt;p&gt;Before you start, install open-iscsi on each node in the cluster (thanks &lt;a href="https://dev.to/bbende/k3s-on-raspberry-pi-volumes-and-storage-1om5"&gt;Bryan&lt;/a&gt; for the tip)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install open-iscsi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now to install longhorn, the documentation that you find here&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(https://longhorn.io/docs/0.8.0/install/install-with-kubectl/) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;says to use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v0.8.0/deploy/longhorn.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However after failing to get this to work, a quick look into docker hub lists this tagged version as supporting only linux/amd64.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc2u3rbfmpjzv0jo6dcvm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc2u3rbfmpjzv0jo6dcvm.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;
We need ARM because we're deploying on a Raspberry Pi, so where is the ARM version? Following the tags for this image in docker hub, we discover that we need v1.1.2 (this is the latest release at time of writing)&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdku9do0kcpm0x6ccbs6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frdku9do0kcpm0x6ccbs6.png" alt="image"&gt;&lt;/a&gt;&lt;br&gt;
So we can simply change the path in the above link to the v1.1.2 of the yaml file like so&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.1.2/deploy/longhorn.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Longhorn took about ten minutes to start on my setup. You can monitor the startup by using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get po -n longhorn-system --watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It created about ten pods per node on my system.&lt;br&gt;
Now to create the ingress for the longhorn dashboard (again thanks to &lt;a href="https://dev.to/bbende/k3s-on-raspberry-pi-volumes-and-storage-1om5"&gt;Bryan&lt;/a&gt; copy this into ingress.yaml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: longhorn-system
  name: longhorn-ingress
  annotations:
    kubernetes.io/ingress.class: "traefik"
spec:
  rules:
  - host: longhorn-ui
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: longhorn-frontend
            port:
              number: 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f ingress.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, if you're using WSL you'll have to edit the windows hosts file on your local machine. Remember to do this as admin. The hosts file is usually located here on Windows 10.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;C:\Windows\System32\drivers\etc\hosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The host entry below identifies the node on which the SSD is attached. On my system, this is the control plane which has the IP address 192.168.1.100, so there is a line in my hosts file like so&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.1.100 k8s-pi longhorn-ui
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is because I also reference the control plane as k8s-pi - you just need the longhorn-ui entry appended to the control plane IP&lt;br&gt;
Now you should be able to see your dashboard at&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://longhorn-ui
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qlynlsr3fp3m1422yg8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qlynlsr3fp3m1422yg8.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>longhorn</category>
      <category>raspberrypi</category>
      <category>raspbian</category>
    </item>
  </channel>
</rss>
