SlideShare a Scribd company logo
Building a Raspberry Pi
Kubernetes Cluster
and Running .NET Core
with OpenFaaS
Alex Ellis @alexellisuk
Scott Hanselman @shanselman
Agenda
Why build an RPi cluster?
What counts as Cloud?
Top community clusters
Practicalities of ARM & .NET Core
Intro to Kubernetes & Serverless
Demos
Why build your own cluster?
● It’s the CLOUD in your HOUSE!
● Be your own boss - you’re root, you
make the rules
● UNIX heritage
● Direct access to hardware
Let’s back up. What does
The Cloud™ look like?
$
See it? Can you
visualize
the cloud now?
Types of Cloud
“Private cloud”
http://www.hostingadvice.com/how-to/iaas-vs-paas-vs-saas/
“Private cloud”
How about
now?
Alex’s first RPi
cluster
Featured in Linux User Developer
Magazine
Had to build Docker from source
Original “Swarm” project from
Docker
29 MARCH 2016
We made a podcast
The community did something
awesome!
People LOVE building their own Cloud
In summary
Who needs an orchestrator anyway?
Lightweight “chroot”/sandbox
Densely pack applications
Immutable - same everywhere
Next-gen workflow - Build/ship/run
Docker Hub & store
Docker brings:
container
Docker container
docker run -d -p 80:80
--restart=always
--name=nginx-deployment
nginx:1.7.9
Declarative deployments
Configuration - YAML
Programmable API
Service discovery
High availability (HA)
Elastic capacity
Security & extensibility
Orchestration add:
container Deployment
Kubernetes Deployment
container
Pod
Pod
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
Kubernetes is an orchestrator
Here are the building blocks
Zine by Julia Evans
Zine by Julia Evans
No:
Accelerated gaming
Bitcoin mining
Windows binaries
Skynet
What can I do with my Pi (ARM) cluster?
Yes:
You can run server software
Python MPI (traditional
multi-processing)
A blog or website, i.e. ASP.NET,
Node.js, PHP etc
OpenFaaS - Serverless Functions Made Simple
● Community project
● Developer-first experience
○ UI & CLI
● 9k GitHub stars
● Award winning
● Thriving community
● Easiest way to run your own
FaaS or functions
OpenFaaS Demo
Want to know more?
blog.alexellis.io -
launched 2015
Around 100 blog posts on
Docker, Kubernetes, ARM
and IoT
Coding in Go, community
and DevOps
What about the software?
Pick an OS
● Raspbian (Debian-based)
● Hypriot (Raspbian-based)
● Ubuntu (Debian-based)
Something completely different:
Resin
Configure each node manually
Or automate with Ansible
But avoid duplicating SD cards
Be aware not all Docker images
support ARM
Let’s talk about CPU architecture
.NET Core
Best option for modern microservices in C#, ASP.NET also available
Natively targets: Linux, Windows and Mac
Runtime support for ARM (Raspberry Pi)
Official Docker images are available from Microsoft
...
.NET Core + Kubernetes
Multi-Arch Cross
Compilation
Build in a container
Publish to specific
CPU Arch
Use correct runtime
FROM microsoft/dotnet:2.0-sdk as builder
RUN mkdir -p /root/src/function
WORKDIR /root/src/function
COPY ./function/Function.csproj .
WORKDIR /root/src/
COPY ./root.csproj .
RUN dotnet restore ./root.csproj
COPY . .
RUN dotnet publish -c release -o published -r linux-arm
ADD https://github.com/openfaas/faas/releases/download/0.6.1/fwatchdog-armhf
/usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
FROM microsoft/dotnet:2.0.0-runtime-stretch-arm32v7
WORKDIR /root/
COPY --from=builder /root/src/published .
COPY --from=builder /usr/bin/fwatchdog /
ENV fprocess="dotnet ./root.dll"
EXPOSE 8080
CMD ["/fwatchdog"]
RPi Cluster Build Consideration
● Raspberry Pis like 3A+ Reliable Power
○ Anker makes a 6 port USB Charger. One plug powers the
whole cluster!
○ Get a Raspberry Pi multi-layer case enclosure
○ Or build one with LEGO!
● Use flat and short Ethernet Cables. Wired >Wireless
○ Get cables of varied length. Use the minimum
Networking Challenges
● Wired networking is best.
● BlackBox makes a nice 8-port
USB-Powered Hub
○ Any one of the Pis can power the Hub itself!
○ Hub sits on top of the Pi stack with magnets
● Hardest part: For portability, get a router.
○ Ideally the cluster will have either static IPs or
reliable DHCP leases
BitScope blade
What if we could build Skynet?
In summary
● Build your own RPi cluster
● Learn Kubernetes
● Try .NET Core
● Deploy OpenFaaS
Any questions?
Thank you!
@shanselman @alexellisuk
http://hanselman.com http://alexellis.io

