Kubernetes tutorial - Install Kubernetes on Raspberry Pi fast in 2022

Поділитися
Вставка
  • Опубліковано 30 чер 2024
  • Kubernetes tutorial | Kubernetes explained | Kubernetes installation
    How to install Kubernetes on Raspberry Pi 3 or 4 cluster.
    #kubernetes #raspberrypi #kubernetestutorial #anmalkov #ubuntu
    💻 Commands to connect to Raspberry Pi via SSH:
    ssh username@ip-address
    💻 Commands to install Kubernetes master node on Raspberry Pi:
    sudo apt-get update
    sudo apt-get upgrade -y
    sudo nano /boot/cmdline.txt
    Add to the end of the file: cgroup_memory=1 cgroup_enable=memory
    sudo reboot
    curl -sfL get.k3s.io | sh -
    💻 Command to get Kubernetes master node token on Raspberry Pi:
    sudo cat /var/lib/rancher/k3s/server/node-token
    💻 Commands to install Kubernetes worker node on Raspberry Pi:
    sudo apt-get update
    sudo apt-get upgrade -y
    sudo nano /boot/cmdline.txt
    Add to the end of the file: cgroup_memory=1 cgroup_enable=memory
    sudo reboot
    curl -sfL get.k3s.io | K3S_URL=ip-address:6443 K3S_TOKEN=node-token sh -
    ⏰ Timestamps
    0:00 - Introduction
    1:26 - Install Raspberry Pi Imager
    2:45 - Flash Raspberry Pi OS x64 to SSD and SD cards
    9:25 - Connect to the Kubernetes master node
    12:04 - Install k3s on the master node
    18:46 - Get the master node token
    20:10 - Install k3s on the worker node
    25:46 - Connect to Raspberry Pi cluster from outside
    30:14 - Check the connection to Kubernetes cluster
    33:12 - Wrapping up
    🔗 Links
    www.raspberrypi.com/software/
    k3s.io
    👋 Connect with me
    My blog www.anmalkov.com
    Twitter / anmalkov
    LinkedIn / anmalkov
    Instagram / an_malkov
    Facebook / an.malkov.m
    🚀 Explore more
    wsl2 - Install Ubuntu on Windows 10 fast with Windows Terminal 👉🏼 • wsl2 - Install Ubuntu ...
    CI workflow in GitHub Actions with Buildah 👉🏼 • How to live without Do...
    Migration from Docker to Buildah and Podman 👉🏼 • How to live without Do...
    Native approach to build a container image with Buildah 👉🏼 • How to live without Do...
    Push an image to Docker Hub and GitHub packages using Buildah 👉🏼 / dxcsshjlum

