SlideShare a Scribd company logo
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 1/32
Running k3s on
Raspberry Pi
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 2/32
Kyohei Mizumoto(@kyohmizu)
C# Software Engineer
Interests
Docker/Kubernetes
Go
Security
whoami
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 3/32
Target
People who:
haven't used k3s
haven't run k3s on Raspberry Pi
are interested in k3s cluster management
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 4/32
Preferred Knowledge
The basic knowledge of:
Docker
Kubernetes
Virtual Machine(Microsoft Azure)
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 5/32
Agenda
What is k3s?
Get started
Control Raspberry Pi using k3s
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 6/32
What is k3s?
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 7/32
kubernetes = k8s
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 8/32
k3s = k(8-5)s
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 9/32
Lightweight Kubernetes
Easy to install
Half the memory
Single binary less than 40MB
k3s - 5 less than k8s
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 10/32
Great for
Edge
IoT
CI
ARM
k3s - 5 less than k8s
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 11/32
Changes
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 12/32
How It Works
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 13/32
k3s Pronounce "Kubes"...?
https://github.com/rancher/k3s/issues/55
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 14/32
Get started
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 15/32
Download Binary
https://github.com/rancher/k3s/releases/latest
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 16/32
Download Binary
DOWNLOADPATH:
https://github.com/rancher/k3s/releases/download/v0.5.0/k3s
$ wget [DOWNLOADPATH]
$ ls
k3s
$ chmod +x k3s
$ sudo mv k3s /usr/bin/
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 17/32
Run Server
# Run in the background
$ sudo k3s server &
# Kubeconfig is written to /etc/rancher/k3s/k3s.yaml
$ k3s kubectl get node
NAME STATUS ROLES AGE VERSION
k3s-server Ready <none> 30s v1.14.1-k3s.4
# Run without running the agent
$ k3s server --disable-agent
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 18/32
Join Nodes
# NODE_TOKEN comes from
# /var/lib/rancher/k3s/server/node-token on the server
$ sudo k3s agent --server https://myserver:6443 
--token ${NODE_TOKEN}
Show nodes on server:
$ k3s kubectl get node
NAME STATUS ROLES AGE VERSION
k3s-agent Ready <none> 1h v1.14.1-k3s.4
k3s-server Ready <none> 1h v1.14.1-k3s.4
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 19/32
Control Raspberry Pi
using k3s
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 20/32
Raspberry Pi
https://www.raspberrypi.org/
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 21/32
Configuration
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 22/32
Raspberry Pi Configuration
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 23/32
Raspberry Pi Configuration
Raspberry Pi 3 B+
Breadboard
LED
Resistor
Jump wire
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 24/32
Required Preparation
Create VM on Microsoft Azure
Run k3s server on the VM (with a node)
Join k3s node on Raspberry Pi
$ k3s kubectl get node
NAME STATUS ROLES AGE VERSION
k3s-server Ready <none> 19d v1.14.1-k3s.4
raspi-1 Ready <none> 16d v1.14.1-k3s.4
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 25/32
Sample Program(sample.py)
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(2,GPIO.OUT)
while True:
GPIO.output(2,True)
time.sleep(1)
GPIO.output(2,False)
time.sleep(1)
GPIO.cleanup()
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 26/32
Dockerfile
FROM python:3
ADD sample.py /
RUN pip install rpi.gpio
CMD [ "python", "./sample.py" ]
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 27/32
Create Docker Image
# [NAME] is an account name of Docker Hub
$ docker build -t [NAME]/raspi-sample
# Run container
$ docker run --privileged [NAME]/raspi-sample
# Login to Docker Hub
$ docker login
$ docker push [NAME]/raspi-sample
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 28/32
Manifest(sample.yaml)
apiVersion: v1
kind: Pod
metadata:
name: sample
spec:
containers:
- name: sample
image: [NAME]/raspi-sample
securityContext:
privileged: true
nodeSelector:
kubernetes.io/arch: arm
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 29/32
Deploy on Raspberry Pi
$ k3s kubectl apply -f sample.yaml
pod/sample created
# The pod was deployed on Raspberry Pi
$ k3s kubectl get po -o wide
NAME READY STATUS RESTARTS AGE IP
NODE NOMINATED NODE READINESS GATES
sample 1/1 Running 0 48s 10.42.0.6
raspi-1 <none> <none>
The LED blinks!!
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 30/32
Demo
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 31/32
Links
https://k3s.io/
https://github.com/rancher/k3s
2019/5/16 Running k3s on Raspberry Pi
127.0.0.1:5500/#1 32/32
Thank you!

