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...

Комментарии • 103

  • @normanpeterson5325
    @normanpeterson5325 3 года назад +2

    redid everything and the cluster is up and running, thanks for the fantastic video. on to the next step

  • @MikeNewham
    @MikeNewham 3 года назад

    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.

  • @colindawson4818
    @colindawson4818 3 года назад

    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

  • @essetee
    @essetee 3 года назад

    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

  • @m.corey.thompson
    @m.corey.thompson 3 года назад

    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.

  • @louissimps
    @louissimps 4 года назад +2

    Great video, thanks. After going through umpteen tutorials online, all either written for raspbiran or raspberry pi os. This was so much easier. Thanks

  • @whoistechcmty
    @whoistechcmty 3 года назад

    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!

  • @darlayoung834
    @darlayoung834 3 года назад

    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!

  • @kenzieduckmoo
    @kenzieduckmoo 4 года назад +9

    just a note: windows 10 has ssh built into powershell (ssh ip-address)

  • @gilbertdeleon3126
    @gilbertdeleon3126 3 года назад

    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

  • @danielwalsh1912
    @danielwalsh1912 3 года назад

    Really great job. This tutorial has been very valuable. I got my master and workers up! Subscribing!

  • @Alexsandrofabbro
    @Alexsandrofabbro 2 года назад

    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...

  • @celestinorey982
    @celestinorey982 3 года назад

    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

  • @jeffreygnanasoundarjohnsel5455
    @jeffreygnanasoundarjohnsel5455 4 года назад +4

    @LearnLinuxTV It would be good if you can prepare the video for openmediavault running on kubernetes cluster

  • @jedim4ster
    @jedim4ster 3 года назад

    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. 😉

  • @manjunathkaranth889
    @manjunathkaranth889 3 года назад

    Nice demonstration and thanks. This video helped me to bringing my first 4 node cluster.

  • @macenkajan
    @macenkajan 3 года назад +3

    Nice tutorial. This would have been a nice usecase for Ansible though ;-)

  • @SimionChis
    @SimionChis 4 года назад

    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.

  • @leonidasspartasson9759
    @leonidasspartasson9759 3 года назад +1

    Good work! It would be amazing to make Ansible playbook on this video.

  • @epretorious
    @epretorious 3 года назад

    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).

  • @martinthompson3802
    @martinthompson3802 4 года назад

    That was a great video and supporting wiki...... cant wait to start digging deeper

  • @MrCowGod15
    @MrCowGod15 3 года назад

    Excellent guide and wiki, Jay! Thank you so much!

  • @Sai-kp2cp
    @Sai-kp2cp 3 года назад

    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.

  • @ckworton
    @ckworton 4 года назад +1

    Thanks for this walk-through and the Wiki!! Perfect.

  • @vijayp1380
    @vijayp1380 4 года назад +2

    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?

    • @epretorious
      @epretorious 3 года назад

      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/

  • @jamesbriggs1891
    @jamesbriggs1891 4 года назад

    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

  • @LazySmurf
    @LazySmurf 3 года назад

    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

  • @237311
    @237311 3 года назад +1

    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

    • @kingofmaglos3
      @kingofmaglos3 3 года назад

      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

  • @LampJustin
    @LampJustin 4 года назад +1

    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.

    • @TimSedlmeyer
      @TimSedlmeyer 4 года назад

      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.

  • @drmikeyg
    @drmikeyg 4 года назад +1

    Thanks for the great content. How about a Pi Hole video?

  • @fbifido2
    @fbifido2 Год назад

    @51:52 - could you deploy Nginx Proxy Manager on this cluster?
    Then have all your dockers been access via the proxy ???

  • @kyootfox
    @kyootfox 3 года назад

    Try "cssh" for cluster ssh in the future.

  • @fbifido2
    @fbifido2 Год назад

    @51:52 - so, if worker-01 goes down, will the pod still be running on another worker ??

  • @Zanecschepke
    @Zanecschepke 4 года назад +1

    How is the performance of Ubuntu 20.04 vs Raspbian on the Pi?

  •  3 года назад

    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.

  • @janithvinura3341
    @janithvinura3341 4 года назад

    Great video. Thank you sir

  • @michaelurig3887
    @michaelurig3887 2 года назад

    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.

  • @iposipos9342
    @iposipos9342 3 года назад

    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?

  • @supersleuth2004
    @supersleuth2004 3 года назад +1

    hi Jay, will raspberry Pi 4 with 4GB work for the master and worker nodes in the cluster?

    • @arlandmv4053
      @arlandmv4053 3 года назад

      Yes, he used those for this video

  • @sadyojatha4288
    @sadyojatha4288 3 года назад

    can a ubuntu 20.04 running on a raspberry pi worker node connect to a ubuntu 20.04 master node running on a X86 ?

  • @JohnDoe-wi7eb
    @JohnDoe-wi7eb 3 года назад

    Do you need to have all the same capacity sd cards or does it not matter ?

  • @RCYIJustinizer
    @RCYIJustinizer 3 года назад

    I plan to run the Home assistant, pihole and pivpn on my cluster. how may I set it up?

  • @mycloud8408
    @mycloud8408 4 года назад

    Nice , thx !!
    I would suggest to install K3os

  • @melvinleo3499
    @melvinleo3499 3 года назад

    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?

  • @jorgerato4850
    @jorgerato4850 3 года назад

    Best ubuntu content

  • @benzavaleta92
    @benzavaleta92 3 года назад

    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?

  • @michaelurig3887
    @michaelurig3887 2 года назад

    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 ?

  • @smartaquarius2021
    @smartaquarius2021 3 года назад

    Sorry I don’t know the difference between k3s and k8s. But the setup shown in video is it k8s or k3s

  • @marveltracker
    @marveltracker 4 года назад

    Great Video. Could you post a link to the cluster case ?

  • @jisatsu_eh3364
    @jisatsu_eh3364 3 года назад

    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?

  • @andreavergani7414
    @andreavergani7414 4 года назад +1

    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

  • @soultracer
    @soultracer 3 года назад

    But how do we physical but the pi´s together?

  • @kenburnett
    @kenburnett 4 года назад

    Jay - Amazon has a sd card socket extender cable for less than $7

  • @LinhPham-iu2fr
    @LinhPham-iu2fr 4 года назад

    Thanks for the video. I wonder how about SD card speed?

  • @lordmadmunki1918
    @lordmadmunki1918 2 года назад

    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

  • @JarrodLucia
    @JarrodLucia 4 года назад +1

    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.

  • @josemauriciocarpioherrera4044
    @josemauriciocarpioherrera4044 4 года назад

    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

  • @interguy589
    @interguy589 4 года назад

    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

  • @thepioneer517
    @thepioneer517 4 года назад

    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 ;-)

  • @MrNeocortex
    @MrNeocortex 4 года назад +1

    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.

    • @tomw0w
      @tomw0w 4 года назад

      yes you can, for an homelab setup it is ok

  • @jgranahan
    @jgranahan 3 года назад

    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

  • @jaysistar2711
    @jaysistar2711 3 года назад

    Question: Why only 1 master node?

  • @AlexandreAlonso
    @AlexandreAlonso 4 года назад

    Do I need to worry about routing bottlenet? I know have low performance to run encryption

  • @ForrestRhoads
    @ForrestRhoads 3 года назад

    Can I use different Raspberry Pis as workers, or must they all be identical?

  • @weitanglau162
    @weitanglau162 3 года назад

    Do you know whether external hard drive works on Raspberry Pi w/ ubuntu?

  • @herc5854
    @herc5854 4 года назад

    Jay, the case now comes with extenders so the sd card is by the usb ports.

    • @JustinLeif
      @JustinLeif 4 года назад

      Really?! I just got the case and it didn't come with the extenders... Do they sell them separately?

    • @herc5854
      @herc5854 4 года назад

      @@JustinLeif I think you can find them separately, maybe mine was a fluke but had 4 of them in the box

  • @TechSportz
    @TechSportz 3 года назад

    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.

  • @dimitristsoutsouras2712
    @dimitristsoutsouras2712 4 года назад

    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?

    • @LampJustin
      @LampJustin 4 года назад

      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.

  • @brentgreeff1115
    @brentgreeff1115 4 года назад

    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.

    • @brentgreeff1115
      @brentgreeff1115 4 года назад

      POP OS - got it. - ruclips.net/video/wid7myDizj8/видео.html

  • @Ekosusiloharjo
    @Ekosusiloharjo 3 года назад

    Hi Jay can you make it for microk8s ? and why it is so heavy run in my pi3 :(

  • @essetee
    @essetee 4 года назад +1

    what about ip addr to see your ip address ?

    • @MrNeocortex
      @MrNeocortex 4 года назад

      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.

    • @LearnLinuxTV
      @LearnLinuxTV  4 года назад

      'ip a' is actually the shortened version of 'ip addr show', which is also the same command as you mentioned.

  • @colmanmcguan9502
    @colmanmcguan9502 4 года назад +1

    where can i find this case?

  • @bil9572
    @bil9572 3 года назад

    Can this be done with manjaro?

  • @garylefebvre5407
    @garylefebvre5407 3 года назад

    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!

    • @djruh-son6840
      @djruh-son6840 3 года назад

      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).

  • @amtam05
    @amtam05 4 года назад

    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...

    • @amtam05
      @amtam05 4 года назад

      Already fixed it. If you copy/past the contents from the wiki, it removes a space before apiVersion...

    • @PaulShadwell
      @PaulShadwell 3 года назад

      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.

  • @karl-heinzpeters7283
    @karl-heinzpeters7283 4 года назад

    Damn good video!

  • @karloa7194
    @karloa7194 4 года назад

    What I wanted to see is 3 amd64 masters and rpi workers.

  • @marvinfadri3479
    @marvinfadri3479 4 года назад

    Can I use this as a mini render farm?

  • @andreavergani7414
    @andreavergani7414 4 года назад

    nice!!

  • @rico7772007
    @rico7772007 4 года назад

    Great tutorial, just one question, can you mix up different raspberry, 3 and 4 together?

    • @LampJustin
      @LampJustin 4 года назад

      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 😂

  • @RTInf
    @RTInf 4 года назад +1

    Be warned that guy posting "wanna be friends?"-posts might be a hacker, which tries to take over accounts

    • @LearnLinuxTV
      @LearnLinuxTV  4 года назад +2

      Thanks, I try to remove these when I can but there's just so many...

  • @JustinLeif
    @JustinLeif 4 года назад

    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)

  • @haoaihaoai
    @haoaihaoai 3 года назад

    if
    sudo apt update
    fails update
    /etc/apt/sources.list.d/kubernetes.list
    file with
    deb packages.cloud.google.com/apt/ kubernetes-xenial main

  • @dantewhite7659
    @dantewhite7659 4 года назад

    yayyyy :)

  • @user-kx5es4kr4x
    @user-kx5es4kr4x 4 года назад

    *spoon*