Setting up a Raspberry Pi Kubernetes Cluster with Ubuntu 20.04
HTML-код
- Опубликовано: 22 авг 2024
- In a previous video, I showed you how to set up a Raspberry Pi Kubernetes cluster with Raspbian, now I'll show you how to do the same thing with Ubuntu! In this video, you'll learn everything you'll need to know in order to create your own pi-based Kubernetes cluster, ready to do your bidding!
☁️ Get $100 in credit toward deploying your very own Linux servers on Linode!
➡️ linode.com/lear...
🙌 Support me on Patreon and get early access to new content!
➡️ learnlinux.lin...
*⏰ TIME CODES*:
0:11 - Introduction
5:02 - Preparing the SD card
9:14 - Installing Docker & Kubernetes
40:18 - Running a container in your cluster
🛒 Affiliate store for Linux compatible hardware/accessories (commission earned):
➡️ learnlinux.lin...
💻 Check out the Tiny Pilot KVM for your Homelab (commission earned):
➡️ learnlinux.lin...
🐦 Follow me on Twitter!
➡️ learnlinux.lin...
💬 Official LearnLinux.tv Community:
➡️ community.lear...
📖 Check out jay's latest book, Mastering Ubuntu Server 3rd Edition. Available now!
➡️ ubuntuserverbo...
👨 More about me:
➡️ www.jaylacroix...
➡️ www.learnlinux...
Wiki article for this video:
www.learnlinux...
💽 How to create a bootable flash drive for installing Linux:
➡️ linux.video/fl...
🐧 Which distro do I use?
➡️ learnlinux.lin...
🔐 How to better secure OpenSSH:
➡️ linux.video/se...
☁️ How to create a cloud Linux server with Linode:
➡️ learnlinux.lin...
redid everything and the cluster is up and running, thanks for the fantastic video. on to the next step
Great instruction.. Will store this video for use later.. Planning to use a Raspberry Pi 4 as the main 'host' and Banana Pi M5's as the nodes.. The fact that Ubuntu Server can go on both is encouraging.
Just followed this video through, using 3 * PI 4 8GB's. stopped at the nginx demo, as I didn't want any pods/etc running on my new clean cluster. Have alot more that I want to do and I'm looking forward to using this platform that your walkthrough made a breeze to get up and running. Thank you for putting this together
This tutorial helped me to get into kubernetes till now. Saw also many other tutorials about this topic, but all the tutorials have the same problem. They leave you with running containers without telling you how you can delete those containers. In this tutorial to get rid of the running containers: kubectl delete -f pods.yml
Fantastic! Thank you, friend. Tried setting up on a pi mutliple way (/w k3s), but never could get it working. But this worked like a charm, and now I can start fiddling with K8s while I wait for my TuringPi to arrive.
Great video, thanks. After going through umpteen tutorials online, all either written for raspbiran or raspberry pi os. This was so much easier. Thanks
Thank you, this was easy to follow and gave total success. I tried to jump in with Microk8s before but it was too much too fast. This video helps with getting a baseline setup and improve understanding of what the parts and process to get up and running. Excellent educational presentation!
Excellent video... Thanks so much for putting this together! I’m about 9 mos late to the party, but it took me that long get my Linux skills and cloud knowledge to this point! Looking forward to viewing more of your K8s videos! Thanks Again!
just a note: windows 10 has ssh built into powershell (ssh ip-address)
for me, it was missing open the ports:
firewall-cmd --permanent --add-port=6443/tcp
firewall-cmd --permanent --add-port=10250/tcp
firewall-cmd --reload
the rest was working great, very detailed video
Really great job. This tutorial has been very valuable. I got my master and workers up! Subscribing!
Esse vídeo me salvou, já estava desistindo de montar o cluster, quando do nada apareceu esse vídeo e foi o que me salvou.
Muito bom o vídeo. Parabéns...
Nice tutorial. I've bought a Raspberry pi 400 for an initial test and I'm thinking of buying 3 Pi 4s to build the cluster. Will let you know
@LearnLinuxTV It would be good if you can prepare the video for openmediavault running on kubernetes cluster
Thanks for the tutorial, very informative and simple to follow. I got everything running in no time. I also added the Kubernetes Dashboard which I think is very useful. I'm not sure if you have tutorial for that -- haven't checked. It would be useful for your subscribers I think. 😉
Nice demonstration and thanks. This video helped me to bringing my first 4 node cluster.
Nice tutorial. This would have been a nice usecase for Ansible though ;-)
Thank you! Very instructive video. I think that will be awesome for us, to see installation of a full stack of servers for running a simple php application. Something like a LAMP stack.
Good work! It would be amazing to make Ansible playbook on this video.
Pro Tip:
Use dd to flash the SD. And then mount the 2nd partition of the SD (e.g., mount /dev/sda2 /mnt) and echo the hostname into the /etc/hostname file (e.g., echo RPi-17 > /mnt/etc/hostname).
That was a great video and supporting wiki...... cant wait to start digging deeper
Excellent guide and wiki, Jay! Thank you so much!
Great tutorial! One thing noticed doing this task is, Raspberry Pi 2 Model B does not support 64bit OS, hence cannot install docker-ce, and hence cannot proceed with the kubernetes installation.
Thanks for this walk-through and the Wiki!! Perfect.
This is awesome tutorial. I am able to build it seamlessly. Can you guide how to setup k8s dashboard that is accessible out side of nodes?
Dashboard is a web-based Kubernetes user interface. You can use Dashboard to deploy containerized applications to a Kubernetes cluster, troubleshoot your containerized application, and manage the cluster resources.
kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/
Curious if you could do a guide on getting the dashboard setup and going, and accessible out of the nodes as well. Also how to control the cluster without puttying into the systems
Can we get a video on how to do this again but with only setting up one Pi, cloning the SD card, then installing the master software on that first Pi, using the image to flash the next images by just changing their hostname and hosts files, then adding new Pis to the cluster later down the road using the same image you created earlier and actually scale it up. Would be interesting to see how efficient you can make scaling a Pi cluster ;D
I have also ran to a problem here when I issue the command "sudo kubeadm init --pod-network-cidr=10.244.0.0/16"
[init] Using Kubernetes version: v1.20.1
[preflight] Running pre-flight checks
[WARNING SystemVerification]: this Docker version is not on the list of validated versions: 20.10.1. Latest validated version: 19.03
[WARNING SystemVerification]: missing optional cgroups: hugetlb
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR Mem]: the system RAM (908 MB) is less than the minimum 1700 MB
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
You don't have sufficient RAM on your pi. This only works for the pi4 as you need over 1700MB of ram and as it say above in your error your system only has 908MB. You may be able to get round this using minikube but otherwise I think you'll have to upgrade your pi to the pi4
Thanks! Why not use k3s for use on rpis? It consumes less ram and is easier to set up and a certified Kubernetes distribution with all the features. It's meant for edge devices and arm use cases.
If you are going to use Ubuntu on your Rpis and want to use a Kubernetes distribution than instead of k3s you might want to consider microK8s. It is a slimmed down certified Kubernetes distribution much like k3s but produced by Ubuntu's creators Canonical. I find it much easier to configure and more ready out of the box for a home lab type environment where you are likely to find Rpi clusters.
Thanks for the great content. How about a Pi Hole video?
@51:52 - could you deploy Nginx Proxy Manager on this cluster?
Then have all your dockers been access via the proxy ???
Try "cssh" for cluster ssh in the future.
@51:52 - so, if worker-01 goes down, will the pod still be running on another worker ??
How is the performance of Ubuntu 20.04 vs Raspbian on the Pi?
Interesting project. Wonder if it would be worth to have the master booting from a SSD disk and then boot the other one over network from the master. Would there be to much load on the network to run about 5 worker nodes on the PXE boot server & master.
Great video. Thank you sir
Instead of using microsd cards, can you use SSD's ? I'm running the Raspberry Pi OS 64 bit version off of an old WD 3.5 inch drive. Seems to be much faster than running off of a microsd card but that could be because I'm running a desktop version and not a server. Just received your Mastering Ubuntu Server 3rd Edition book yesterday and will be spending my time reading then watching tv.
Thank you so much for your video. Please there's something I didn't get right. Why did the pod only run on worker-01 (kubectl get pods -c wide) and not on the other worker nodes too?
hi Jay, will raspberry Pi 4 with 4GB work for the master and worker nodes in the cluster?
Yes, he used those for this video
can a ubuntu 20.04 running on a raspberry pi worker node connect to a ubuntu 20.04 master node running on a X86 ?
Do you need to have all the same capacity sd cards or does it not matter ?
I plan to run the Home assistant, pihole and pivpn on my cluster. how may I set it up?
Nice , thx !!
I would suggest to install K3os
Hi mate, I ran to a problem here when I issue join command or sudo kubeadm it keep error; dockerd needs to be started with root. To see how to run dockerd in rootless mode with unprivileged user, any workaround?
Best ubuntu content
Hi, thnks for the video, i am getting this error : [ERROR Mem]: the system RAM (908 MB) is less than the minimum 1700 MB when i run kubeadm init --pod-network-cidr=10.244.0.0/16. I am using pi 3B, any ideas?
I want to try this with 2 Raspberry Pi's but I just saw a video about Docker being deprecated and replaced with ContainerD, Will you have an update ?
Sorry I don’t know the difference between k3s and k8s. But the setup shown in video is it k8s or k3s
Great Video. Could you post a link to the cluster case ?
I know this is an old video. But I got a noob question here, if I want to install docker images do I need to the docker run command on each node or just the master?
can i cluster kubernetti with a master and slave x86-64 PC? server or consumer grade HW?for self hosting purpose. Thanks, support from italy.
Andrea
But how do we physical but the pi´s together?
Jay - Amazon has a sd card socket extender cable for less than $7
Thanks for the video. I wonder how about SD card speed?
Following this guide, I had to run "sudo apt install linux-modules-extra-raspi" to fix this error Error response from daemon: failed to create endpoint priceless_noether on network bridge:: failed to add the host (veth4cfcda9) sandbox (vethda57bc9) pair interfaces: operation not supported.ERRO[0000] error waiting for container: context canceled
Great video - one issue I'm having is the packages seems to not update: Err:7 packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages 404 Not Found [IP: 142.250.66.174 443] - wondering if anyone else is having the same issue.
Hi, I'm trying to deploy an EKS cluster with raspberry pi 4 as nodes so i can monitor and deploy services to all nodes easily that are connected to the internet by 4g all the time. Is it good k8s good fit for this? The master will be an ec2 instance in the cloud so i can monito and deploy to all the nodes in my network
Jay would you be updating your book with ubuntu server 20.04LTS i would love to see what new it brings for the server side of things
First it is a very good video! Thank you! What do you thing about the idea to run Wordpress on the PI's with all the stuff on an extra USB-Harddrive.
And it would also be a good thing to see the CPU, RAM and Diskspace of the Cluster on a browser or perhaps on an external 3,5" Display?!
Can you make a video for this stuff please ;-)
Hi Jay. Would this guide work with the normal x86-64 Ubuntu? I'd like to try out a k8s cluster but run some VMs before buying a bunch of RPi4s.
yes you can, for an homelab setup it is ok
thanks for this. i got a master and 3 worker rasp pi 4's 8G going. i got the nginx container working, too. getting fouled up also trying to run prometheus (from another channel [J Gearling] tutorial) but not applying manifest/setup??? anyway. thanks
Question: Why only 1 master node?
Do I need to worry about routing bottlenet? I know have low performance to run encryption
Can I use different Raspberry Pis as workers, or must they all be identical?
Do you know whether external hard drive works on Raspberry Pi w/ ubuntu?
Jay, the case now comes with extenders so the sd card is by the usb ports.
Really?! I just got the case and it didn't come with the extenders... Do they sell them separately?
@@JustinLeif I think you can find them separately, maybe mine was a fluke but had 4 of them in the box
Jay - not sure if you are tracking comments on this subject still, but any chance you can release an update to this? I can't seem to get things working properly using Ubuntu 20.10 - I would like to use ssd/usb media rather than sd cards. I also understand that 21.04 will be out so it may not be worth your time - just figured I'd check.
what about storage .... where all the images and configuration files are stored? ... in the master's storage? That mean's all workers use the storage for the OS only and no additional space will be used?
You have to specify that in your yaml file. But if you don't use different storage backends (like gluster Ceph or NFS) it will be stored on the appropriate worker.
What OS are u running? - I just tried Ubuntu & Kubuntu but I really didnt enjoy the experience coming from a Mac - I am using a Magic Keyboard & could not get it to replicate the [Super] button behavior I am used to.
POP OS - got it. - ruclips.net/video/wid7myDizj8/видео.html
Hi Jay can you make it for microk8s ? and why it is so heavy run in my pi3 :(
what about ip addr to see your ip address ?
Using 'ip a' will show you the address but as the screen tip stated you want to set static IP addresses for each pi. Logging into your router is necessary to do that.
'ip a' is actually the shortened version of 'ip addr show', which is also the same command as you mentioned.
where can i find this case?
M7CVZ Thank you!
Can this be done with manjaro?
ERROR: pi@k8s-master:~ $ sudo apt-get install kubeadm kubectl kubelet
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package kubeadm
E: Unable to locate package kubectl
E: Unable to locate package kubelet
please help!
This happened to me when I was pulling it with all nodes at the same time. Couldn’t get it to work for nearly an hour and then I used the opposite version of apt (I was using apt and then switched to apt-get. Since you are using apt-get try apt).
Everything works for me, up until the point I try to apply the example pod.yml. Then it says:
"error: error parsing pod.yml: error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context"
I copied the YML from the wiki. Looks like some kind of parsing error of the YML? Googled the error, but no real answer...
Already fixed it. If you copy/past the contents from the wiki, it removes a space before apiVersion...
Make sure there are no spaces in the file in front of apiVersion:, kind:, metadata: and spec:. I had the same issue until I removed the leading spaces. Copy pasting the content from the wiki adds these spaces.
Damn good video!
What I wanted to see is 3 amd64 masters and rpi workers.
Can I use this as a mini render farm?
nice!!
Great tutorial, just one question, can you mix up different raspberry, 3 and 4 together?
Yes of course, but make sure to use a aarch64 os, because arm32bit isn't supported very well. You could even go as far as to mix arm with x86 and PPC 😂
Be warned that guy posting "wanna be friends?"-posts might be a hacker, which tries to take over accounts
Thanks, I try to remove these when I can but there's just so many...
I was really enjoying the video until i hit a snag :( --- kubectl apply -f --raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml-- --- throws an error: Documentation/kube-flannel.yml
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault (core dumped)
if
sudo apt update
fails update
/etc/apt/sources.list.d/kubernetes.list
file with
deb packages.cloud.google.com/apt/ kubernetes-xenial main
yayyyy :)
*spoon*