More Related Content

What's hot

What's hot (20)

OpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - MilanOpenFaaS JeffConf 2017 - Milan
OpenFaaS JeffConf 2017 - Milan
 
Zero to #Serverless in 60 seconds, anywhere
Zero to #Serverless in 60 seconds, anywhereZero to #Serverless in 60 seconds, anywhere
Zero to #Serverless in 60 seconds, anywhere
 
FaaS-and-Furious
FaaS-and-FuriousFaaS-and-Furious
FaaS-and-Furious
 
Immutable Infrastructure: Rise of the Machine Images
Immutable Infrastructure: Rise of the Machine ImagesImmutable Infrastructure: Rise of the Machine Images
Immutable Infrastructure: Rise of the Machine Images
 
Ultimate DevOps: OpenShift Dedicated With CloudBees Jenkins Platform (Andy Pe...
Ultimate DevOps: OpenShift Dedicated With CloudBees Jenkins Platform (Andy Pe...Ultimate DevOps: OpenShift Dedicated With CloudBees Jenkins Platform (Andy Pe...
Ultimate DevOps: OpenShift Dedicated With CloudBees Jenkins Platform (Andy Pe...
 
Splunk user group - automating Splunk with Ansible
Splunk user group - automating Splunk with AnsibleSplunk user group - automating Splunk with Ansible
Splunk user group - automating Splunk with Ansible
 
TechXLR8 - XLR8 your cloud with Docker and Serverless FaaS
TechXLR8 - XLR8 your cloud with Docker and Serverless FaaSTechXLR8 - XLR8 your cloud with Docker and Serverless FaaS
TechXLR8 - XLR8 your cloud with Docker and Serverless FaaS
 
Running tests for every commit: Gerrit, Jenkins, Docker, AWS
Running tests for every commit: Gerrit, Jenkins, Docker, AWSRunning tests for every commit: Gerrit, Jenkins, Docker, AWS
Running tests for every commit: Gerrit, Jenkins, Docker, AWS
 
Building Python Web Apps with Docker
Building Python Web Apps with DockerBuilding Python Web Apps with Docker
Building Python Web Apps with Docker
 
Ultimate DevOps - Jenkins Enterprise & Red Hat OpenShift
Ultimate DevOps - Jenkins Enterprise & Red Hat OpenShiftUltimate DevOps - Jenkins Enterprise & Red Hat OpenShift
Ultimate DevOps - Jenkins Enterprise & Red Hat OpenShift
 
Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)Serverless in production (O'Reilly Software Architecture)
Serverless in production (O'Reilly Software Architecture)
 
How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)
 
Continuous Integration on Steroids
Continuous Integration on SteroidsContinuous Integration on Steroids
Continuous Integration on Steroids
 
Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming Ceylon From Here to Infinity: The Big Picture and What's Coming
Ceylon From Here to Infinity: The Big Picture and What's Coming
 
Run your Java apps on Cloud Foundry
Run your Java apps on Cloud FoundryRun your Java apps on Cloud Foundry
Run your Java apps on Cloud Foundry
 
OpenWhisk
OpenWhiskOpenWhisk
OpenWhisk
 
Cloud native applications
Cloud native applicationsCloud native applications
Cloud native applications
 
5 cool ways to get started with Cloud Native Development ( with Okteto)
5 cool ways to get started with Cloud Native Development ( with Okteto)5 cool ways to get started with Cloud Native Development ( with Okteto)
5 cool ways to get started with Cloud Native Development ( with Okteto)
 
DevOpsDays Houston 2019 - Shaun Ladewig, Robert Stone - From OverTheWallOps t...
DevOpsDays Houston 2019 - Shaun Ladewig, Robert Stone - From OverTheWallOps t...DevOpsDays Houston 2019 - Shaun Ladewig, Robert Stone - From OverTheWallOps t...
DevOpsDays Houston 2019 - Shaun Ladewig, Robert Stone - From OverTheWallOps t...
 
Bosh 2-0-reloaded
Bosh 2-0-reloadedBosh 2-0-reloaded
Bosh 2-0-reloaded
 

Similar to Building a Raspberry Pi cluster with Kubernetes, OpenFaaS and .NET

Similar to Building a Raspberry Pi cluster with Kubernetes, OpenFaaS and .NET (20)

Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Docker Multi-arch All The Things
Docker Multi-arch All The ThingsDocker Multi-arch All The Things
Docker Multi-arch All The Things
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Laravel, docker, kubernetes
Laravel, docker, kubernetesLaravel, docker, kubernetes
Laravel, docker, kubernetes
 
Docker Seattle Meetup, May 2017
Docker Seattle Meetup, May 2017Docker Seattle Meetup, May 2017
Docker Seattle Meetup, May 2017
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
Core OS
Core OSCore OS
Core OS
 
Deploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmDeploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and Helm
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
'Package Once/Run Anywhere' Big Data and HPC workloads
'Package Once/Run Anywhere' Big Data and HPC workloads'Package Once/Run Anywhere' Big Data and HPC workloads
'Package Once/Run Anywhere' Big Data and HPC workloads
 
A Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using DockerA Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using Docker
 
Docker intro
Docker introDocker intro
Docker intro
 
.Net Core
.Net Core.Net Core
.Net Core
 

More from Alex Ellis

More from Alex Ellis (7)

The Need For A Cloud Native Tunnel
The Need For A Cloud Native TunnelThe Need For A Cloud Native Tunnel
The Need For A Cloud Native Tunnel
 
Still waiting for IPv6? Try the inlets-operator
Still waiting for IPv6? Try the inlets-operatorStill waiting for IPv6? Try the inlets-operator
Still waiting for IPv6? Try the inlets-operator
 
IoT + Docker - securing the datacenter, Peterborough
IoT + Docker - securing the datacenter, PeterboroughIoT + Docker - securing the datacenter, Peterborough
IoT + Docker - securing the datacenter, Peterborough
 
IoT: Docker and Raspberry Pi for CamJam
IoT: Docker and Raspberry Pi for CamJamIoT: Docker and Raspberry Pi for CamJam
IoT: Docker and Raspberry Pi for CamJam
 
IoT in the DataCenter @ Container Camp, London
IoT in the DataCenter @ Container Camp, LondonIoT in the DataCenter @ Container Camp, London
IoT in the DataCenter @ Container Camp, London
 
Docker Overview
Docker OverviewDocker Overview
Docker Overview
 
Docker & IoT: protecting the Datacenter
Docker & IoT: protecting the DatacenterDocker & IoT: protecting the Datacenter
Docker & IoT: protecting the Datacenter
 

Recently uploaded

Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
abhinandnam9997
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
aagad
 

Recently uploaded (12)

ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 
Stay Ahead with 2024's Top Web Design Trends
Stay Ahead with 2024's Top Web Design TrendsStay Ahead with 2024's Top Web Design Trends
Stay Ahead with 2024's Top Web Design Trends
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
The Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI StudioThe Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI Studio
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 

Building a Raspberry Pi cluster with Kubernetes, OpenFaaS and .NET

  • 1. Building a Raspberry Pi Kubernetes Cluster and Running .NET Core with OpenFaaS Alex Ellis @alexellisuk Scott Hanselman @shanselman
  • 2. Agenda Why build an RPi cluster? What counts as Cloud? Top community clusters Practicalities of ARM & .NET Core Intro to Kubernetes & Serverless Demos
  • 3. Why build your own cluster?
  • 4. ● It’s the CLOUD in your HOUSE! ● Be your own boss - you’re root, you make the rules ● UNIX heritage ● Direct access to hardware
  • 5. Let’s back up. What does The Cloud™ look like?
  • 6. $ See it? Can you visualize the cloud now?
  • 11. Alex’s first RPi cluster Featured in Linux User Developer Magazine Had to build Docker from source Original “Swarm” project from Docker 29 MARCH 2016
  • 12. We made a podcast
  • 13. The community did something awesome!
  • 14.
  • 15.
  • 16.
  • 17. People LOVE building their own Cloud
  • 19. Who needs an orchestrator anyway?
  • 20.
  • 21.
  • 22. Lightweight “chroot”/sandbox Densely pack applications Immutable - same everywhere Next-gen workflow - Build/ship/run Docker Hub & store Docker brings:
  • 23. container Docker container docker run -d -p 80:80 --restart=always --name=nginx-deployment nginx:1.7.9
  • 24. Declarative deployments Configuration - YAML Programmable API Service discovery High availability (HA) Elastic capacity Security & extensibility Orchestration add:
  • 25. container Deployment Kubernetes Deployment container Pod Pod apiVersion: apps/v1beta1 kind: Deployment metadata: name: nginx-deployment spec: replicas: 3 template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80
  • 26. Kubernetes is an orchestrator Here are the building blocks
  • 27. Zine by Julia Evans
  • 28. Zine by Julia Evans
  • 29. No: Accelerated gaming Bitcoin mining Windows binaries Skynet What can I do with my Pi (ARM) cluster? Yes: You can run server software Python MPI (traditional multi-processing) A blog or website, i.e. ASP.NET, Node.js, PHP etc
  • 30.
  • 31.
  • 32.
  • 33. OpenFaaS - Serverless Functions Made Simple ● Community project ● Developer-first experience ○ UI & CLI ● 9k GitHub stars ● Award winning ● Thriving community ● Easiest way to run your own FaaS or functions
  • 35. Want to know more? blog.alexellis.io - launched 2015 Around 100 blog posts on Docker, Kubernetes, ARM and IoT Coding in Go, community and DevOps
  • 36. What about the software? Pick an OS ● Raspbian (Debian-based) ● Hypriot (Raspbian-based) ● Ubuntu (Debian-based) Something completely different: Resin Configure each node manually Or automate with Ansible But avoid duplicating SD cards Be aware not all Docker images support ARM
  • 37. Let’s talk about CPU architecture
  • 38. .NET Core Best option for modern microservices in C#, ASP.NET also available Natively targets: Linux, Windows and Mac Runtime support for ARM (Raspberry Pi) Official Docker images are available from Microsoft ... .NET Core + Kubernetes
  • 39. Multi-Arch Cross Compilation Build in a container Publish to specific CPU Arch Use correct runtime FROM microsoft/dotnet:2.0-sdk as builder RUN mkdir -p /root/src/function WORKDIR /root/src/function COPY ./function/Function.csproj . WORKDIR /root/src/ COPY ./root.csproj . RUN dotnet restore ./root.csproj COPY . . RUN dotnet publish -c release -o published -r linux-arm ADD https://github.com/openfaas/faas/releases/download/0.6.1/fwatchdog-armhf /usr/bin/fwatchdog RUN chmod +x /usr/bin/fwatchdog FROM microsoft/dotnet:2.0.0-runtime-stretch-arm32v7 WORKDIR /root/ COPY --from=builder /root/src/published . COPY --from=builder /usr/bin/fwatchdog / ENV fprocess="dotnet ./root.dll" EXPOSE 8080 CMD ["/fwatchdog"]
  • 40. RPi Cluster Build Consideration ● Raspberry Pis like 3A+ Reliable Power ○ Anker makes a 6 port USB Charger. One plug powers the whole cluster! ○ Get a Raspberry Pi multi-layer case enclosure ○ Or build one with LEGO! ● Use flat and short Ethernet Cables. Wired >Wireless ○ Get cables of varied length. Use the minimum
  • 41. Networking Challenges ● Wired networking is best. ● BlackBox makes a nice 8-port USB-Powered Hub ○ Any one of the Pis can power the Hub itself! ○ Hub sits on top of the Pi stack with magnets ● Hardest part: For portability, get a router. ○ Ideally the cluster will have either static IPs or reliable DHCP leases
  • 42.
  • 43. BitScope blade What if we could build Skynet?
  • 44. In summary ● Build your own RPi cluster ● Learn Kubernetes ● Try .NET Core ● Deploy OpenFaaS Any questions?