More Related Content

DOCX
Báo cáo môn đảm bảo chất lượng phần mềm
PDF
Phân tích và thiết kế hệ thống quản lý quán Internet
PPTX
ASP.NET MVC 3.0 Validation
PDF
Diagramme de classe
DOC
Mô hình hóa Use Case 03
DOCX
Đồ án kiểm thử phần mềm
PDF
Báo cáo đồ án tốt nghiệp "Ứng dụng trí tuệ nhân tạo nhận dạng chữ viết tay xâ...
DOCX
Giới thiệu về Rational Rose và Các diagram
Báo cáo môn đảm bảo chất lượng phần mềm
Phân tích và thiết kế hệ thống quản lý quán Internet
ASP.NET MVC 3.0 Validation
Diagramme de classe
Mô hình hóa Use Case 03
Đồ án kiểm thử phần mềm
Báo cáo đồ án tốt nghiệp "Ứng dụng trí tuệ nhân tạo nhận dạng chữ viết tay xâ...
Giới thiệu về Rational Rose và Các diagram

What's hot (20)

PDF
Hướng dẫn deobfuscate DotnetPatcher 3.1 - Bài dịch
DOCX
Tìm Hiểu Các Kỹ Thuật Kiểm Thử Phần Mềm và Một Số Ứng Dụng Trong Thực Tế
PPTX
Tổng quan về DoS - DDoS - DRDoS
PPTX
k8s practice 2023.pptx
PPTX
Fondamentaux d’une API REST
PDF
Bài 9: Sao lưu và khôi phục hệ thống Domain - Giáo trình FPT
PDF
Đồ án Phát triển Game 2D trên Unity
PDF
Bài 1 - Làm quen với C# - Lập trình winform
PPTX
Lập trình android
DOC
Báo Cáo Bài Tập Lớn Môn Lập Trình Web Xây Dựng Website Tin Tức
PDF
Cach su dung Ubuntu
PPTX
Slide đồ án kiểm thử PM
PPT
MATMA - Chuong2
DOCX
Hướng dẫn xây dựng mô hình mạng với vmware
DOCX
Bao cao UML phan tich he thong nha cho thue
PDF
Giáo trình Quản trị mạng
PPTX
Slide báo cáo đồ án tốt nghiệp "Website cửa hàng điện thoại trực tuyến"
PDF
Đề tài: Phần mềm Quản Lý Siêu Thị Mini, HAY, 9đ
PDF
Thiết kế csdl quản lý nhân sự
PDF
bao cao linux
Hướng dẫn deobfuscate DotnetPatcher 3.1 - Bài dịch
Tìm Hiểu Các Kỹ Thuật Kiểm Thử Phần Mềm và Một Số Ứng Dụng Trong Thực Tế
Tổng quan về DoS - DDoS - DRDoS
k8s practice 2023.pptx
Fondamentaux d’une API REST
Bài 9: Sao lưu và khôi phục hệ thống Domain - Giáo trình FPT
Đồ án Phát triển Game 2D trên Unity
Bài 1 - Làm quen với C# - Lập trình winform
Lập trình android
Báo Cáo Bài Tập Lớn Môn Lập Trình Web Xây Dựng Website Tin Tức
Cach su dung Ubuntu
Slide đồ án kiểm thử PM
MATMA - Chuong2
Hướng dẫn xây dựng mô hình mạng với vmware
Bao cao UML phan tich he thong nha cho thue
Giáo trình Quản trị mạng
Slide báo cáo đồ án tốt nghiệp "Website cửa hàng điện thoại trực tuyến"
Đề tài: Phần mềm Quản Lý Siêu Thị Mini, HAY, 9đ
Thiết kế csdl quản lý nhân sự
bao cao linux
Ad

