Notes: Running Julia/Pluto on Raspberry Pi Kubernetes cluster

Photo by Markus Winkler on Unsplash

Recently I have been interested in setting up Raspberry Pi based Kubernetes cluster for a variety of use cases from IoT sensor data monitoring to setting up data analytics / ML components such as TensorFlow and Julia. I have talked about some of these use cases in my previous posts and I have linked one of them below. This post is a high level summary of steps I took to setup Julia based Pluto notebooks that are commonly used for exploratory data analytics, linear algebra computations and visualizing plots.

The setup is currently ephemeral and does not retain previous data in case of node reboot or pod crash. Essentially, the steps involve setting up julia container, installing required packages and running pluto commands to invoke the notebook. Finally, we can expose the endpoint as a service and access it using port-forward. These are all very basic and simple steps, nevertheless, I like to document these for my own reference. Assuming that the Kubernetes cluster is setup correctly, the manifest to deploy julia and pluto is as follows:

Once deployed, it will trigger julia commands as shown in the deployment spec above, which can take several minutes on a Raspberry Pi. Make sure that everything went fine by checking the pod logs as follows:

└─ $ ▶ kubectl --namespace=julia-system logs -f deployments.apps/julia<redacted many lines...>Go to http://0.0.0.0:1234/ in your browser to start writing ~ have fun!Press Ctrl+C in this terminal to stop Pluto

The service can now be accessed on `127.0.0.1:8080` using port-forwarding:

└─ $ ▶ kubectl --namespace=julia-system port-forward svc/julia 8080:80 
Forwarding from 127.0.0.1:8080 -> 1234
Forwarding from [::1]:8080 -> 1234
Sample screenshot of Julia/Pluto notebook
another screenshot showing matrix calculations

That’s all for this post… I’ll leave the discussion on securing this endpoint, serving behind an ingress controller and adding storage/persistence to it for future.

--

--

--

Software engineer and entrepreneur currently building Kubernetes infrastructure and cloud native stack for edge/IoT and ML workflows.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building a Terraform Provider-Part-II — Auth and Configure Provider

Bootstrap Starter Themes for WordPress

How to root Haier l53

Root LG Phone

PMs should focus on “best fit,” not “best practices”

API’s: an open door to great solutions

Get a Handle on Swift: its Evolution and Performance

How to DevSecOps — Part 4: the team

We’re not a family. We’re a sports team.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Saurabh Deoras

Saurabh Deoras

Software engineer and entrepreneur currently building Kubernetes infrastructure and cloud native stack for edge/IoT and ML workflows.

More from Medium

Install Kubernetes on Ubuntu

Getting Started VMware Tanzu Community Edition (Part 2)

Linux Kernel Development Model

Install Ubuntu Server 64-bit on Raspberry Pi 4