КОМЕНТАРІ • 67

  • @michaelanderson3172
    @michaelanderson3172 4 місяці тому

    Simple straight forward. Wish all videos on UA-cam were this straight forward.

  • @outrospection4all
    @outrospection4all 7 місяців тому

    This is superb and to the point, greatly appreciated.

  • @chhatwalz
    @chhatwalz Рік тому +1

    Worked like a charm...Thanks for the video

    • @anmalkov
      @anmalkov  Рік тому

      Thank you for the kind words!

  • @mrpayne2008
    @mrpayne2008 Рік тому

    Very helpful; way to keep it simple but very effective.

  • @ajarvis92
    @ajarvis92 2 роки тому +2

    Thanks for a really good video!

    • @anmalkov
      @anmalkov  2 роки тому

      Thank you for the kind words!

  • @vitusyu9583
    @vitusyu9583 3 місяці тому +1

    Good! I am going to clean up all of my 5 Raspberry pi 4, and then install this k3s according to your demo!

  • @hectorfrohlichcortez88
    @hectorfrohlichcortez88 2 роки тому +1

    Thanks, really good video !

  • @SonuKumar-fn1gn
    @SonuKumar-fn1gn Рік тому

    Very good video thanks ❤

  • @MrTartans
    @MrTartans 2 роки тому +2

    Wonderful. I couldn’t get this watch a lot of other people videos. Well executed!!!!!

  • @icehunter85
    @icehunter85 2 роки тому +1

    tkn, very simple and direct

    • @anmalkov
      @anmalkov  2 роки тому

      Thank you for the kind words!

  • @camuscheung7832
    @camuscheung7832 Рік тому +1

    awesome video

  • @finishthecarrot4493
    @finishthecarrot4493 10 місяців тому +1

    thanks!

  • @alejandrocastronavarro7389
    @alejandrocastronavarro7389 2 роки тому +2

    Could you maCould you make a video about OpenFaaS working in that same cluster and make some example function? Thanks for your videos.

  • @user-kw9cu
    @user-kw9cu 9 місяців тому +1

    Thanks

  • @ManjunathKaranth-fe6dv
    @ManjunathKaranth-fe6dv Рік тому

    Hi Andrew Malkov
    Thanks for bringing such a wonderful organized tutorial. I am new comer in kubernetees world, to understand I tried multiple contents to build my cluster but this one is done in very simple way and thanks for the same. One part related to joining the connections in yml file (around 27.5) i think we need kubernetees to be installed on laptop (Where I am establishing the ssh towards my pi cluster). Reason is I do not see any .kube folder in my home directory.

    • @anmalkov
      @anmalkov  Рік тому

      Yes, kubectl should be installed on your laptop.

  • @_MoshikoAz_
    @_MoshikoAz_ 2 місяці тому

    Thanks for the video, when you connected the raspberry pi to the cluster, how did you figured it out what to do ?

  • @TheRawketLawnchair
    @TheRawketLawnchair 8 місяців тому +1

    quick question. how did you install your two fans to your cluster?

  • @vinodkinoni4863
    @vinodkinoni4863 Рік тому

    nice tut

  • @MrTartans
    @MrTartans 2 роки тому

    Would it be possible for new content “Auto-upgrade k3s using the system-upgrade-controller” tutorial?

  • @GormReventlow
    @GormReventlow 2 роки тому +1

    Really good video. I am new to Kubernetes. The cluster name "pi" when is that defined?

    • @anmalkov
      @anmalkov  2 роки тому

      Thank you! "pi" is just the name that I choose. You can name it as you want, eg. "picluster" or "mycluster" or "garage" - it really does not matter.

  • @antoniorobles998
    @antoniorobles998 2 роки тому +1

    Hi Andrew, great tutorial, well explained and straightforward. But I've a doubt, I have already 4 Raspberry Pis running with many containers running on each of them. It is possible to "convert" this environment into a Kubernetes cluster or I have to reinstall everything from the begining and start from scratch?. Im new commer in this, and It took me a lot of time and efforts to set this up... Thanks a lot!!!

    • @anmalkov
      @anmalkov  2 роки тому +1

      Hi Antonio, thank you for the kind words. You can combine your 4 pis into the one cluster and host all of your containers there. But you need to rewrite your Docker / Docker compose instructions into Kubernetes deployment manifests.

    • @antoniorobles998
      @antoniorobles998 2 роки тому

      @@anmalkov so, rewriting every docker-compose and creating a máster It is possible?

    • @anmalkov
      @anmalkov  2 роки тому

      In your cluster you will have only 1 master and 3 worker nodes. All containers that you are running now will be run on these worker nodes. To run your containers now you are using Docker compose or just Docker commands. It's not possible to use it with Kubernetes. You need to rewrite your Docker commands / compose files to Kubernetes deployment manifests that are written in YAML.

    • @antoniorobles998
      @antoniorobles998 2 роки тому

      @@anmalkov Ok, now I understand perfectly! thank you very much. So I think that I'll try Kubernetes in my next life... Thinking of start everthing from the begining really scares me.

  • @gowthamhs7332
    @gowthamhs7332 7 місяців тому

    I followed different videos till now and same error was getting popped up each time "cgroup not found"
    Thank you man for the proper instruction

  • @jlpcpr
    @jlpcpr Рік тому

    Have you happened to get the Kubernetes Dashboard working and accessible from outside the Raspberry Pi? I am having a horrible time getting it to be accessible.

  • @azatecas
    @azatecas Рік тому +1

    hey im a noob, im going to follow this tutorial. i only have 2 rpi but does the master node only work as a master node? or does it see itself as a worker too? i ask because if i only have 2 pis for the cluster will one node be doing all the work? or should i wait until i have alot of nodes. since im not too sure i welcome any help

    • @anmalkov
      @anmalkov  Рік тому

      The master can also host the workloads. However it's not recommended. But, who cares about recommendations if it's your own home cluster ;) I would suggest to not wait and use what you have, if it won't work for you - just add another one pi

  • @alejandro-acho
    @alejandro-acho 5 місяців тому

    QQ if I have 2 pis, one of 2gb ram and the other one with 4, which one is recommended to use as the master?

  • @gsantiago1980
    @gsantiago1980 10 місяців тому

    All of it seemed pretty easy until it came time to edit the kube config. How do I get a copy of that on my PC to be able to edit it in vs code?

  • @tsob99
    @tsob99 Рік тому +1

    Hello Andrew, it is a very good tutorial. I have installed the kubernetes as you recommended on running raspi-system and it is running without problems The only thing is that yaml is new for me. My question is can you publish the yaml source on your youtube-channel?

    • @anmalkov
      @anmalkov  Рік тому

      Hello Thomas, thank you for the kind words. What yaml file you are talking about? I don't think that I used yaml in this video. Regards, Andrew

    • @tsob99
      @tsob99 Рік тому

      ​@@anmalkov

    • @tsob99
      @tsob99 Рік тому

      @@anmalkov Hello Andrew you find it when you scroll to 27:28

    • @tsob99
      @tsob99 Рік тому

      Sorry it was 27:54

    • @yves-guillaumeherve6883
      @yves-guillaumeherve6883 9 місяців тому

      @@tsob99 You can find your own config yaml file at /etc/rancher/k3s/k3s.yaml. You can't use an another one. It's used to configure your laptop after install kubectl.

  • @gerardpontino
    @gerardpontino 2 роки тому

    Hi, may I ask which SSD are you using?

    • @anmalkov
      @anmalkov  2 роки тому

      Hi, I'm using Crucial BX500 120GB Internal SSD.

  • @user-mb7ti5nm9n
    @user-mb7ti5nm9n 4 місяці тому

    Is it important to be installed on Ubuntu, or it is only an option?

  • @Agamemnonuk
    @Agamemnonuk 11 місяців тому

    My next project

  • @Kru83
    @Kru83 6 місяців тому

    Hello, How are you doing autocomplete in your PowerShell command?

    • @anmalkov
      @anmalkov  6 місяців тому +1

      Please look at my latest videos. There is the step by step guide.

  • @alejandrocastronavarro7389
    @alejandrocastronavarro7389 2 роки тому +2

    How do you make the commands from the history appear below in the powershell?

    • @anmalkov
      @anmalkov  2 роки тому +1

      I will publish a short video about it soon.

    • @stfnbstl9379
      @stfnbstl9379 2 роки тому +1

      Google for "Adding Predictive IntelliSense to my Windows Terminal PowerShell Prompt with PSReadline" ;) It's not hard to install

    • @alejandrocastronavarro7389
      @alejandrocastronavarro7389 2 роки тому

      @@stfnbstl9379 thank you

  • @GormReventlow
    @GormReventlow 2 роки тому +1

    could you make a video adding your cluster to rancher?

    • @anmalkov
      @anmalkov  2 роки тому

      Thank you for the suggestion. I will see what I can do

    • @mitchross2852
      @mitchross2852 2 роки тому +1

      @@anmalkov Im looking for this also. Please add!

  • @MKH-92
    @MKH-92 11 днів тому

    How will vs code pop up?

  • @josephciriza7783
    @josephciriza7783 Рік тому

    What happens if I don't set a static IP address?

    • @anmalkov
      @anmalkov  Рік тому

      Hi Joseph, could you please tell me what static IP address you are talking about? Thx

    • @biswajithalder2441
      @biswajithalder2441 Рік тому

      check netplan , cd /etc/netplan, 50-cloud-init.yaml config.yaml creat your own config.yaml for static ip address configaration. (Netplan apply /config.yaml) :)

    • @josephciriza7783
      @josephciriza7783 Рік тому

      @@anmalkov Hello, for some odd reason when I try to set a static IP address to mi Pi's it doesn't work (while every tutorial shows its very simple).
      I skipped ahead and clustered them any way and both nodes show "ready", however I am still worried because I never set a static IP.
      Sorry for the long comment.

  • @jagermeister1888
    @jagermeister1888 Рік тому

    27:38

    • @anmalkov
      @anmalkov  Рік тому

      Thanks. I missed that.

  • @237311
    @237311 Рік тому

    Useful video. Followed your instructions line by line.
    ubuntu@master:~$ sudo kubectl get nodes
    E0506 15:30:16.957925 28052 memcache.go:265] couldn't get current server API group list: the server is currently unable to handle the request
    E0506 15:30:16.983338 28052 memcache.go:265] couldn't get current server API group list: the server is currently unable to handle the request
    E0506 15:30:17.001146 28052 memcache.go:265] couldn't get current server API group list: the server is currently unable to handle the request
    Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes)

    • @locomotivebreath2831
      @locomotivebreath2831 7 місяців тому

      I got the same thing. I discovered my /etc/hosts file was reset to a clean state. After researching this I found that the /etc/cloud/templates/hosts.debian.tmpl had to be updated with the additional worker node addresses:
      sudo nano /etc/cloud/templates/hosts.debian.tmpl
      #add everything you want to appear in /etc/hosts - save and reboot master.
      Then my master appeared when I ran sudo kubectl get nodes
      I am running Ubuntu server 22.04