Similar to Running k3s on raspberry pi (20)

PPTX
Implementing Lightweight Kubernetes(K3s) on Raspberry Pi Stack - Sangam Biradar
PPTX
Introduction to k3s and k3sup
PDF
Kubernetes Basis: Pods, Deployments, and Services
PDF
Rabncher Meetup India , Lightweight Kubernetes Development with K3s, k3os and...
PDF
Introduction of kubernetes rancher
PDF
Build Your Own CaaS (Container as a Service)
PDF
[Podman Special Event] Kubernetes in Rootless Podman
PDF
Kubernetes - Starting with 1.2
PDF
Why do we even have Kubernetes?
PDF
Kubernetes + Python = ❤ - Cloud Native Prague
PPTX
Kubernetes: від знайомства до використання у CI/CD
PPTX
The Reality of DIY Kubernetes vs. PKS
PPTX
Introduction kubernetes 2017_12_24
PPTX
A Million ways of Deploying a Kubernetes Cluster
PDF
Cloud RPI4 tomcat ARM64
PDF
kubernetes.pdf
PDF
Using kubernetes to lose your fear of using containers
PDF
What's new in kubernetes 1.3?
PDF
Introduction of k8s rancher
PDF
Multinode kubernetes-cluster
Implementing Lightweight Kubernetes(K3s) on Raspberry Pi Stack - Sangam Biradar
Introduction to k3s and k3sup
Kubernetes Basis: Pods, Deployments, and Services
Rabncher Meetup India , Lightweight Kubernetes Development with K3s, k3os and...
Introduction of kubernetes rancher
Build Your Own CaaS (Container as a Service)
[Podman Special Event] Kubernetes in Rootless Podman
Kubernetes - Starting with 1.2
Why do we even have Kubernetes?
Kubernetes + Python = ❤ - Cloud Native Prague
Kubernetes: від знайомства до використання у CI/CD
The Reality of DIY Kubernetes vs. PKS
Introduction kubernetes 2017_12_24
A Million ways of Deploying a Kubernetes Cluster
Cloud RPI4 tomcat ARM64
kubernetes.pdf
Using kubernetes to lose your fear of using containers
What's new in kubernetes 1.3?
Introduction of k8s rancher
Multinode kubernetes-cluster
Ad

More from Kyohei Mizumoto (10)

