Notes: Running Julia/Pluto on Raspberry Pi Kubernetes cluster
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.
Notes on Kubernetes-native ways to visualize IoT sensor data
High level summary of capturing environmental data and visualizing on grafana using k8s ways
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
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
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.