PDF
Introduction to telepresence
PDF
Windowsコンテナ入門
PDF
Introduction of cloud native CI/CD on kubernetes
PDF
Deploy Mattermost on AKS
PDF
Recap of de code 2019
PDF
Kubernetes logging introduction
PDF
Kubernetes monitoring introduction
PDF
Git入門
PDF
Istio service mesh introduction
PDF
Multi cluster management with rancher
Introduction to telepresence
Windowsコンテナ入門
Introduction of cloud native CI/CD on kubernetes
Deploy Mattermost on AKS
Recap of de code 2019
Kubernetes logging introduction
Kubernetes monitoring introduction
Git入門
Istio service mesh introduction
Multi cluster management with rancher

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
A Presentation on Artificial Intelligence
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Empathic Computing: Creating Shared Understanding
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
A Presentation on Artificial Intelligence
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
Empathic Computing: Creating Shared Understanding
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MYSQL Presentation for SQL database connectivity
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Running k3s on raspberry pi

  • 1. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 1/32 Running k3s on Raspberry Pi
  • 2. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 2/32 Kyohei Mizumoto(@kyohmizu) C# Software Engineer Interests Docker/Kubernetes Go Security whoami
  • 3. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 3/32 Target People who: haven't used k3s haven't run k3s on Raspberry Pi are interested in k3s cluster management
  • 4. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 4/32 Preferred Knowledge The basic knowledge of: Docker Kubernetes Virtual Machine(Microsoft Azure)
  • 5. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 5/32 Agenda What is k3s? Get started Control Raspberry Pi using k3s
  • 6. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 6/32 What is k3s?
  • 7. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 7/32 kubernetes = k8s
  • 8. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 8/32 k3s = k(8-5)s
  • 9. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 9/32 Lightweight Kubernetes Easy to install Half the memory Single binary less than 40MB k3s - 5 less than k8s
  • 10. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 10/32 Great for Edge IoT CI ARM k3s - 5 less than k8s
  • 11. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 11/32 Changes
  • 12. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 12/32 How It Works
  • 13. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 13/32 k3s Pronounce "Kubes"...? https://github.com/rancher/k3s/issues/55
  • 14. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 14/32 Get started
  • 15. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 15/32 Download Binary https://github.com/rancher/k3s/releases/latest
  • 16. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 16/32 Download Binary DOWNLOADPATH: https://github.com/rancher/k3s/releases/download/v0.5.0/k3s $ wget [DOWNLOADPATH] $ ls k3s $ chmod +x k3s $ sudo mv k3s /usr/bin/
  • 17. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 17/32 Run Server # Run in the background $ sudo k3s server & # Kubeconfig is written to /etc/rancher/k3s/k3s.yaml $ k3s kubectl get node NAME STATUS ROLES AGE VERSION k3s-server Ready <none> 30s v1.14.1-k3s.4 # Run without running the agent $ k3s server --disable-agent
  • 18. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 18/32 Join Nodes # NODE_TOKEN comes from # /var/lib/rancher/k3s/server/node-token on the server $ sudo k3s agent --server https://myserver:6443 --token ${NODE_TOKEN} Show nodes on server: $ k3s kubectl get node NAME STATUS ROLES AGE VERSION k3s-agent Ready <none> 1h v1.14.1-k3s.4 k3s-server Ready <none> 1h v1.14.1-k3s.4
  • 19. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 19/32 Control Raspberry Pi using k3s
  • 20. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 20/32 Raspberry Pi https://www.raspberrypi.org/
  • 21. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 21/32 Configuration
  • 22. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 22/32 Raspberry Pi Configuration
  • 23. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 23/32 Raspberry Pi Configuration Raspberry Pi 3 B+ Breadboard LED Resistor Jump wire
  • 24. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 24/32 Required Preparation Create VM on Microsoft Azure Run k3s server on the VM (with a node) Join k3s node on Raspberry Pi $ k3s kubectl get node NAME STATUS ROLES AGE VERSION k3s-server Ready <none> 19d v1.14.1-k3s.4 raspi-1 Ready <none> 16d v1.14.1-k3s.4
  • 25. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 25/32 Sample Program(sample.py) import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(2,GPIO.OUT) while True: GPIO.output(2,True) time.sleep(1) GPIO.output(2,False) time.sleep(1) GPIO.cleanup()
  • 26. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 26/32 Dockerfile FROM python:3 ADD sample.py / RUN pip install rpi.gpio CMD [ "python", "./sample.py" ]
  • 27. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 27/32 Create Docker Image # [NAME] is an account name of Docker Hub $ docker build -t [NAME]/raspi-sample # Run container $ docker run --privileged [NAME]/raspi-sample # Login to Docker Hub $ docker login $ docker push [NAME]/raspi-sample
  • 28. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 28/32 Manifest(sample.yaml) apiVersion: v1 kind: Pod metadata: name: sample spec: containers: - name: sample image: [NAME]/raspi-sample securityContext: privileged: true nodeSelector: kubernetes.io/arch: arm
  • 29. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 29/32 Deploy on Raspberry Pi $ k3s kubectl apply -f sample.yaml pod/sample created # The pod was deployed on Raspberry Pi $ k3s kubectl get po -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES sample 1/1 Running 0 48s 10.42.0.6 raspi-1 <none> <none> The LED blinks!!
  • 30. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 30/32 Demo
  • 31. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 31/32 Links https://k3s.io/ https://github.com/rancher/k3s
  • 32. 2019/5/16 Running k3s on Raspberry Pi 127.0.0.1:5500/#1 32/32 Thank you!